Data model

Three databases, three credentials, no foreign keys between them. Each role can connect to exactly one, so a leak of any single connection string exposes only what that database holds. Cross-references are opaque IDs resolved in application code — see lib/accounts/hydrate.ts.

Generated from the Prisma schemas by npm run docs:schema and committed to docs/schema/, so the diagram here is always the diagram in the repository.

Core

Harvested records and their change history, plus organizations, teams, memberships, watches, API keys and integrations.

database
govdeets
env
DATABASE_URL

Auth

Identity only — users, provider links, sessions and passkeys. No passwords exist in this schema and none ever will.

database
govdeets_auth
env
AUTH_DATABASE_URL

Billing

Plans, entitlements, subscriptions, invoices and metered usage. Holds no card data — only a provider token, brand and last four.

database
govdeets_billing
env
BILLING_DATABASE_URL