Deployment Guide¶
Deploy your boilerplate to production.
Quick Start¶
| Bash | |
|---|---|
Deployment Options¶
Railway (Recommended)¶
Single Docker deployment - simplest option.
Pros:
- One-click deployment
- Automatic HTTPS
- Built-in PostgreSQL
- Git push to deploy
- $5/month starter
Setup:
- Create Railway account
- New Project → Deploy from GitHub
- Add PostgreSQL service
- Set environment variables
- Deploy
Vercel + Railway¶
Frontend on Vercel, Backend on Railway - scalable option.
Pros:
- Vercel CDN for frontend
- Railway for backend/database
- Best performance
- ~$10/month
Setup:
- Deploy frontend to Vercel
- Deploy backend to Railway
- Configure CORS for Vercel URL
Digital Ocean¶
App Platform - managed deployment.
Pros:
- Managed PostgreSQL
- Automatic builds
- Monitoring included
- ~$12/month
Setup:
- Create DO account
- New App → GitHub repo
- Add managed PostgreSQL
- Set environment variables
- Deploy
Docker (Self-Hosted)¶
Own VPS - full control.
Build:
Pros:
- Full control
- Cheapest option
- Any provider
Cons:
- Manual setup
- You manage everything
Environment Variables¶
Required (All Deployments)¶
Top G+ (Payment Features)¶
| Text Only | |
|---|---|
| |
Optional¶
| Text Only | |
|---|---|
Database Setup¶
Apply Migrations¶
From local machine:
| Bash | |
|---|---|
In deployment platform:
| Bash | |
|---|---|
Create Superuser (Top G+)¶
Stripe Webhook Setup (Top G+)¶
Production Webhook¶
- Go to Stripe Dashboard
- Add endpoint:
https://yourdomain.com/api/payments/webhook - Select events:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed- Copy webhook secret to environment variables
SSL/HTTPS¶
All platforms provide automatic HTTPS:
- Railway: Automatic
- Vercel: Automatic
- Digital Ocean: Automatic
Custom domain: Configure DNS to point to platform.
Monitoring¶
Health Check:
Logs:
- Railway: Dashboard → Logs
- Vercel: Dashboard → Functions → Logs
- Digital Ocean: Dashboard → Runtime Logs
Scaling¶
Railway: Automatic scaling
Vercel: Automatic scaling (frontend)
Digital Ocean: Manual scaling (resize droplet)
Security Checklist¶
- Use HTTPS (automatic on platforms)
- Strong
secret_key(32+ characters) - Live Stripe keys (not test)
- Secure database password
- Environment variables (not hardcoded)
- CORS configured for production domain
- Webhook secrets verified
Cost Estimates¶
Hobby/Starter:
- Railway: $5-10/month
- Vercel Free + Railway DB: $5/month
- Digital Ocean: $12/month
Production:
- Railway Pro: $20+/month
- Vercel Pro + Railway: $20+/month
- Digital Ocean: $24+/month
Related Documentation¶
- Configuration - Environment variables
- Database - Database migrations
- Stripe Payments - Webhook setup (Top G+)
- Railway Docs
- Vercel Docs
- Digital Ocean Docs