Backend and Data
Convex as the primary backend
Most platform logic lives in convex/. This includes:
- schema definitions
- auth wiring
- queries and mutations
- server actions
- HTTP routes for health, cron-like jobs, and deployment ingest
Important Convex files
| File | Responsibility |
|---|---|
convex/schema.ts | Defines tables, indexes, and typed field validation |
convex/auth.ts | Configures email OTP, magic links, Google auth, and Apple auth |
convex/http.ts | Exposes health, cron, and Railway deployment ingest HTTP routes |
convex/users.ts | Current user helpers and account-related queries |
convex/permissions.ts | Capability checks and authorization helpers |
convex/events.ts | Event domain logic |
convex/orders.ts | Orders and order lifecycle |
convex/dp* | DP generation, campaign, safety, hub, and batch workflows |
Data model highlights
The schema is broad, but these are the foundational records:
usersplatformRolesorganizationsworkspacesworkspaceMembersteamMemberseventsticketTiersorderspassescheckInsdpTemplatesgeneratedDpsnotificationsreleases
Relationship patterns
- Users can belong to organizations and workspaces.
- Organizations own events and operational assets.
- Events connect to ticket tiers, sessions, orders, passes, campaigns, and check-ins.
- Release history is stored in Convex and enriched with Railway deployment metadata.
Auth and access model
- Convex Auth manages the auth tables.
- User records extend auth state with role, profile, workspace, and organization data.
- Capability-based checks are enforced through
requireCapability()in privileged flows.
FastAPI support service
backend/server.py exposes a smaller HTTP backend for:
- payment helper routes
- add-on routes
- email service integration
- moderation
- wallet pass generation
- badge and pass-related utilities
This backend is also the target behind the mobile gateway proxy.
Typed IDs and conventions
Follow the repo conventions from AGENTS.md when extending the schema:
- use
v.id("tableName")in Convex schema fields - use
Id<"tableName">in TypeScript - prefer existing auth and capability helpers instead of ad hoc role checks