Deploy: Fly.io + Neon + Vercel¶
A best-of-breed split: the API on Fly.io (global containers), PostgreSQL on Neon (serverless), and the app + landing on Vercel (static, edge CDN). Pick this when you want each piece on the platform that does it best.
Outcome: API at api.yourdomain.com, app at app.yourdomain.com, landing at yourdomain.com.
1. Database — Neon¶
- Create a project at Neon and copy the connection string (use the pooled one for serverless).
- You'll set it as
FS_DB_URLon the API in the next step.
2. API — Fly.io¶
- Install flyctl, then run
fly launchinbackend/(it detects the Dockerfile — don't deploy yet). -
Set secrets (Configuration):
-
fly deploy, then run migrations against Neon:./sqitch.sh prod deploy(prod target =FS_DB_URL). - Add the domain:
fly certs add api.yourdomain.com, then point DNS at Fly.
3. App + landing — Vercel¶
Create two Vercel projects from the same repo:
- frontend — root directory
frontend/, buildnpm run build, envPUBLIC_API_BASE_URL=https://api.yourdomain.com; domainapp.yourdomain.com. - landing — root directory
landing/, buildnpm run build; domainyourdomain.com.
Vercel auto-deploys on push and provisions SSL.
4. Wire it together¶
- DNS:
api→ Fly.io;appand the apex → Vercel. - Confirm
FS_BASE_API_URL/FS_BASE_WEB_URLmatch the live URLs so CORS and cookies work (Configuration). - Stripe webhook →
https://api.yourdomain.com/webhooks/stripe(Billing & Subscriptions). - Review the Security checklist before launch.