Vercel
Deploy to Vercel
Vercel is the recommended deployment platform for StartupKit. It's built by the creators of Next.js and offers the best integration.
Setup
1. Connect Repository
- Push your code to GitHub
- Go to vercel.com/new
- Import your repository
- Vercel auto-detects Next.js
2. Configure Monorepo
Set the root directory for your app:
- Root Directory:
apps/web - Framework Preset: Next.js (auto-detected)
- Build Command: Leave default
- Install Command:
pnpm install
3. Environment Variables
Add your environment variables in the Vercel dashboard:
DATABASE_URL=postgresql://...
BETTER_AUTH_SECRET=your-secret-keyAdd any additional variables for auth providers, analytics, etc.
4. Deploy
Click "Deploy" and Vercel will:
- Install dependencies
- Build the application
- Deploy to a global edge network
Custom Domain
- Go to Project Settings → Domains
- Add your custom domain
- Update DNS records as instructed
Environment Tips
Different Values Per Environment
Use different values for Preview vs Production:
- Preview deployments can use a staging database
- Production uses your production database
Sensitive Variables
Store secrets in Vercel, never in code:
BETTER_AUTH_SECRETDATABASE_URL- OAuth client secrets
Automatic Deployments
Vercel automatically deploys:
- Production: On push to
main - Preview: On pull requests
Vercel Analytics
Enable built-in analytics in Project Settings → Analytics for:
- Web Vitals monitoring
- Page view tracking
- Performance insights
Troubleshooting
Build Failures
Check the build logs. Common issues:
- Missing environment variables
- TypeScript errors
- ESLint errors (run
pnpm lintlocally first)
Monorepo Issues
Ensure the root directory is set correctly:
- Should be
apps/web, not the repo root - Turbo caching may need adjustment
Next Steps
- Vercel Docs — Full documentation
- Environment Variables — Complete variable reference