Skip to main content

Deployment

Backend Deployment (Render)

  1. Connect Repository to Render
  2. Create Web Service:
    • Build Command: cd backend && go mod download && go build -o ../bin/api ./cmd/api
    • Start Command: ./bin/api
    • Environment: Go
  3. Set Environment Variables (see Environment Variables)
  4. Database: Use Render PostgreSQL or external (link via DATABASE_URL)

Required Environment Variables for Render

VariableRequiredNotes
DATABASE_URLYesFrom "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_SECRETYesMust be 32+ characters (e.g. openssl rand -base64 32)
PORTYesSet to 10000 (Render default)
ALLOWED_ORIGINSYes (production)Comma-separated frontend URLs (e.g. your Vercel URL); no default * in production

Optional Environment Variables for Render

  • ENVIRONMENT — Set to production on 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 webhooks
  • RESEND_API_KEY or SMTP vars — Email
  • FRONTEND_URL — For password-reset emails
  • AWS_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)

  1. Connect Repository to Vercel
  2. Set Build Settings:
    • Framework: Next.js
    • Root Directory: frontend
  3. 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=production set on backend (no TEST_MODE=true); required for cookie auth from Vercel
  • DATABASE_URL uses SSL (Render PostgreSQL URL usually has it; add ?sslmode=require if 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

  1. Test all critical flows
  2. Monitor logs for errors
  3. Set up alerts
  4. Configure backups
  5. Document deployment process