Documentation

ProductionVercel recommended

Deployment guidance for taking the starter to production with fewer surprises.

The fastest stable path is Vercel plus managed PostgreSQL, but the app can also run on Railway or a custom Node host. The critical detail for this repository is the database bootstrap flow.

Important repo note
This project does not currently include checked-in Prisma migrations. First-time production setup should use npx prisma db push and npm run db:seed against the production database unless you add migrations yourself.

Recommended production stack

App host

Vercel for the cleanest Next.js deployment path.

Database

Managed PostgreSQL from Neon, Railway, Supabase, or Vercel Postgres.

Billing

Stripe with product price IDs and a production webhook endpoint.

Email

Resend is the preferred production path, with SMTP supported as fallback.

Vercel deployment workflow

1

Import the repository and define the production domain

Push the repository to GitHub, import it into Vercel, and decide on the canonical production URL first.

2

Set the environment variables in Vercel

At minimum, configure the core app, database, email, Stripe, and OpenRouter variables.

Minimum production variablesbash
DATABASE_URL="postgresql://..."
NEXTAUTH_URL="https://your-domain.com"
NEXTAUTH_SECRET="replace-with-a-strong-secret"
NEXT_PUBLIC_APP_URL="https://your-domain.com"
APP_NAME="AI SaaS"

# Add your email, Stripe, OAuth, and OpenRouter vars as needed
3

Deploy once to verify the build and runtime wiring

The repo already includes a Vercel-aware build path and standalone Next.js output configuration.

Local production checkbash
npm run build
4

Bootstrap the production database

Run these commands from a terminal where DATABASE_URL points to the production database.

Production bootstrapbash
1
2
npx prisma db push
npm run db:seed
5

Update external callbacks and webhooks

Production endpointstext
Google callback:
https://your-domain.com/api/auth/callback/google

GitHub callback:
https://your-domain.com/api/auth/callback/github

Stripe webhook endpoint:
https://your-domain.com/api/webhooks/stripe
After you add Prisma migrations
If you later decide to manage schema changes through checked-in Prisma migrations, update production deploys to use npx prisma migrate deploy instead of db push.

Alternative hosting options

Operational checklist

NEXTAUTH_URL and NEXT_PUBLIC_APP_URL point to the same production domain.

OAuth provider dashboards use the exact production callback URLs.

Stripe price IDs match the Pro and Business plans in the application.

The Stripe webhook secret is set and deliveries are succeeding.

The production database contains seeded roles, permissions, and plans.

Email verification links open the correct production host over HTTPS.

Common failure points

Authentication breaks only in production
Double-check NEXTAUTH_URL, HTTPS, and the exact callback URLs registered in Google and GitHub. A mismatch of even one character will break the sign-in round-trip.
Billing looks correct but subscriptions do not update
Verify that STRIPE_WEBHOOK_SECRET is set, the production webhook endpoint is live, and the Stripe products behind your price IDs match the plans exposed in the UI.
Deployment strategy
If your team is using preview deployments, keep auth and billing callbacks pointed at the canonical production domain. Preview URLs are useful for visual review, not for customer-facing callback flows.

Related guides

Professional rule of thumb

Treat callback URLs, database bootstrap, and webhook delivery as release blockers. Those three items are responsible for most production setup mistakes in a stack like this.