Deploy to Vercel
Prerequisites
- Vercel account
- PostgreSQL database (Vercel Postgres, Neon, Supabase, etc.)
Steps
1. Push to GitHub
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/you/my-saas.git
git push -u origin main2. Import to Vercel
- Go to vercel.com/new
- Import your repository
- Vercel auto-detects the Next.js framework
3. Set environment variables
Add all variables from .env.example in the Vercel dashboard → Settings → Environment Variables.
Key variables:
DATABASE_URLBETTER_AUTH_SECRETBETTER_AUTH_URL(your production domain)STRIPE_SECRET_KEY(and other billing vars)RESEND_API_KEY
4. Deploy
Vercel deploys automatically on every push to main.
# Manual deploy
npx vercel --prodDatabase setup
Run migrations against your production database:
DATABASE_URL=your-prod-url pnpm db:push