Deployment
Backend Deployment (Render)
- Connect Repository to Render
- Create Web Service:
- Build Command:
cd backend && go mod download && go build -o ../bin/api ./cmd/api - Start Command:
./bin/api - Environment: Go
- Build Command:
- Set Environment Variables (see Environment Variables)
- Database: Use Render PostgreSQL or external (link via
DATABASE_URL)
Required Environment Variables for Render
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL | Yes | From "Link Database" or Internal URL. Render PostgreSQL URLs typically include SSL; if the server logs a sslmode warning, add ?sslmode=require to the URL. |
JWT_SECRET | Yes | Must be 32+ characters (e.g. openssl rand -base64 32) |
PORT | Yes | Set to 10000 (Render default) |
ALLOWED_ORIGINS | Yes (production) | Comma-separated frontend URLs (e.g. your Vercel URL); no default * in production |
Optional Environment Variables for Render
ENVIRONMENT— Set toproductionon Render (disables test mode; required for cookie auth from Vercel)ALLOWED_ADMIN_IPS— Comma-separated IPs allowed to access/admin/*(e.g. office or VPN IP). Leave unset to allow all IPs.RAZORPAY_KEY_ID,RAZORPAY_KEY_SECRET,RAZORPAY_WEBHOOK_SECRET— Payment and webhooksRESEND_API_KEYor SMTP vars — EmailFRONTEND_URL— For password-reset emailsAWS_S3_BUCKET,AWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY— File storage (recommended for production)
Quick checklist
See repo root RENDER_PUBLISH_NEXT_STEPS.md for a step-by-step Render publish checklist and RENDER_DEPLOYMENT.md for full instructions.
Frontend Deployment (Vercel)
- Connect Repository to Vercel
- Set Build Settings:
- Framework: Next.js
- Root Directory:
frontend
- Set Environment Variables:
NEXT_PUBLIC_API_URL: Your backend URL
Build Configuration
Vercel automatically detects Next.js and builds accordingly. The frontend is configured for static export (output: 'export' in next.config.js), which generates static HTML files for optimal performance.
Admin Frontend Deployment
Same as frontend, but:
- Root Directory:
admin_frontend - Port: 3001 (if using custom server)
Mobile Apps Deployment
Android
flutter build apk --release
# Upload to Google Play Console
iOS
flutter build ios --release
# Upload via Xcode or App Store Connect
Production Checklist
- All environment variables set (JWT_SECRET 32+ chars, ALLOWED_ORIGINS = your Vercel/frontend URLs)
-
ENVIRONMENT=productionset on backend (noTEST_MODE=true); required for cookie auth from Vercel - DATABASE_URL uses SSL (Render PostgreSQL URL usually has it; add
?sslmode=requireif the server logs a warning) - (Optional) ALLOWED_ADMIN_IPS set to your office/VPN IP(s) to restrict admin panel by IP
- Database backups configured
- HTTPS enabled (Render provides HTTPS; backend uses HTTP behind proxy)
- CORS configured (ALLOWED_ORIGINS required in production)
- Rate limiting enabled (auth endpoints)
- Security headers set (HSTS, X-Content-Type-Options, etc.)
- File storage configured (S3 recommended)
- Email service configured
- Payment gateway configured (live keys)
- Error logging / monitoring configured
- CDN configured (if applicable)
Post-Deployment
- Test all critical flows
- Monitor logs for errors
- Set up alerts
- Configure backups
- Document deployment process