Deployment
Production deployment strategies, best practices, security considerations, and environment setup guides for deploying applications to Vercel and other platforms
Deployment
This section explains deployment strategies and best practices for deploying your applications to production.
Deployment Options
Choose the deployment platform that best fits your needs:
Vercel
Deploy Next.js frontend and Node.js API to Vercel with zero configuration
Docker
Package your entire stack with Docker Compose for any cloud provider
Self-Hosted
Deploy to your own VPS or cloud instance using Docker Compose
Key Deployment Considerations
Database
Prepare your production database:
- Use a managed PostgreSQL service: Supabase, Neon, or AWS RDS
- Set
DATABASE_URLin production environment variables - Run migrations before deploying:
pnpm db:migrate
Environment Variables
Set all required environment variables in your hosting platform.
The key variables needed for deployment are:
DATABASE_URL- Production PostgreSQL connectionBETTER_AUTH_SECRET- Authentication secret (must be identical across all services; see Environment Variables Guide)GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET- OAuth credentialsRESEND_TOKEN- Email service API keyUPSTASH_REDIS_REST_URLand token - Rate limiting
For detailed setup instructions and complete variable reference, see the Environment Variables Guide.
Security
Follow these best practices for production:
- HTTPS Only - Enable TLS/SSL encryption
- CORS - Restrict
ALLOWED_ORIGINSto your domain only - Secrets - Never commit
.envfiles or API keys - Updated Dependencies - Keep all packages up to date
- Health Checks - Monitor application health regularly
Preparation Checklist
Before deploying to production:
- Database migrated successfully
- All environment variables configured
- Build completes without errors:
pnpm build - Tests pass:
pnpm test - No TypeScript errors:
pnpm check-types - Linting passes:
pnpm lint - Google OAuth credentials verified
- Email service credentials set up
- Rate limiting (Redis) configured
- CORS origins whitelisted
Deployment Guides
Need help? Check the Troubleshooting Guide or open an issue on GitHub.