Deployment
Deploy Videa to production.
Prerequisites
Before deploying, ensure you have:
- PostgreSQL database (Supabase, Neon, or Vercel Postgres)
- Volcano Engine API key
- Creem account and API key
- Resend API key
- (Optional) Google OAuth credentials
- (Optional) S3-compatible storage
Deploy to Vercel
1. Push to GitHub
git push origin main2. Import in Vercel
- Go to vercel.com
- Import your GitHub repository
- Set all environment variables (see Environment Variables)
- Deploy
3. Database Migration
After first deploy:
pnpm db:push4. Configure Webhook
In Creem Dashboard, set webhook URL:
https://your-domain.com/api/payments/creem/webhook5. Set Up Cron Job
For annual subscription credit grants, configure a cron job to call hourly:
curl -H "Authorization: Bearer YOUR_CRON_SECRET" \
https://your-domain.com/api/cron/subscription-grantsOn Vercel, add to vercel.json:
{
"crons": [{
"path": "/api/cron/subscription-grants",
"schedule": "0 * * * *"
}]
}6. Create Admin Account
ADMIN_EMAIL=admin@example.com pnpm admin:setup7. Verify Environment
Make sure production .env has correct values for:
BETTER_AUTH_URL— Your actual domainNEXT_PUBLIC_APP_URL— Your actual domainRESEND_FROM_EMAIL— Verified domain sender
Post-Deploy Checklist
- Database migrated
- Webhook URL configured in Creem
- Cron job set up for credit grants
- Admin account created
- Email sender domain verified in Resend
- OAuth redirect URIs updated for production domain
- Analytics keys configured (PostHog, GA, Clarity)