Deployment Overview
This guide covers deploying the Ever Works to production environments, including platform-specific instructions and best practices.
Deployment Platforms
Recommended Platforms
- Vercel - Best for Next.js (Recommended)
- Netlify - Great for static sites
- Railway - Simple full-stack deployment
- DigitalOcean App Platform - Managed containers
Self-Hosted Options
- Docker - Containerized deployment
- PM2 - Process management for Node.js
- Nginx - Reverse proxy setup
- Kubernetes - Container orchestration
Pre-Deployment Checklist
Code Preparation
- All tests passing
- TypeScript compilation successful
- ESLint checks passing
- Build process completes without errors
- Environment variables configured
Database Setup
- Production database created
- Migrations applied
- Connection string configured
- Backup strategy implemented
External Services
- OAuth applications configured
- Payment providers set up
- Email service configured
- Analytics tools integrated
- Error tracking enabled
Security
- Secrets properly configured
- HTTPS enabled
- CORS settings configured
- Rate limiting enabled
- Input validation implemented
Environment Configuration
Production Environment Variables
# Basic Configuration
NODE_ENV=production
NEXT_PUBLIC_APP_URL="https://yourdomain.com"
NEXT_PUBLIC_API_BASE_URL="https://yourdomain.com/api"
# Security
AUTH_SECRET="your-production-secret-32-chars-min"
NEXTAUTH_URL="https://yourdomain.com"
COOKIE_SECURE=true
COOKIE_SAME_SITE="strict"
# Database
DATABASE_URL="postgresql://user:pass@host:5432/dbname"
# GitHub Integration
GH_TOKEN="your-github-token"
DATA_REPOSITORY="https://github.com/your-org/awesome-data"
# OAuth Providers
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"
# Payment Processing
STRIPE_SECRET_KEY="sk_live_your_stripe_secret_key"
STRIPE_PUBLISHABLE_KEY="pk_live_your_stripe_publishable_key"
STRIPE_WEBHOOK_SECRET="whsec_your_webhook_secret"
# Monitoring
NEXT_PUBLIC_SENTRY_DSN="https://your-sentry-dsn"
NEXT_PUBLIC_POSTHOG_KEY="phc_your_posthog_key"
# Email
RESEND_API_KEY="re_your_resend_api_key"
SUPPORT_EMAIL="support@yourdomain.com"
Environment Security
- Never commit secrets to version control
- Use different secrets for each environment
- Rotate secrets regularly
- Use environment-specific OAuth apps
- Enable secret scanning in your repository
- Use secure password generators for all secrets
- Store secrets in secure environment variable management systems
- Regularly audit and review access permissions