Documentation

Database

Prisma + MongoDB back every auth, billing, and usage feature while keeping schemas simple to extend.

Schema design

`prisma/schema.prisma` includes Users, Sessions, Accounts, Subscriptions, UsageRecord, and NotificationPreferences. Add your own models and run `npx prisma db push` to sync.

Relevant files

  • prisma/schema.prisma — Prisma schema

Typed queries

Import the singleton Prisma client from `src/lib/db.ts` anywhere in the project. Server components, API routes, and cron jobs can all share it safely.

Relevant files

  • src/lib/db.ts — Prisma client helper