Vercel Deployment

Deploy your TurboStack frontend to Vercel with one click.

One-Click Deploy

Deploy with Vercel

Manual Deployment

  1. Go to Vercel Dashboard
  2. Import your GitHub repository
  3. Configure project settings:
    • Root Directory: apps/frontend
  4. Configure build settings:
    • Build Command: cd ../.. && bun install && bun run build --filter=frontend
    • Output Directory: .next
  5. Add environment variables
  6. Deploy

Environment Variables

Configure these environment variables in your Vercel project settings:

Required Variables

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
JWT_SECRETSecret key for JWT tokens (min 32 chars)your-super-secret-jwt-key...
SESSION_SECRETSecret key for session encryptionyour-session-secret-key...
NEXT_PUBLIC_API_URLYour deployed API URLhttps://api.yourdomain.com
Never commit secrets to your repository. Always use Vercel’s environment variable settings.

Monorepo Configuration

TurboStack includes a vercel.json in apps/frontend/ for optimal Vercel deployment:
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "framework": "nextjs",
  "installCommand": "cd ../.. && bun install",
  "buildCommand": "cd ../.. && bun run build --filter=frontend",
  "outputDirectory": ".next"
}

Backend Deployment

Vercel Serverless Functions don’t support Bun runtime. Deploy the Elysia.js API to:

Railway

# Install Railway CLI
npm install -g @railway/cli

# Login to Railway
railway login

# Initialize project
railway init

# Deploy
railway up

Render

  1. Create a new Web Service on Render
  2. Connect your GitHub repository
  3. Configure:
    • Root Directory: apps/backend
    • Build Command: cd ../.. && bun install && bun run build --filter=backend
    • Start Command: bun run start

Troubleshooting

Build fails with ‘bun not found’

Make sure your package.json has the packageManager field:
{
  "packageManager": "bun@1.1.45"
}

Packages not found during build

Ensure you’re using the correct build command that navigates to the monorepo root:
cd ../.. && bun run build --filter=frontend

Environment variables not working

  • Check that variables are set for the correct environment (Production/Preview/Development)
  • Restart the deployment after adding new variables
  • For client-side variables, use the NEXT_PUBLIC_ prefix