Skip to Content
StackBlaze Templates — operator documentation
AI SaaS KitDeploymentDeploy to Vercel

Deploy to Vercel

The template is built for Vercel — Next.js 16 App Router with zero extra config.

Push to a Git repo

Create a repository and push your scaffolded project.

Import into Vercel

Create a new Vercel project from the repo. The framework preset is detected automatically (Next.js); the default build command works.

Provision a database

You need a production Postgres. Either bring your own (Supabase, Neon, etc.) or add one from the Vercel Marketplace. See Database.

Set environment variables

Add every var your build uses (from .env.local) to the Vercel project. At minimum:

  • DATABASE_URL (production Postgres, usually with ?sslmode=require)
  • BETTER_AUTH_SECRET
  • BETTER_AUTH_URL and NEXT_PUBLIC_BETTER_AUTH_URL — set to your production domain
  • Your AI_PROVIDER + key
  • Stripe keys (if billing is on)

You can sync these with the Vercel CLI:

vercel env pull .env.local # pull existing vercel env add DATABASE_URL # add one

Set BETTER_AUTH_URL / NEXT_PUBLIC_BETTER_AUTH_URL to your real domain before going live, and re-register any OAuth callback URLs to match — otherwise auth redirects to localhost.

Apply the schema to production

Run the Drizzle push against your production DATABASE_URL (locally, with the prod URL in your env, or as part of your pipeline):

npm run db:push

Deploy

Push to your default branch, or run:

vercel --prod

After deploy

  • Wire the Stripe production webhook — see Stripe in production.
  • Switch email to Resend with a verified domain — see Email.

Vercel AI Gateway. On Vercel you can route AI calls through the AI Gateway for unified multi-provider access, failover, and cost tracking, instead of pinning a single provider key. Worth considering once you’re in production.