Deployment

Vercel is the happy path here: connect the GitHub repo, set production env vars, point Stripe webhooks at the deployed URL, then ship.

1. Push to GitHub

git add .
git commit -m "initial commit"
git push origin main

2. Import to Vercel

  1. Go to vercel.com and click Add New Project
  2. Import your GitHub repository
  3. Vercel auto-detects Next.js -- no build configuration needed

3. Configure environment variables

In Vercel > Project Settings > Environment Variables, add:

Required

NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY
NEXT_PUBLIC_APP_URL            (your production URL, e.g., https://yourapp.com)

Stripe (if billing is enabled)

STRIPE_SECRET_KEY
STRIPE_WEBHOOK_SECRET
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
NEXT_PUBLIC_STRIPE_PRO_MONTHLY_PRICE_ID
NEXT_PUBLIC_STRIPE_PRO_YEARLY_PRICE_ID
NEXT_PUBLIC_STRIPE_ENTERPRISE_MONTHLY_PRICE_ID
NEXT_PUBLIC_STRIPE_ENTERPRISE_YEARLY_PRICE_ID

Resend (if invitations are enabled)

RESEND_API_KEY
EMAIL_FROM

4. Update Supabase Auth settings

In Supabase > Authentication > URL Configuration:

  • Site URL: https://yourapp.com
  • Redirect URLs: Add https://yourapp.com/auth/callback

5. Register the Stripe webhook

In Stripe > Developers > Webhooks:

  • Endpoint: https://yourapp.com/api/stripe/webhook
  • Events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted
  • Copy the signing secret to STRIPE_WEBHOOK_SECRET in Vercel

6. Deploy

Click Deploy in Vercel or push to main. Your app will be live in about 60 seconds.

Production checklist

Database

  • All 6 SQL migrations applied (001_schema.sql through 006_remaining_features.sql)
  • profiles table and handle_new_user trigger created
  • Test that RLS policies work correctly

Authentication

  • Supabase Site URL updated to production URL
  • Supabase Redirect URLs include production callback
  • OAuth providers configured (Google, GitHub) with production credentials
  • Email confirmation enabled

Billing

  • Stripe live keys configured (not test keys)
  • Stripe products/prices created with correct Price IDs
  • Stripe webhook registered with production endpoint
  • Webhook signing secret set in Vercel

Email

  • Resend domain verified for production sending
  • EMAIL_FROM set to your verified domain

General

  • NEXT_PUBLIC_APP_URL set to production URL
  • Brand config updated (src/config/brand.ts)
  • Logo assets replaced
  • Legal pages reviewed (terms, privacy)

Smoke test

  • Sign up with email/password
  • Sign in with OAuth (Google, GitHub)
  • Create a workspace
  • Invite a member (email delivery works)
  • Create a product
  • Subscribe to a plan (Stripe Checkout completes)
  • Check audit log entries
  • Test settings page features

Custom domain

If using a custom domain:

  1. Add the domain in Vercel > Project Settings > Domains
  2. Configure DNS records as Vercel instructs
  3. Update NEXT_PUBLIC_APP_URL to the new domain
  4. Update Supabase Auth Site URL and Redirect URLs
  5. Update the Stripe webhook endpoint URL