Skip to Content
OperationsProduction deploy

Production deploy

Checklist for shipping apps/web (and optional api-console) against a hosted Supabase project (e.g. Vercel + Supabase Cloud).

Local pre-release (npm run pre-release:web) validates against a local stack. Run npm run production:check before or after pointing production env vars at your hosted project.

AI-specific hardening (generation webhooks, fal.ai, credits cron): Production hardening.


1. Supabase project

  1. Create a project at supabase.com  (or use an existing one).

  2. Link CLI and push schema:

    supabase link --project-ref <ref> npm run db:push
  3. Apply seed data if you want the default demo org:

    supabase db execute --file supabase/seed.sql

    Or create your first workspace via sign-up in the app.

  4. Note Project URL and anon (publishable) key from Dashboard → Settings → API.


2. Edge Functions

Billing (SaaS core)

supabase secrets set STRIPE_SECRET_KEY=sk_... STRIPE_WEBHOOK_SECRET=whsec_... STRIPE_PRICE_TEAM=price_... supabase functions deploy billing-create-checkout supabase functions deploy billing-create-portal supabase functions deploy billing-cancel-subscription supabase functions deploy billing-update-subscription supabase functions deploy billing-list-invoices supabase functions deploy stripe-webhook

Stripe webhook URL: https://<project-ref>.supabase.co/functions/v1/stripe-webhook

See Stripe local setup for event types and CI smoke.

AI (this repo)

Deploy generation and public API functions and set secrets (FAL_API_KEY, GENERATION_WEBHOOK_SECRET, CREDITS_CRON_SECRET, etc.). See Providers and Production hardening.

production:check validates billing functions from the upstream manifest; add AI function checks in your fork manifest when you automate them.


3. Auth redirect URLs

In Supabase Dashboard → AuthenticationURL configuration:

SettingExample
Site URLhttps://your-app.vercel.app
Redirect URLshttps://your-app.vercel.app/**

Include: /auth/callback, /auth/reset-password, /auth/confirm-email.


4. Frontend (Vercel or static host)

  1. Build with production Supabase settings — npm run build:web:vercel writes settings from env.

  2. Set on the host:

    VariablePurpose
    SUPABASE_URLHosted project URL
    SUPABASE_ANON_KEYPublishable anon key
  3. SPA fallback to index.html for client routes.

API console is a separate deployable — see API console README .


5. Pre-flight: production:check

Copy .env.example.env with hosted values:

SUPABASE_URL=https://<ref>.supabase.co SUPABASE_ANON_KEY=eyJ... APP_URL=https://your-app.vercel.app # optional — redirect checklist SEED_ORG_SLUG=demo SEED_ADMIN_EMAIL=... # optional — login smoke SEED_ADMIN_PASSWORD=...
npm run production:check
CheckFails when
SUPABASE_URL / SUPABASE_ANON_KEYMissing
Auth healthProject unreachable
Anon keyRejected by REST
Project refURL ref ≠ JWT ref
Schema tablesMigrations missing
Billing Edge FunctionsHTTP 404
Seed orgWarns if slug missing
Seed admin loginFails when credentials set but login fails
Auth redirectsWarns when APP_URL set

Manifest: scripts/production-check.manifest.json. Exit 0 = no failures (warnings OK).


6. Post-deploy smoke

  1. Open APP_URL — sign in or register.
  2. Settings → Billing (mock or Stripe).
  3. Boards → Generate (if AI functions deployed).
  4. Optional: npm run monitor:prod or npm run e2e:web:release against staging.

Troubleshooting

SymptomLikely cause
Login redirects to localhostSite URL / redirect URLs still local
Billing 404Billing Edge Functions not deployed
Generate failsAI functions or FAL_API_KEY missing
organizations missingdb:push not run on hosted DB
Anon key mismatchEnv from project A, key from project B
Last updated on