Vercel’s serverless runtime does not support a durable on-disk SQLite file. This project uses PostgreSQL so API routes can persist tasks and logs.
-
Create a database
- Neon (free tier) or any Postgres host.
- Copy the connection string (use SSL where required, e.g.
?sslmode=require).
-
Connect the GitHub repo in Vercel and add environment variables:
Name Required Notes DATABASE_URLYes Postgres URL (Neon pooled or direct). If prisma migrate deploytimes out (P1002), use Neon’s direct URL for builds or run migrations locally.OPENAI_API_KEYOptional If unset, users can use BYOK in the app TASKHUB_TIMEZONEOptional e.g. America/New_YorkNEXT_PUBLIC_APP_URLRecommended Your site URL (used in playbook assignment emails/SMS). Vercel: https://<project>.vercel.appRESEND_API_KEYOptional Department playbooks: email workers their checklist link RESEND_FROM_EMAILOptional Verified sender, e.g. Task Hub <noreply@yourdomain.com>TWILIO_*Optional Playbooks SMS: TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN,TWILIO_FROM_NUMBERNeon: Pooled is fine for the running app. If migrations fail on the pooler host, switch
DATABASE_URLto the direct connection for the deploy step or runnpx prisma migrate deployfrom your machine with the direct URL. -
Deploy
The build runsprisma migrate deploy && next build, which applies migrations to your database and then builds Next.js. -
Neon + Prisma
For connection pooling with Neon, you may use their pooled URL and Prisma’s recommended query params.
- Ensure
DATABASE_URLis set for Production (and Preview if you use preview deploys) in Vercel before the build runs. postinstallrunsprisma generate, which needsDATABASE_URLpresent in the environment so the schema can be resolved.
Usually means prisma migrate deploy is using the pooler. Use Neon’s direct connection string for the step that runs migrations (e.g. set DATABASE_URL to direct in the Vercel build env, or run npx prisma migrate deploy locally with the direct URL).
This means Vercel’s DATABASE_URL is missing, empty, or not a Postgres URL (e.g. still file:./dev.db, or broken).
- Vercel → your project → Settings → Environment Variables.
- Add or fix
DATABASE_URL:- Value must start with
postgresql://orpostgres://(Neon’s connection string does). - Paste only the URL — do not wrap the whole value in extra
""quotes in the UI (no"postgresql://..."as the stored value).
- Value must start with
- Apply to Production and Preview if you build previews.
- Redeploy after saving.
Local builds use .env; ensure that file has a Postgres URL too (not SQLite).
If you previously used file:./dev.db, switch .env to a Postgres URL, run npx prisma migrate dev locally once, and redeploy.
This repo pins Node 20 LTS via package.json → engines and .nvmrc. Vercel uses engines.node for installs and builds—avoid Node 24 unless you have a specific need.
Skew Protection must be turned on in the Vercel project UI (not in this repo): Project → Settings → Runtime / Deployment Protection (wording varies). Enable it to reduce mismatches between a new deployment’s server and an old tab still running previous client JS after a deploy.