Persistence Boundary
This repo inherits the useful part of thenext-forge database philosophy, not the default provider stack.
The useful part is:
- keep database ownership inside
@repo/database - keep auth/session ownership inside
@repo/auth - keep apps importing package-owned boundaries instead of raw provider clients
Current truth
packages/databaseis the data-plane boundary.packages/authowns request-scoped and browser-scoped Supabase auth helpers.supabase/migrationsis the schema source of truth.- many runtime surfaces still run through a mock-backed adapter.
- stable repository interfaces
- a clean split between mock and Supabase adapters
- an honest provider-agnostic contract that we can switch behind quickly
Go-forward rules
- Put data access in
packages/database. - Put auth/session helpers in
packages/auth. - Do not import
@supabase/supabase-jsdirectly in apps for data-plane work. - Do not claim the repo is ORM-swappable until mock and Supabase implementations conform to the same repository interfaces.
- When persistence changes, update the migration docs and the database package contract together.
Migration direction
The intended sequence is:- define repository interfaces in
packages/database - split mock and Supabase adapters
- standardize root migration and type-generation scripts
- remove misleading Prisma leftovers from active guidance
- keep future provider or ORM changes contained inside
@repo/database