Vercel Deployment
Deploy SmartFall to Vercel with zero configuration.
Prerequisites
- GitHub account and repository
- Vercel account (free or pro)
- PostgreSQL database (or Convex)
Deployment Steps
1. Connect Repository
- Go to https://vercel.com
- Click "New Project"
- Select your GitHub repository
- Authorize Vercel
2. Configure Environment Variables
In Vercel dashboard:
- Go to Settings → Environment Variables
- Add each variable:
NODE_ENV=production
DATABASE_PROVIDER=prisma
DATABASE_URL=postgresql://...
JWT_SECRET=<strong_secret>
ALLOWED_ORIGINS=https://your-domain.com
3. Deploy
Click "Deploy" button or:
vercel deploy
4. Verify Deployment
curl https://your-project.vercel.app/api/health
Custom Domain
- Go to Vercel dashboard
- Settings → Domains
- Add your domain
- Update DNS records as directed
Database Hosting Options
Option 1: PostgreSQL (External)
Use Supabase, Railway, or similar:
DATABASE_URL=postgresql://user:pass@db.example.com:5432/smartfall
Option 2: Convex (Recommended for Vercel)
Serverless-first approach:
DATABASE_PROVIDER=convex
CONVEX_DEPLOYMENT=prod:deployment-id
Automatic Deployments
Vercel automatically deploys when:
- Push to main branch
- Create pull request (preview)
- Redeploy from dashboard
Monitoring
In Vercel dashboard:
- Analytics: Usage and performance metrics
- Logs: Deployment and runtime logs
- Deployments: History and rollback
Troubleshooting
Build Fails
Check build logs in Vercel dashboard.
Common issues:
- Missing environment variables
- TypeScript errors
- Missing dependencies
Database Connection Fails
Verify:
- DATABASE_URL is correct
- Database is accessible from Vercel
- Firewall allows Vercel IPs
Function Timeout
Increase timeout in vercel.json:
{
"functions": {
"api/**/*.ts": {
"maxDuration": 60
}
}
}