Deployment Overview

TurboStack supports multiple deployment strategies for different use cases.

Deployment Options

Vercel + Railway

Recommended for most projects
  • Frontend on Vercel (free tier available)
  • Backend on Railway ($5/mo)
  • Database on Railway or Supabase

Docker Compose

Self-hosted solution
  • Full control over infrastructure
  • Works on any VPS (DigitalOcean, Hetzner)
  • All services in one server

Render

Alternative PaaS
  • Simple deployment from Git
  • Managed PostgreSQL included
  • Good free tier

Fly.io

Edge deployment
  • Deploy close to users globally
  • Built-in PostgreSQL
  • Pay per use

Comparison

FeatureVercel + RailwayDockerRender
Setup Complexity⭐ Easy⭐⭐⭐ Advanced⭐⭐ Medium
Cost (Starting)Free - $5/moVPS cost (~$5/mo)Free - $7/mo
ScalingAutomaticManualAutomatic
Custom Domain✅ Yes✅ Yes✅ Yes
SSL✅ AutoManual/Caddy✅ Auto
DatabaseRailway/SupabaseSelf-managedManaged

Pre-Deployment Checklist

1

Environment Variables

Ensure all required environment variables are set:
# Database
DATABASE_URL=postgresql://...

# Security (CHANGE THESE!)
JWT_SECRET=your-production-secret-min-32-chars
SESSION_SECRET=another-production-secret

# URLs
FRONTEND_URL=https://yourdomain.com
NEXT_PUBLIC_API_URL=https://api.yourdomain.com
CORS_ORIGIN=https://yourdomain.com

# Environment
NODE_ENV=production
# Email (Resend)
RESEND_API_KEY=re_xxx
FROM_EMAIL=noreply@yourdomain.com

# Payments (Polar)
POLAR_ACCESS_TOKEN=polar_at_xxx
POLAR_WEBHOOK_SECRET=polar_ws_xxx

# API Docs Protection
DOCS_USERNAME=admin
DOCS_PASSWORD=your-secure-password
2

Database Migration

Run migrations on production database:
DATABASE_URL=your-prod-url npx prisma migrate deploy
3

Build Test

Ensure the project builds successfully:
bun run build
4

Security Audit

  • ✅ Change all default secrets
  • ✅ Enable HTTPS
  • ✅ Configure CORS correctly
  • ✅ Set up rate limiting
  • ✅ Protect API documentation

Quick Deploy

One-Click Vercel

Deploy the frontend to Vercel instantly: Deploy with Vercel

Docker Compose

Deploy all services with Docker:
# Clone the repository
git clone https://github.com/musayazlik/turbostack.git
cd turbostack

# Configure environment
cp .env.example .env
# Edit .env with your production values

# Build and start
docker compose -f docker-compose.prod.yml up -d

Next Steps

Never commit secrets to Git! Always use environment variables for sensitive data. Use .env.local for local development and platform-specific secrets management for production.