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:
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main2. Import to Vercel
- Go to vercel.com/new
- Import your Git repository
- Vercel will detect it as a Next.js project automatically
- Click "Deploy"
3. Configure Environment Variables
In your Vercel project settings (Settings > Environment Variables), add all variables from your .env file. At minimum:
# 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
- In Vercel, go to Settings > Domains
- Add your domain
- Update DNS records as instructed by Vercel
- Update
NEXT_PUBLIC_WEBSITE_URLandNEXTAUTH_URLto 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:
npx prisma generate && npm run buildOr set it in package.json:
{
"scripts": {
"vercel-build": "npx prisma generate && next build"
}
}Webhook URLs
After deployment, set up your webhook endpoint in your payment provider dashboard:
Stripe:
https://yourdomain.com/api/payment/webhook/stripeDodo Payments:
https://yourdomain.com/api/payment/webhook/dodoPolar:
https://yourdomain.com/api/payment/webhook/polarMake 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:
https://yourdomain.com/api/auth/callback/googleDo 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_URLpoints to your production domain -
NEXTAUTH_URLpoints to your production domain -
AUTH_SECRETis 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/0for 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.tsmatch real products in provider dashboard - Tested a real checkout flow end to end
- 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.NAMEinsrc/constants/website.tsis your app name -
WEBSITE.SUPPORT_EMAILis 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 (
OPENfor public,WAITLIST_WITH_INVITESfor 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:
ENABLE_LOGGING=trueLog levels: debug, info, warn, error. Set minimum level with:
LOG_LEVEL=infoOther 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 buildandnext start - AWS Amplify - AWS-managed hosting
For self-hosting, run:
npm run build
npm run startThe 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:
- Go to Vercel Dashboard > Your Project > Deployments
- Click "Redeploy" on the latest deployment
If you change environment variables, you need to redeploy for them to take effect.
