Skip to main content

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

FileResponsibility
convex/schema.tsDefines tables, indexes, and typed field validation
convex/auth.tsConfigures email OTP, magic links, Google auth, and Apple auth
convex/http.tsExposes health, cron, and Railway deployment ingest HTTP routes
convex/users.tsCurrent user helpers and account-related queries
convex/permissions.tsCapability checks and authorization helpers
convex/events.tsEvent domain logic
convex/orders.tsOrders 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:

  • users
  • platformRoles
  • organizations
  • workspaces
  • workspaceMembers
  • teamMembers
  • events
  • ticketTiers
  • orders
  • passes
  • checkIns
  • dpTemplates
  • generatedDps
  • notifications
  • releases

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