Deployment
Vercel (recommended)
Section titled “Vercel (recommended)”Deploy as two Vercel projects from the same Git repo. Users see one domain; Vercel routes by path.
| Path | Project | Root directory |
|---|---|---|
/, /blog/*, /docs/* | Marketing | apps/web |
/app/* | Dashboard + API | apps/app |
- App project — create a Vercel project with root directory
apps/app. Install the Supabase integration (setsDATABASE_URL,SUPABASE_URL, keys). - Web project — create a second project with root directory
apps/web. Attach your custom domain here. - Update the rewrite in
apps/web/vercel.json— set the destination to your app project’s Vercel URL:
{ "rewrites": [ { "source": "/app/:path*", "destination": "https://your-app-project.vercel.app/app/:path*" } ]}- Run migrations against Supabase using the direct Postgres URL (port 5432):
DATABASE_URL=postgresql://...:5432/postgres pnpm db:migrate- Create a Supabase Storage bucket matching
SUPABASE_STORAGE_BUCKET(default:uploads).
Environment
Section titled “Environment”Set these in the app Vercel project:
BETTER_AUTH_URL=https://yourdomain.com/appNEXT_PUBLIC_APP_URL=https://yourdomain.com/appPUBLIC_WEB_URL=https://yourdomain.comPUBLIC_APP_URL=https://yourdomain.com/appCRON_SECRET=your-random-secretUse the pooler URL (port 6543) for DATABASE_URL at runtime.
Set PUBLIC_WEB_URL and GA vars in the web project.
Background jobs
Section titled “Background jobs”| Job type | Production | Local dev |
|---|---|---|
Cron (sendWeeklyDigest) | Vercel Cron → /app/api/cron/weekly-digest | pnpm jobs:worker or curl with CRON_SECRET |
Queue (processUpload) | Inline in API (default) | Same |
Optional Redis.io for queued uploads:
REDIS_URL=rediss://default:...@....redis.io:6379When REDIS_URL is set, run pnpm jobs:worker on an external host (not Vercel) to consume BullMQ jobs.
Local development
Section titled “Local development”Unchanged — two processes:
pnpm dev # Astro :4321 + Next :3000pnpm jobs:worker # optional local cron + queues