Deployment

Deploy your SaaS app to production with Vercel in minutes.

shipsaas is optimized for Vercel deployment with automatic HTTPS, global CDN, and instant rollbacks.

Deploying to Vercel

Option 1: Deploy via Git (Recommended)

  1. Push code to GitHub/GitLab/Bitbucket
    git init
    git add .
    git commit -m "Initial commit"
    git remote add origin https://github.com/yourusername/your-repo.git
    git push -u origin main
  2. Import to Vercel
    • Go to vercel.com and sign in
    • Click Add New → Project
    • Import your Git repository
    • Vercel will auto-detect Next.js settings
  3. Configure Environment Variables

    Add all your .env.local variables in Vercel:

    • Go to Settings → Environment Variables
    • Add each variable from your .env.local
    • Update URLs to production values
  4. Deploy

    Click Deploy and wait for the build to complete (~2 minutes)

Option 2: Deploy via CLI

  1. Install Vercel CLI
    npm i -g vercel
  2. Login to Vercel
    vercel login
  3. Deploy
    vercel --prod

Environment Variables

Make sure to set these production environment variables in Vercel:

# Authentication - Auth.js v5
AUTH_SECRET=your-production-secret

# Google OAuth
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret

# Database - Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-supabase-anon-key

# Stripe (PRODUCTION KEYS!)
STRIPE_SECRET_KEY=sk_live_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...

# Email - Mailgun (Optional)
MAILGUN_API_KEY=your-mailgun-api-key

⚠️ Important: Use production/live keys for Stripe and other services. Never use test keys in production!

Custom Domain Setup

  1. In Vercel dashboard, go to Settings → Domains
  2. Enter your custom domain (e.g., yourdomain.com)
  3. Add DNS records to your domain provider:
    • Type: A, Name: @, Value: 76.76.21.21
    • Type: CNAME, Name: www, Value: cname.vercel-dns.com
  4. Wait for DNS propagation (can take up to 48 hours)
  5. Vercel will automatically provision SSL certificate

Post-Deployment Checklist

Update Stripe webhook URL to production domain
Update OAuth redirect URIs (Google, etc.) to production
Test authentication flow end-to-end
Test payment checkout and webhooks
Verify email sending works
Check all environment variables are set
Test on mobile devices
Run Lighthouse audit for performance
Set up error monitoring (optional: Sentry)
Configure analytics (optional: Google Analytics)

Continuous Deployment

With Vercel's Git integration, deployment is automatic:

  • Push to main branch → Automatic production deployment
  • Push to other branches → Preview deployments with unique URLs
  • Pull requests → Automatic preview deployments for testing

Troubleshooting

Build Failures

  • Check build logs in Vercel dashboard
  • Run npm run build locally to reproduce
  • Ensure all environment variables are set

Authentication Issues

  • Verify AUTH_SECRET is set and is a strong random string
  • Update OAuth redirect URIs to production URLs
  • Check AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET are correct

Webhook Not Working

  • Update webhook URL in Stripe dashboard to production domain
  • Get new webhook signing secret for production endpoint
  • Check Vercel function logs for errors

🎉 Congratulations! Your SaaS app is now live and ready to accept users and payments!