# ============================================================================ # BACKEND ENVIRONMENT VARIABLES - ERP Construccion # ============================================================================ # Proyecto: erp-construccion # Puerto Backend: 3021 # Puerto Frontend: 3020 # Fecha: 2026-02-03 # # SEGURIDAD: Las variables marcadas con [REQUIRED] son OBLIGATORIAS en producción. # En desarrollo, se usan valores por defecto con advertencia en consola. # ============================================================================ # Application NODE_ENV=development PORT=3021 APP_HOST=0.0.0.0 API_VERSION=v1 API_PREFIX=/api/v1 # ============================================================================ # DATABASE - PostgreSQL # ============================================================================ # [REQUIRED] DB_PASSWORD es OBLIGATORIO en producción # Credenciales oficiales según workspace-v2/CLAUDE.md: # User: erp_admin | Password: erp_dev_2026 | Port: 5432 # ============================================================================ DATABASE_URL=postgresql://erp_admin:erp_dev_2026@localhost:5432/erp_construccion_db DB_HOST=localhost DB_PORT=5432 DB_NAME=erp_construccion_db DB_USER=erp_admin DB_PASSWORD=erp_dev_2026 DB_SYNCHRONIZE=false DB_LOGGING=true # ============================================================================ # JWT - JSON Web Tokens # ============================================================================ # [REQUIRED] JWT_SECRET es OBLIGATORIO en producción # Debe tener mínimo 32 caracteres y ser único por ambiente # ============================================================================ JWT_SECRET=change-this-to-a-secure-random-string-minimum-32-chars JWT_EXPIRES_IN=1d JWT_REFRESH_EXPIRES_IN=7d # ============================================================================ # REDIS - Cache y Sesiones # ============================================================================ # DB 2 asignada para erp-suite según workspace-v2 REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=2 REDIS_URL=redis://localhost:6379/2 # ============================================================================ # CORS - Cross-Origin Resource Sharing # ============================================================================ # Múltiples orígenes separados por coma # En producción: usar solo dominios autorizados CORS_ORIGIN=http://localhost:3020,http://localhost:5173 CORS_CREDENTIALS=true # ============================================================================ # MinIO S3 - Almacenamiento de Archivos (Opcional) # ============================================================================ S3_ENDPOINT=http://localhost:9000 S3_ACCESS_KEY=minioadmin S3_SECRET_KEY=minioadmin S3_BUCKET=erp-construccion # ============================================================================ # Logging # ============================================================================ LOG_LEVEL=debug LOG_FORMAT=dev # ============================================================================ # Rate Limiting # ============================================================================ RATE_LIMIT_WINDOW_MS=900000 RATE_LIMIT_MAX_REQUESTS=100 # ============================================================================ # File Upload # ============================================================================ MAX_FILE_SIZE=10485760 UPLOAD_DIR=./uploads # ============================================================================ # Email SMTP (Opcional) # ============================================================================ SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your-email@example.com SMTP_PASSWORD=your-email-password SMTP_FROM=noreply@example.com # ============================================================================ # Security # ============================================================================ BCRYPT_ROUNDS=10 SESSION_SECRET=change-this-to-a-secure-random-string # ============================================================================ # External APIs (Opcional - Futuro) # ============================================================================ INFONAVIT_API_URL=https://api.infonavit.gob.mx INFONAVIT_API_KEY=your-api-key