Production Deployment Checklist
🎯 Quick Start (Choose One)
Vercel (Recommended - 5 minutes)
- Push code to GitHub
- Go to https://vercel.com (opens in a new tab)
- Import repository
- Add environment variables
- Deploy
- Add custom domain
AWS (30 minutes)
- Create RDS PostgreSQL database
- Launch EC2 instance (Ubuntu 22.04)
- Install Node.js and pnpm
- Clone repository
- Configure environment variables
- Build and start app
- Set up Nginx + SSL
DigitalOcean (15 minutes)
- Create PostgreSQL database
- Connect GitHub repository
- Add environment variables
- Deploy
- Add custom domain
📋 Environment Variables (Copy & Paste)
## Database (Get from Neon console)
DATABASE_URL=postgresql://user:password@host/database
## Better Auth (Generate random 32+ char string)
BETTER_AUTH_SECRET=your-random-secret-key-here
## Your production domain
BETTER_AUTH_URL=https://optare.one
PRODUCTION_URL=https://optare.one
## Email service (Get from Resend)
RESEND_API_KEY=re_your_api_key_here
## Optional: Redis for caching
REDIS_URL=redis://your-redis-url🔐 Security Checklist
- HTTPS/SSL enabled
- Environment variables in secrets manager (not in code)
- Database backups enabled
- Strong BETTER_AUTH_SECRET (32+ random characters)
- API keys rotated
- CORS configured for your domain
- Rate limiting enabled
- Monitoring set up
✅ Pre-Deployment Verification
## 1. Build locally
pnpm build
## 2. Check for errors
pnpm type-check
## 3. Commit changes
git add .
git commit -m "Production ready"
git push origin main
## 4. Verify database connection
## (Test with your production DATABASE_URL)🚀 After Deployment
1. Create Admin User
## SSH into your server or use platform's terminal
pnpm tsx create-admin.ts
## Creates:
## Email: admin@optare.one
## Password: admin1232. Access Admin Dashboard
https://optare.one/admin
Login: admin@optare.one
Password: admin1233. Create Test Product
- Go to Admin → Products
- Click "Create Product"
- Name: "Pro Plan"
- Save
4. Create Test Organization
- Go to Portal (https://optare.one/portal (opens in a new tab))
- Create organization
- Create subscription for "Pro Plan"
5. Test OAuth Integration
- Go to Portal → OAuth Clients
- Create OAuth client
- Get Client ID and Secret
- Test "Sign in with Optare" flow
📊 Recommended Setup
Database: Neon
- Why: Serverless PostgreSQL, auto-scaling, free tier
- Cost: Free tier or $15+/month
- Setup: 2 minutes
- Link: https://console.neon.tech (opens in a new tab)
Hosting: Vercel
- Why: Remix-optimized, zero-config, auto-scaling
- Cost: Free tier or $20+/month
- Setup: 5 minutes
- Link: https://vercel.com (opens in a new tab)
Email: Resend
- Why: Transactional emails, 99.9% uptime
- Cost: Free tier or $20+/month
- Setup: 5 minutes
- Link: https://resend.com (opens in a new tab)
Redis: Upstash
- Why: Serverless Redis, global replication
- Cost: Free tier or $10+/month
- Setup: 2 minutes
- Link: https://upstash.com (opens in a new tab)
Total Cost: $0-65/month (free tier) or $45-100/month (production)
🎯 Deployment Decision Tree
Do you want the easiest setup?
├─ YES → Use Vercel (5 minutes)
└─ NO → Continue
Do you want full control?
├─ YES → Use AWS (30 minutes)
└─ NO → Use DigitalOcean (15 minutes)📞 Common Issues & Fixes
"Database connection failed"
- Check DATABASE_URL is correct
- Verify database is running
- Check firewall allows connections
- Test with:
psql $DATABASE_URL
"Build failed"
- Run
pnpm buildlocally - Check for TypeScript errors
- Verify all dependencies installed
- Check Node.js version (18+)
"App won't start"
- Check environment variables set
- Check port 3000 is available
- Check logs:
pm2 logs optare - Verify BETTER_AUTH_SECRET is set
"SSL certificate error"
- Verify domain DNS points to server
- Wait for DNS propagation (5-30 min)
- Renew certificate:
certbot renew - Check certificate:
openssl s_client -connect optare.one:443
🎉 Success Indicators
✅ App loads at https://optare.one (opens in a new tab) ✅ Login page displays ✅ Can sign up new user ✅ Can log in ✅ Can access admin dashboard ✅ Can access portal ✅ Can create OAuth client ✅ OAuth flow works
📈 Next Steps
- Deploy using your chosen platform
- Create admin user with
pnpm tsx create-admin.ts - Test login/logout flows
- Create test product in admin
- Test OAuth integration
- Monitor application performance
- Set up backups and monitoring
- Document your setup
💡 Pro Tips
- Use environment variables - Never hardcode secrets
- Enable backups - Automate daily database backups
- Monitor errors - Set up Sentry or similar
- Track performance - Use New Relic or similar
- Test thoroughly - Test all flows before going live
- Have a rollback plan - Know how to revert if needed
- Document everything - Keep setup notes for team
🚀 Ready to Deploy?
Choose your platform and follow the guide in PRODUCTION_DEPLOYMENT.md
Questions? Check the troubleshooting section or review the detailed deployment guide.
Good luck! 🎯