Deployment¶
FastReact deploys as three pieces plus a database. A typical production setup maps them to three URLs:
| Piece | What it is | Typical URL |
|---|---|---|
| API | FastAPI backend (Docker container) | api.yourdomain.com |
| App | React SPA dashboard (static files) | app.yourdomain.com |
| Landing | React marketing site (static files) | yourdomain.com |
| Database | PostgreSQL | managed or self-hosted |
Anything that can run a Docker container, serve static files, and provide PostgreSQL works, so you can mix any providers you like. Below are the most common, straightforward setups. Pick one and you're live.
Common setups¶
Five complete, end-to-end guides. Pick one:
- Railway: all-in-one (API + app + landing + Postgres). The simplest, near one-click.
- DigitalOcean (App Platform): container + managed Postgres + static sites.
- Fly.io + Neon + Vercel (best-of-breed): API on Fly, Postgres on Neon, app + landing on Vercel.
- Azure: Container Apps + PostgreSQL Flexible Server + Static Web Apps (enterprise).
- Self-Hosting (Docker Compose): all three + Postgres on one VPS.
They reach the same outcome: point each provider at the right subdomain and set the URLs/CORS so the app can reach the API (Configuration).
Every setup needs¶
- Environment variables: backend
FS_*(see Configuration); the frontend and landing useVITE_*(e.g.VITE_API_BASE_URL). - A PostgreSQL database: put its connection string in
FS_DB_URL, then run migrations (./sqitch.sh <env> deploy). - The Stripe webhook: point it at
https://api.yourdomain.com/webhooks/stripe(see Billing & Subscriptions). - HTTPS: most platforms provision SSL automatically; when self-hosting, terminate TLS at your reverse proxy.
- A production pass: review the Security checklist before launch.