GuidesDeployment
Vercel Deployment
Deploy to Vercel from GitHub
Vercel Deployment
Connect Repository
- Go to vercel.com/new
- Click Import Git Repository
- Select your BetterCone repository
Configure Project
Framework: Next.js
Root Directory: apps/web
Build Command: (auto-detected)
Install Command: pnpm installAdd Environment Variables
Go to Settings → Environment Variables:
NEXT_PUBLIC_SITE_URL=https://yourdomain.com
BETTER_AUTH_SECRET=your-random-32-char-secret
BETTER_AUTH_URL=https://yourdomain.com
CONVEX_DEPLOYMENT=prod:your-deployment
NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
CONVEX_DEPLOY_KEY=your-deploy-key
STRIPE_SECRET_KEY=sk_live_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
RESEND_API_KEY=re_...
BETTER_AUTH_EMAIL_FROM=noreply@yourdomain.comGenerate Auth Secret
openssl rand -base64 32Monorepo Configuration
Vercel auto-detects apps/web as the root directory from vercel.json:
{
"buildCommand": "cd ../.. && pnpm turbo run build --filter=web",
"installCommand": "pnpm install"
}Environment Scopes
- Production: Live environment
- Preview: Pull request deployments
- Development: Local development
Use different Stripe keys for Preview (test mode) and Production (live mode).
Automatic Deployments
Vercel automatically deploys:
- Main branch → Production
- Pull requests → Preview deployments
- Other branches → Preview deployments
CLI Deployment
# Install Vercel CLI
pnpm add -g vercel
# Login
vercel login
# Deploy
vercel --prodBuild Settings
{
"scripts": {
"build": "next build",
"start": "next start"
}
}Troubleshooting
Build Fails
Check build logs in Vercel dashboard. Common issues:
- Missing environment variables
- TypeScript errors
- Dependency issues
Slow Builds
Enable Turbo mode in Settings → General → Build & Development Settings.