Deployment Guide
Deploy your application to production using Vercel.
Prerequisites
Version Control
Ensure your code is pushed to a Git repository (GitHub, GitLab, or Bitbucket).
Vercel Account
Create an account at vercel.com if you haven't already.
Environment Variables
Have your production environment variables ready (API keys, database URLs, etc.).
Deployment Steps
1. Push to Git
Push your latest changes to your Git repository:
# Ensure all changes are committedgit add .git commit -m "Ready for deployment"git push origin main
2. Deploy with Vercel
Deploy using the Vercel CLI or through the Vercel dashboard:
# Using Vercel CLInpm i -g vercelvercel loginvercel# Or deploy from dashboard:# 1. Go to vercel.com/new# 2. Import your Git repository# 3. Configure project settings# 4. Deploy
3. Environment Variables
Set up your production environment variables in Vercel:
# Supabase ConfigurationNEXT_PUBLIC_SUPABASE_URL=your_production_supabase_urlNEXT_PUBLIC_SUPABASE_ANON_KEY=your_production_supabase_anon_keySUPABASE_SERVICE_ROLE_KEY=your_production_service_role_key# Stripe ConfigurationSTRIPE_SECRET_KEY=your_production_stripe_secret_keyNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_production_stripe_publishable_keySTRIPE_WEBHOOK_SECRET=your_production_stripe_webhook_secret# Email ConfigurationRESEND_API_KEY=your_production_resend_api_keyEMAIL_FROM=notifications@yourdomain.com# Application URLsNEXT_PUBLIC_APP_URL=https://your-domain.comNEXT_PUBLIC_SITE_URL=https://your-domain.com
Make sure to use production credentials and never expose these values in your code or version control.
Production Checklist
Database
- Ensure database migrations are applied
- Verify RLS policies are configured correctly
- Set up database backups
Authentication
- Configure OAuth providers in production
- Update allowed redirect URLs
- Test authentication flow
Payments
- Switch to live Stripe keys
- Configure Stripe webhooks for production
- Test payment flow end-to-end
Custom Domains
Configure your custom domain in Vercel:
# 1. Go to your project settings in Vercel# 2. Navigate to Domains# 3. Add your domain# 4. Configure DNS settings:# Option 1: Using Vercel DNSyour-domain.com IN A 76.76.21.21# Option 2: Using nameserversns1.vercel-dns.comns2.vercel-dns.com
Post-Deployment
Testing
- Test all critical user flows
- Verify API endpoints
- Check email notifications
- Test subscription management
Monitoring
- Set up error tracking (e.g., Sentry)
- Configure performance monitoring
- Set up uptime monitoring