Launch

Deployment

Deploy MoveFast to Vercel with proper environment variables, webhook URLs, and production security settings.

MoveFast is optimized for Vercel deployment. This guide covers everything you need to go from local development to production.

Deploy to Vercel

1. Push to GitHub

Make sure your code is in a Git repository:

bash
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main

2. Import to Vercel

  1. Go to vercel.com/new
  2. Import your Git repository
  3. Vercel will detect it as a Next.js project automatically
  4. Click "Deploy"

3. Configure Environment Variables

In your Vercel project settings (Settings > Environment Variables), add all variables from your .env file. At minimum:

env
# App
NEXT_PUBLIC_WEBSITE_URL=https://yourdomain.com
NEXTAUTH_URL=https://yourdomain.com
AUTH_SECRET=your-production-secret
AUTH_TRUST_HOST=true
 
# Database (pick one based on your variant)
MONGODB_URI=mongodb+srv://...
# or
DATABASE_URL=postgresql://...
 
# Email (pick one based on your variant)
RESEND_API_KEY=re_...
# or
POSTMARK_API_KEY=...
# or
SMTP_HOST=...
SMTP_USERNAME=...
SMTP_PASSWORD=...
 
EMAIL_FROM_EMAIL=noreply@yourdomain.com
EMAIL_FROM_NAME=YourApp
 
# Payment (pick one based on your variant)
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
# or
DODO_API_KEY=...
DODO_WEBHOOK_SECRET=...
DODO_ENVIRONMENT=live_mode
# or
POLAR_ACCESS_TOKEN=polar_at_...
POLAR_WEBHOOK_SECRET=...
POLAR_ENVIRONMENT=production
 
# OAuth
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

4. Custom Domain

  1. In Vercel, go to Settings > Domains
  2. Add your domain
  3. Update DNS records as instructed by Vercel
  4. Update NEXT_PUBLIC_WEBSITE_URL and NEXTAUTH_URL to use the new domain

Supabase Variants: Extra Build Step

If you are using a Supabase/PostgreSQL variant, Prisma needs to generate the client before building. Add this to your Vercel build command:

text
npx prisma generate && npm run build

Or set it in package.json:

json
{
  "scripts": {
    "vercel-build": "npx prisma generate && next build"
  }
}

Webhook URLs

After deployment, set up your webhook endpoint in your payment provider dashboard:

Stripe:

text
https://yourdomain.com/api/payment/webhook/stripe

Dodo Payments:

text
https://yourdomain.com/api/payment/webhook/dodo

Polar:

text
https://yourdomain.com/api/payment/webhook/polar

Make sure the webhook secret in your env matches the one generated by your provider.


Google OAuth Redirect

Add your production domain to Google OAuth redirect URIs:

text
https://yourdomain.com/api/auth/callback/google

Do this in Google Cloud Console > APIs & Services > Credentials > Your OAuth Client.


Production Checklist

Run through this before going live:

URLs and Auth

  • NEXT_PUBLIC_WEBSITE_URL points to your production domain
  • NEXTAUTH_URL points to your production domain
  • AUTH_SECRET is a unique, randomly generated value (not reused from dev)
  • Google OAuth redirect includes production domain

Database

  • Database connection string points to production database
  • MongoDB: IP whitelist includes 0.0.0.0/0 for Vercel (serverless IPs)
  • Supabase: Using pooled connection string for serverless

Payments

  • Using live/production API keys (not test keys)
  • Webhook endpoint is registered in provider dashboard
  • Webhook secret matches what is in Vercel env vars
  • Product IDs in pricing.config.ts match real products in provider dashboard
  • Tested a real checkout flow end to end

Email

  • Using a verified sending domain (not a free email address)
  • Email templates have correct branding
  • Magic link emails are being delivered (check spam folders)

Branding

  • WEBSITE.NAME in src/constants/website.ts is your app name
  • WEBSITE.SUPPORT_EMAIL is a real support address
  • OG image (public/og-image.png) has your branding
  • Legal pages have your actual terms, privacy policy, etc.

Platform Mode

  • Access mode is set correctly (OPEN for public, WAITLIST_WITH_INVITES for pre-launch)
  • Admin user is created in the production database

Environment Variable Separation

Vercel lets you set different env variables for different environments:

  • Production - Your live site
  • Preview - Deploy previews from pull requests
  • Development - Used with vercel dev

Recommendation:

  • Use production payment keys only in Production
  • Use test/sandbox keys in Preview and Development
  • Use a separate database for Preview to avoid polluting production data

Monitoring and Logs

Vercel Logs

View runtime logs in Vercel Dashboard > Your Project > Logs. This shows:

  • API route execution
  • Server-side rendering
  • Errors and warnings

Built-in Logger

MoveFast has a logger (src/lib/logger.ts) that outputs structured logs. Enable it in production:

env
ENABLE_LOGGING=true

Log levels: debug, info, warn, error. Set minimum level with:

env
LOG_LEVEL=info

Other Hosting Providers

While optimized for Vercel, MoveFast works on any platform that supports Next.js:

  • Netlify - Similar to Vercel, supports Next.js
  • Railway - Good for full-stack apps with databases
  • Render - Supports Node.js with static builds
  • Docker - Self-host with next build and next start
  • AWS Amplify - AWS-managed hosting

For self-hosting, run:

bash
npm run build
npm run start

The app starts on port 3000 by default. Use the PORT environment variable to change it.


Redeployment

Every time you push to your main branch, Vercel automatically rebuilds and deploys. For manual redeployments:

  1. Go to Vercel Dashboard > Your Project > Deployments
  2. Click "Redeploy" on the latest deployment

If you change environment variables, you need to redeploy for them to take effect.