Deployment
Deploy to Vercel (recommended) or Railway. Covers repo connection, env vars, build settings, domains, and post-deploy verification.
️ Vercel (Recommended)
1. Connect
- Push to GitHub / GitLab / Bitbucket
- vercel.com → Import → Select repo
- Framework: Next.js (auto-detected)
2. Environment Variables
Add all from .env.example to Vercel → Settings → Environment Variables.
Required
| Variable | Source |
|---|---|
NEXT_PUBLIC_APP_URL | Your production domain |
NEXT_PUBLIC_SUPABASE_URL | Supabase → Settings → API |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY | Supabase → Settings → API |
SUPABASE_SECRET_KEY | Supabase → Settings → API |
DATABASE_URL | Supabase → Database → Pooler (port 6543) |
NEXT_AUTH_SECRET | openssl rand -base64 32 (Required for Production) |
CSRF_SECRET | openssl rand -base64 32 (Required for Production) |
PAYMENT_PROVIDER | stripe / polar / lemon-squeezy / dodo / creem |
| Payment provider keys | Provider dashboard |
EMAIL_PROVIDER | sendgrid / resend / postmark / brevo |
| Email API key | Provider dashboard |
GEMINI_API_KEY | aistudio.google.com |
UPSTASH_REDIS_REST_URL + TOKEN | Upstash Redis for fail-closed edge rate limiting |
Optional (Recommended)
| Variable | Purpose |
|---|---|
ELEVENLABS_API_KEY | Voice (TTS/STT) |
SENTRY_DSN + SENTRY_AUTH_TOKEN | Error monitoring |
NEXT_EXTERNAL_ANALYTICS_PROVIDER | Analytics |
NEXT_PUBLIC_DATAFAST_DOMAIN | DataFast analytics |
NEXT_PUBLIC_SENTRY_REPLAY_ENABLED | Sentry Session Replay opt-in |
NEXT_PUBLIC_USE_MOCK_DATA | Demo dashboard data; keep false for production |
TRUST_PROXY_HEADERS | Optional. Set true only when your ingress strips untrusted forwarding headers before requests reach Next.js. Vercel deployments do not need it. |
Production health checks report Redis as unhealthy when Upstash credentials are missing. Do not launch public support, voice, checkout, or authenticated routes without a working Redis limiter.
3. Build Settings
| Setting | Value |
|---|---|
| Framework | Next.js |
| Build | npm run build |
| Output | .next |
| Install | npm install |
| Node | 20.x |
4. Deploy
git push origin mainAuto-deploys on push. PR previews automatic.
5. Custom Domain
- Vercel → Settings → Domains → Add
- CNAME:
cname.vercel-dns.com - Update
NEXT_PUBLIC_APP_URL
Railway (Alternative)
1. Create
railway.app → New Project → Deploy from GitHub.
2. Config
Same env vars as above.
| Setting | Value |
|---|---|
| Build | npm run build |
| Start | npm start |
| Port | 3000 |
Supabase Production Checklist
| Step | Action |
|---|---|
| RLS | Run supabase/schema.sql in SQL Editor |
| Billing indexes | Apply the latest migration so provider subscription/payment unique indexes exist before enabling paid traffic |
| Auth providers | Enable OAuth in Auth → Providers |
| Redirect URLs | Add https://yourdomain.com/auth/callback |
| Email templates | Customize confirmation, reset, invite |
| pgvector | Enable in Database → Extensions (for RAG) |
| Pooler | Use pooled connection (port 6543, transaction mode) |
Post-Deploy Verification
| Check | Action |
|---|---|
| Homepage | Visit production URL |
| Auth | Signup → verify → login → dashboard |
| Dashboard | Navigate /dashboard |
| Payments | Test checkout (provider test mode) |
| Redirects | Confirm checkout and portal returns stay on your configured domain |
| Billing idempotency | Replay duplicate sandbox webhooks and confirm duplicate provider subscription/payment IDs do not create duplicate rows |
| Account deletion | Force provider cancellation failure in test mode and confirm local profile/auth/storage deletion stops |
| Proxy identity | Confirm spoofed x-forwarded-for does not bypass rate limits unless a trusted ingress overwrites it |
| Voice security | Exercise Murf TTS and confirm invalid/private audioFile URLs are rejected server-side |
| AI chat | Send test message |
| Webhooks | Configure URLs in provider dashboard |
| Contact form → verify delivery | |
| Health | Visit /system for dependency detail; confirm GET /api/health returns only public liveness metadata |
Webhook URLs
Stripe: https://yourdomain.com/api/webhooks/stripe
Polar: https://yourdomain.com/api/webhooks/polar
Lemon Squeezy: https://yourdomain.com/api/webhooks/lemon-squeezy
Dodo: https://yourdomain.com/api/webhooks/dodo
Creem: https://yourdomain.com/api/webhooks/creemCopyright © 2026 Vibe44. Built with ❤️ by Scale with Alap.