Deployment
Vercel
Deploy to Vercel
Vercel Deployment
Deploy your TurboKit frontend to Vercel with one click.
One-Click Deploy
Manual Deployment
Via Vercel Dashboard (Recommended)
- Go to Vercel Dashboard
- Import your GitHub repository
- Configure project settings:
- Root Directory:
apps/web
- Root Directory:
- Configure build settings:
- Build Command:
cd ../.. && bun install && bun run build --filter=web - Output Directory:
.next
- Build Command:
- Add environment variables
- Deploy
Environment Variables
Configure these environment variables in your Vercel project settings:
Required Variables
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://user:pass@host:5432/db |
JWT_SECRET | Secret key for JWT tokens (min 32 chars) | your-super-secret-jwt-key... |
SESSION_SECRET | Secret key for session encryption | your-session-secret-key... |
NEXT_PUBLIC_API_URL | Your deployed API URL | https://api.yourdomain.com |
Warning: Never commit secrets to your repository. Always use Vercel's environment variable settings.
Monorepo Configuration
TurboKit includes a vercel.json in apps/web/ for optimal Vercel deployment:
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": "nextjs",
"installCommand": "cd ../.. && bun install",
"buildCommand": "cd ../.. && bun run build --filter=web",
"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 upRender
- Create a new Web Service on Render
- Connect your GitHub repository
- Configure:
- Root Directory:
apps/api - Build Command:
cd ../.. && bun install && bun run build --filter=api - Start Command:
bun run start
- Root Directory:
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=webEnvironment 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