Overview
Polaris IDE uses Convex as its real-time database. The schema defines five main tables that handle user management, project storage, file systems, conversations, and AI-generated events.Schema Constants
Maximum number of projects allowed for free tier users
Number of days for pro tier trial period
Tables Overview
Users
Stores user authentication data, subscription status, and project limits. See Users Table for details. Indexes:by_stack_user- Query users by Stack Auth user IDby_clerk- Legacy index for Clerk migration periodby_autumn_customer- Query users by Autumn billing customer ID
Projects
Manages user projects with import/export status tracking. See Projects Table for details. Indexes:by_owner- Query projects by owner’s Stack Auth IDby_user- Query projects by Convex user document ID
Files
Hierarchical file system with support for text files and binary storage. See Files Table for details. Indexes:by_project- Query all files in a projectby_parent- Query children of a folderby_project_parent- Composite index for folder contents
Conversations
Chat conversations linked to projects for AI interactions. Indexes:by_project- Query all conversations in a project
Messages
Individual chat messages with AI tool call tracking. Indexes:by_conversation- Query messages in a conversationby_project_status- Query messages by project and status
Generation Events
Tracks AI code generation events with timestamps. Indexes:by_project_created_at- Query events chronologically per project
Relationships Diagram
Schema Definition
The complete schema is defined inconvex/schema.ts:
Authentication
All database operations require authentication via Stack Auth:Best Practices
The
clerkId field in users table is legacy and maintained only during the migration period from Clerk to Stack Auth.