Sistine Docs

Deployment

Deploy your Sistine Starter app to production.

Prerequisites

Before deploying, ensure you have:

  • PostgreSQL database (Supabase, Neon, or Vercel Postgres)
  • Volcano Engine API key
  • Dodo Payments or Waffo (Pancake) account and API keys
  • Resend API key
  • (Optional) Google OAuth credentials
  • (Optional) S3-compatible storage

Deploy to Vercel

1. Push to GitHub

git push origin main

2. Import in Vercel

  1. Go to vercel.com
  2. Import your GitHub repository
  3. Set all environment variables (see Environment Variables)
  4. Deploy

3. Database Migration

After first deploy:

pnpm db:migrate

db:migrate applies the committed SQL in drizzle/ and records it in drizzle.__drizzle_migrations. Do not use db:push — it silently alters the schema with no migration record, so the next migrate will drift.

4. Configure Webhook

Register the webhook for the provider you use:

pnpm webhooks:register --list      # see what's registered
pnpm webhooks:register --url https://your-domain.com

Or set it by hand in the dashboard:

ProviderURLHeader it needs
Dodohttps://your-domain.com/api/payments/dodo/webhookwebhook-signature (Standard Webhooks)
Waffohttps://your-domain.com/api/payments/waffo/webhookx-waffo-signature (RSA-SHA256)

Then verify the shared secret actually matches what's deployed — a mismatch only shows up as "provider says our endpoint always returns 401":

pnpm verify:signature https://your-domain.com    # Dodo

5. Set Up Cron Job

For annual subscription credit grants, configure a cron job to call hourly:

curl -H "Authorization: Bearer YOUR_CRON_SECRET" \
  https://your-domain.com/api/cron/subscription-grants

On Vercel, add to vercel.json:

{
  "crons": [{
    "path": "/api/cron/subscription-grants",
    "schedule": "0 * * * *"
  }]
}

6. Create Admin Account

ADMIN_EMAIL=admin@example.com pnpm admin:setup

7. Verify Environment

Make sure production .env has correct values for:

  • BETTER_AUTH_URL — Your actual domain
  • NEXT_PUBLIC_APP_URL — Your actual domain
  • RESEND_FROM_EMAIL — Verified domain sender

Post-Deploy Checklist

  • Database migrated
  • Webhook URL configured at the provider you use (pnpm webhooks:register --list)
  • pnpm doctor:online passes (provider product IDs actually exist)
  • Cron job set up for credit grants
  • Admin account created
  • Email sender domain verified in Resend
  • OAuth redirect URIs updated for production domain
  • Analytics keys configured (PostHog, GA, Clarity)

On this page