Engineering
Database
Data domains, migration workflow, and realtime state ownership.
Database
Urmate uses the database as the source of truth for users, sessions, Study records, instructor applications, chat agents, channel providers, tasks, community installs, XRouter configuration, billing, runtime workspaces, and admin state.
Core Domains
| Domain | Stores |
|---|---|
| Auth | Users, sessions, accounts, roles, profile metadata. |
| Study | Courses, boards, library items, podcasts, progress, instructor profiles, bookings, certificates, organizations. |
| Instructor | Applications, agreements, payout details, verification status, sessions, course plans, strikes. |
| Chat | Agents, channel providers, channel threads, external messages, tasks, workroom messages, community installs. |
| XRouter | Providers, models, keys, endpoints, quota tracking, usage logs, CLI tool settings. |
| Builders | Projects, files, snapshots, runtime metadata, import drafts. |
| Infrastructure | VPS records, sandbox connections, API keys, volumes, registries, snapshots, heartbeats. |
| Billing | Subscriptions, checkout sessions, coupons, receipts, payment provider metadata. |
Migration Workflow
Use the repo's existing Prisma workflow. Common commands:
cd /root/apps/urmate
pnpm prisma generate
pnpm prisma migrate dev
pnpm prisma db push
Use migrate dev when you need a named local migration. Use db push only for rapid local iteration where the team has accepted that schema history is not being generated.
Realtime Expectations
Most dashboards poll or fetch API state after mutations. Features that users expect to feel realtime include:
- Study notifications;
- instructor booking requests;
- Circles messages and avatars;
- chat channel webhooks;
- task workroom output;
- XRouter usage counters;
- infrastructure heartbeat status.
When adding a feature, store durable state first, then update client state optimistically only when the server mutation succeeds.

