Vercel, Supabase, Stripe webhooks, and the PWA
Deployment
Surflink deploys as a standard Next.js app on Vercel, backed by Supabase and Stripe. Every push to main deploys; CI (lint, tests, handbook check, audit, build) runs alongside the deploy, not in front of it — so run the tests locally before you push.
Vercel
| Setting | Value |
|---|---|
| Build command | next build (the prebuild hook regenerates the migration manifest) |
| Install | npm ci |
| Node | 24 (.nvmrc, engines) |
| Region | pdx1 |
Set every environment variable from Environment Variables. Cron jobs come from vercel.json; set CRON_SECRET so Vercel can authorize them. Sentry source maps upload at build time when the Sentry variables are present.
Supabase
- Create the project and apply the migrations in order (
supabase db push). - Create the analysis buckets by hand:
raw-uploads,session-videos,session-data. - Copy the project URL, anon key and service-role key into the environment.
- Row-level security enforces org-based isolation; privileged mutations are additionally authorized in route handlers.
Stripe
Add STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET and the four price ids, and point a webhook at POST /api/stripe/webhook (the route is public and billing-bypassed in the middleware).
PWA
public/manifest.json (standalone display) and public/sw.js (split static / runtime caches, stale-while-revalidate, network-first navigation, push handling), registered from the root layout.
After a deploy
Check /api/health, then the feature you changed. The admin console's System page shows service health, integrations and the scheduled jobs.