Deployment

Deploy your SaaS application to any hosting platform.

Deploying this app means provisioning infra, setting env vars, deploying code, running Prisma migrations, and wiring any billing webhooks you actually use.

This guide covers the general process. For platform-specific steps, see Railway or Docker.

Infrastructure

You need:

  • hosting for apps/web
  • a PostgreSQL database
  • object storage if you use uploads
  • an email provider

Build Settings

  • Root directory: apps/web
  • Build command: pnpm build
  • Output directory: .next
  • Install command: pnpm install

Database Migrations

Run production migrations with:

read -s DATABASE_URL && export DATABASE_URL && npx prisma migrate deploy --schema packages/database/src/prisma/schema.prisma

Webhooks

Verify the route used by your active billing provider before configuring production webhooks.

For Stripe in this repo, the local listener forwards to:

/api/auth/stripe/webhook

Common Pitfalls

  • forgetting production migrations
  • wrong webhook path
  • missing env vars
  • wrong monorepo root directory in the hosting platform