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
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.
Resend is the preferred production path, with SMTP supported as fallback.
Vercel deployment workflow
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.
Set the environment variables in Vercel
At minimum, configure the core app, database, email, Stripe, and OpenRouter variables.
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 neededDeploy once to verify the build and runtime wiring
The repo already includes a Vercel-aware build path and standalone Next.js output configuration.
npm run buildBootstrap the production database
Run these commands from a terminal where DATABASE_URL points to the production database.
12npx prisma db pushnpm run db:seedUpdate external callbacks and webhooks
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/stripeAfter you add Prisma migrations
npx prisma migrate deploy instead of db push.Alternative hosting options
Railway
Useful if you want the app and PostgreSQL hosted on the same platform. Build with npm run build, start with npm start, then run the production bootstrap once.
Self-hosted Node or Docker
The app can run behind your own reverse proxy or container platform. Expose port 3000, inject runtime env vars, and bootstrap PostgreSQL before traffic goes live.
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
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
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
Related guides
Installation
Review the complete environment layout and bootstrap commands.
Billing
Confirm the Stripe plan and webhook behavior before launch.
API
Check route behavior and payloads when preparing production integrations.
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.