Database & media storage
Database
NovaDocs uses Prisma. Production should use Postgres.
Apply schema changes
When you update the app and the database schema changed:
bashnpx prisma db push
Use your real DATABASE_URL (local .env or production URL).
Docker:
bashdocker compose exec app npx prisma db push
Supabase tips
- Use the transaction pooler (port 6543) +
pgbouncer=trueon Vercel - Session mode has a low connection limit and can error under load
- Optional: set
?schema=novadocsif you want a dedicated schema
Media uploads
When someone uploads an image or file:
- Supabase Storage — if
SUPABASE_SERVICE_ROLE_KEYis set - Otherwise database storage — file bytes saved in Postgres and served from
/api/media/file/...
You do not need local disk folders on the server for uploads.
Enable Supabase Storage
- In Supabase → Project Settings → API, copy the service_role key
- Add to env:
envSUPABASE_URL="https://YOUR_PROJECT.supabase.co" SUPABASE_SERVICE_ROLE_KEY="eyJ..."
- Redeploy / restart
NovaDocs will create a public bucket named novadocs-media when needed.
