Vercel is the default host for the web app. It builds from your Git repository on every push, with previews for pull requests.
1. Import the project
- Push your project to GitHub, GitLab or Bitbucket.
- In Vercel, click Add New → Project and import the repository.
- Set Root Directory to
apps/web. Vercel detects Next.js and the pnpm workspace, and installs from the repository root. - Leave the build and install commands at their defaults.
apps/web'sbuildscript runsprisma generatebeforenext build, and the lockfile pruned for your download works with Vercel's frozen install.
2. Add environment variables
Add production values under Settings → Environment Variables, separately for Production and Preview. Start with what boot validation requires:
| Variable | Value |
|---|---|
NEXT_PUBLIC_URL | https://your-domain.com (Production) |
NEXT_PUBLIC_SAAS_NAME | Your product name, exactly as seeded |
DATABASE_URL | Pooled production Postgres URL |
BETTER_AUTH_SECRET | A new value: openssl rand -base64 32 |
Then the toggles and credentials for every feature you use: email, OAuth, storage, Upstash, payments, CMS, AI. Production refuses to start if an enabled feature lacks credentials; the error lists them. Run pnpm doctor --check locally against the production values to catch problems before deploying.
NEXT_PUBLIC_* values are inlined at build time, so redeploy after changing one.
3. Prepare the database
Nothing in the Vercel build touches your database. From your machine or CI:
DATABASE_URL="postgresql://…production…" pnpm --dir packages/database migrate:deploy
DATABASE_URL="postgresql://…production…" pnpm seed # once; NEXT_PUBLIC_SAAS_NAME must match production
Then sign up right away: the first account becomes the admin.
4. Connect services to the production URL
- Domain: add it under Settings → Domains, then update
NEXT_PUBLIC_URL. - OAuth: add
https://your-domain.com/api/auth/callback/<provider>to Google, GitHub (a separate OAuth App) and LinkedIn. - Payments: create the production webhook endpoint (
/api/payments/stripe/webhookor/api/payments/dodo/webhook) with live keys. - Email: verify the sending domain in Resend.
- Storage: connect a Blob store to the project, or set the R2 variables, and allow the image host in
next.config.mjs. - Analytics: enable Vercel Analytics and Speed Insights in the dashboard if you want them.
Function settings
- Put functions in the same region as your database (Settings → Functions → Region).
- Routes that stream (AI chat) set
maxDuration; check your plan's limit. - The open-source repository ships the starter source with its download routes through
outputFileTracingIncludesinnext.config.mjs. A downloaded project does not have those routes.
Previews
Preview deployments use the Preview environment variables. Point them at a separate database (for example a Neon branch) so previews never migrate or write production data, and use test-mode payment keys.
Troubleshooting
Invalid server environmentin the runtime logs: a required variable is missing or weak; the message lists each one.Module not foundfor@workspace/...: the Root Directory is notapps/web, or the install ran outside the workspace.- Prisma "did not initialize yet": the build skipped
prisma generate; keep the default build command. - OAuth redirect mismatch:
NEXT_PUBLIC_URLand the provider's callback URL must match exactly.
