Route /api/auth through the same origin in both dev and prod so cookies stay first-party and the browser and React Router SSR share one auth surface. - Vite dev server proxies /api/auth to the Convex HTTP site. - Better Auth uses secure cookies when the site URL is https. - Add docs/auth-proxy.md documenting the required production ingress (Caddy/Traefik) and Convex SITE_URL / CONVEX_SITE_URL setup.
Convex Backend
Convex is the only application API used by web, desktop, and mobile clients. The active backend covers the durable control plane through Slice 4: tenancy, projects, conversation turns, Signals, Work planning, approved Design slices, simulated Runs and Attempts, artifacts/delivery metadata, and Flue persistence.
Domain relations
organizationsandorganizationMembersown tenancy.projectsowns the single v0 Git source;projectContextDocumentsstores repository context.conversations,conversationTurns,conversationMessages, andconversationAttachmentsown chat admission and reactive history.signals,signalConstraints, andsignalSourcespreserve structured intent and exact evidence.works,signalWorkAttachments, andworkEventsown proposed Work and provenance.workDefinitions,workQuestions, andworkApprovalsown versioned outcome contracts and approvals.designPacketsandworkSlicespreserve versioned implementation intent and executable slice order.workRuns,workAttempts,workAttemptEvents, andresolverDecisionsown bounded simulated execution and recovery.workArtifactsandworkDeliveriespreserve evidence and delivery metadata without performing Git or sandbox work.
The flue* tables are infrastructure tables required by Flue's persistence contract. They are deliberately separate from the product relations.