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 committed
git 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 CLI
npm i -g vercel
vercel login
vercel
# 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 Configuration
NEXT_PUBLIC_SUPABASE_URL=your_production_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_production_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_production_service_role_key
# Stripe Configuration
STRIPE_SECRET_KEY=your_production_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_production_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=your_production_stripe_webhook_secret
# Email Configuration
RESEND_API_KEY=your_production_resend_api_key
EMAIL_FROM=notifications@yourdomain.com
# Application URLs
NEXT_PUBLIC_APP_URL=https://your-domain.com
NEXT_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 DNS
your-domain.com IN A 76.76.21.21
# Option 2: Using nameservers
ns1.vercel-dns.com
ns2.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

Next Steps