StackSupply
Back to docs

Vercel deployment

Deploy this SaaS starter from a private GitHub repository.

Follow this checklist to connect GitHub, add production secrets, run Prisma migrations, and verify the live app.

Vercel project import

Git provider

GitHub

Private repository access

Selected repo only

Project settings

Framework: Next.js
Install: npm install
Build: npm run build
01

Create your Vercel account

Sign up with GitHub, then allow Vercel to access the private repository that contains this project.

vercel.com/signup

02

Import the GitHub repository

Create a new Vercel project, select this private repo, and keep the detected Next.js framework settings.

Project -> Add New -> Project

03

Connect Postgres

Create a managed Postgres database from Vercel Storage or Marketplace, then attach its DATABASE_URL to the project.

Storage -> Create Database

04

Add production environment variables

Add database, NextAuth, Stripe, Resend, Google OAuth, app environment, and admin email variables for Production.

Settings -> Environment Variables

05

Set the build command

Run Prisma migrations before the Next.js production build so the production database schema is ready.

npx prisma migrate deploy && npm run build

06

Deploy and verify

Trigger a deployment, check build logs, then test login, billing, webhooks, and admin access on the production URL.

Deployments -> Redeploy

Environment variables

Production
DATABASE_URL
NEXTAUTH_URL
NEXTAUTH_SECRET
APP_ENV
NEXT_PUBLIC_APP_ENV
STRIPE_SECRET_KEY
STRIPE_WEBHOOK_SECRET
STRIPE_PRICE_PRO_MONTHLY
STRIPE_PRICE_PRO_YEARLY
RESEND_API_KEY
RESEND_FROM
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
NEXT_PUBLIC_GOOGLE_ENABLED
FREE_PLAN_ENABLED
ADMIN_EMAILS

Production build command

Keep this command in Vercel so migrations run before the optimized build.

npx prisma migrate deploy && npm run build

The project also runs prisma generate during install through the postinstall script.

Deployment pipeline

1

Git push

main branch

2

Prisma

migrate deploy

3

Next.js

production build

4

Vercel

live URL

If Vercel blocks the commit author

Make sure the GitHub account connected to Vercel owns the commit author email, then push a new commit from that account.

git config user.email "your-github-email@example.com"
git commit --allow-empty -m "Trigger Vercel deploy"
git push

Final production checks

Register and sign in with email.
Confirm Google OAuth callback URL uses the production domain.
Complete a Stripe Checkout test.
Verify Stripe webhook delivery for /api/stripe/webhook.
Open the customer billing portal.
Confirm ADMIN_EMAILS can access /app/admin.