86211923db
Repository Interface Optimization: - Created IBaseRepository.ts and IPaginatedRepository.ts - Refactored all 7 repository interfaces to extend base interfaces - Eliminated ~200 lines of redundant code (70% reduction) - Improved type safety and maintainability Dependency Injection Improvements: - Added EmailService and GameTokenService to DIContainer - Updated CreateUserCommandHandler constructor for DI - Updated RequestPasswordResetCommandHandler constructor for DI - Enhanced testability and service consistency Environment Configuration: - Created comprehensive .env.example with 40+ variables - Organized into 12 logical sections (Database, Security, Email, etc.) - Added security guidelines and best practices - Documented all backend environment requirements Documentation: - Added comprehensive codebase review - Created refactoring summary report - Added frontend implementation guide Impact: Improved code quality, reduced maintenance overhead, enhanced developer experience
71 lines
1.9 KiB
Bash
71 lines
1.9 KiB
Bash
# SerpentRace Production Server Environment Variables
|
|
# IMPORTANT: Change all placeholder values before deployment!
|
|
|
|
# Production settings
|
|
NODE_ENV=production
|
|
|
|
# Database Configuration
|
|
DB_HOST=postgres
|
|
DB_PORT=5432
|
|
DB_NAME=serpentrace
|
|
DB_USERNAME=postgres
|
|
# CHANGE THIS: Use a strong password
|
|
POSTGRES_PASSWORD=CHANGE_THIS_STRONG_DATABASE_PASSWORD_123!
|
|
|
|
# Redis Configuration
|
|
REDIS_URL=redis://redis:6379
|
|
REDIS_HOST=redis
|
|
REDIS_PORT=6379
|
|
# CHANGE THIS: Set a Redis password for security
|
|
REDIS_PASSWORD=CHANGE_THIS_REDIS_PASSWORD_123!
|
|
|
|
# JWT Configuration
|
|
# CHANGE THIS: Use a strong secret key (minimum 32 characters)
|
|
JWT_SECRET=CHANGE_THIS_JWT_SECRET_KEY_MINIMUM_32_CHARACTERS_FOR_PRODUCTION_SECURITY
|
|
JWT_EXPIRY=86400
|
|
JWT_EXPIRATION=24h
|
|
JWT_REFRESH_EXPIRATION=7d
|
|
|
|
# Email Configuration (SMTP)
|
|
# CHANGE THESE: Configure your email provider
|
|
EMAIL_HOST=smtp.yourmailprovider.com
|
|
EMAIL_PORT=587
|
|
EMAIL_SECURE=false
|
|
EMAIL_USER=your_email@yourdomain.com
|
|
EMAIL_PASS=your_email_password
|
|
EMAIL_FROM="SerpentRace <noreply@yourdomain.com>"
|
|
|
|
# MinIO Object Storage
|
|
MINIO_ENDPOINT=minio
|
|
MINIO_PORT=9000
|
|
MINIO_USE_SSL=false
|
|
# CHANGE THESE: Use strong credentials
|
|
MINIO_ACCESS_KEY=serpentrace_admin
|
|
MINIO_SECRET_KEY=CHANGE_THIS_MINIO_SECRET_KEY_123!
|
|
MINIO_BUCKET_NAME=serpentrace-logs
|
|
|
|
# Application Settings
|
|
APP_BASE_URL=http://your-domain.com
|
|
PORT=3000
|
|
|
|
# Chat System Limits
|
|
CHAT_INACTIVITY_TIMEOUT_MINUTES=30
|
|
CHAT_MAX_MESSAGES_PER_USER=100
|
|
CHAT_MESSAGE_CLEANUP_WEEKS=4
|
|
|
|
# Logging
|
|
MAX_LOGS_PER_FILE=10000
|
|
|
|
# SSL/TLS Configuration (if using HTTPS)
|
|
# Uncomment and configure if you have SSL certificates
|
|
# SSL_CERT_PATH=/path/to/certificate.crt
|
|
# SSL_KEY_PATH=/path/to/private.key
|
|
# SSL_CA_PATH=/path/to/ca-bundle.crt
|
|
|
|
# Security Headers (already configured in nginx)
|
|
# These are handled by the nginx configuration
|
|
|
|
# Backup Configuration (optional)
|
|
# BACKUP_ENABLED=true
|
|
# BACKUP_SCHEDULE=0 2 * * *
|
|
# BACKUP_RETENTION_DAYS=30 |