# ============================================================================= # .env.example - CLINICA DENTAL # ============================================================================= # Copia este archivo a .env y configura los valores # Generado por: @PERFIL_DEVENV # Referencia: orchestration/environment/ENVIRONMENT-INVENTORY.yml # ============================================================================= # ============================================================================= # APLICACION # ============================================================================= NODE_ENV=development APP_NAME=clinica-dental APP_VERSION=1.0.0 # ============================================================================= # PUERTOS - Asignados por DEVENV-PORTS-INVENTORY.yml # ============================================================================= FRONTEND_PORT=3130 BACKEND_PORT=3131 # Alias para compatibilidad PORT=3131 # ============================================================================= # BASE DE DATOS - PostgreSQL # ============================================================================= # Desarrollo: Puerto 5441 (asignado en DEVENV-PORTS-INVENTORY.yml) # Produccion: Puerto 5432 (estandar) # ============================================================================= DB_HOST=localhost DB_PORT=5441 DB_NAME=clinica_dental_dev DB_USER=dental_dev # IMPORTANTE: Generar password seguro con: openssl rand -base64 32 DB_PASSWORD=CAMBIAR_POR_PASSWORD_SEGURO # Connection string completo (calculado de las variables anteriores) DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME} # Pool de conexiones DB_POOL_SIZE=10 DB_CONNECTION_TIMEOUT=5000 # SSL (false para desarrollo, true para produccion) DB_SSL=false # ============================================================================= # BASE DE DATOS - Ambientes adicionales # ============================================================================= # Test (mismo servidor, diferente BD) # DB_NAME_TEST=clinica_dental_test # Staging (servidor externo) # DB_HOST_STAGING=staging-db.example.com # DB_NAME_STAGING=clinica_dental_staging # DB_USER_STAGING=dental_staging # Produccion (servidor externo) # DB_HOST_PROD=prod-db.example.com # DB_NAME_PROD=clinica_dental_prod # DB_USER_PROD=dental_prod # ============================================================================= # REDIS - Cache y Sesiones # ============================================================================= # Desarrollo: Puerto 6388 (asignado en DEVENV-PORTS-INVENTORY.yml) # Produccion: Puerto 6379 (estandar) # ============================================================================= REDIS_HOST=localhost REDIS_PORT=6388 REDIS_DB=0 # Password (vacio para desarrollo, requerido en produccion) REDIS_PASSWORD= # Connection string REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB} # Configuracion de cache REDIS_CACHE_TTL=3600 REDIS_MAX_MEMORY=256mb # ============================================================================= # AUTENTICACION - JWT # ============================================================================= # IMPORTANTE: Generar secreto seguro con: openssl rand -base64 64 # Minimo 32 caracteres requeridos # ============================================================================= JWT_SECRET=CAMBIAR_POR_SECRETO_SEGURO_DE_AL_MENOS_32_CARACTERES # Tiempos de expiracion JWT_EXPIRES_IN=24h JWT_REFRESH_EXPIRES_IN=7d # Algoritmo (default: HS256) JWT_ALGORITHM=HS256 # ============================================================================= # CORS - Cross-Origin Resource Sharing # ============================================================================= FRONTEND_URL=http://localhost:3130 # Multiples origenes separados por coma ALLOWED_ORIGINS=http://localhost:3130,http://localhost:3131 # Metodos permitidos CORS_METHODS=GET,POST,PUT,PATCH,DELETE,OPTIONS # Headers permitidos CORS_HEADERS=Content-Type,Authorization,X-Requested-With # ============================================================================= # LOGGING # ============================================================================= # Niveles: debug, info, warn, error LOG_LEVEL=debug # Formatos: pretty (desarrollo), json (produccion) LOG_FORMAT=pretty # Archivo de logs (opcional) # LOG_FILE=./logs/app.log # Rotacion de logs # LOG_MAX_SIZE=10m # LOG_MAX_FILES=5 # ============================================================================= # ALMACENAMIENTO DE ARCHIVOS (Radiografias y documentos) # ============================================================================= # Tipo: local, s3, minio STORAGE_TYPE=local # Path local (para desarrollo) STORAGE_PATH=./uploads # Tamano maximo de archivo (20MB en bytes - para radiografias) MAX_FILE_SIZE=20971520 # Tipos permitidos (incluye DICOM para imagenes medicas) ALLOWED_FILE_TYPES=image/jpeg,image/png,image/dicom,application/pdf,application/dicom # Directorio para radiografias XRAY_STORAGE_PATH=./uploads/radiografias # ============================================================================= # AWS S3 (para produccion) # ============================================================================= # AWS_ACCESS_KEY_ID= # AWS_SECRET_ACCESS_KEY= # AWS_REGION=us-east-1 # AWS_S3_BUCKET=clinica-dental-uploads # AWS_S3_XRAY_BUCKET=clinica-dental-radiografias # ============================================================================= # EMAIL - SMTP # ============================================================================= # MailHog para desarrollo: puerto 1025 # Servidor real para produccion # ============================================================================= SMTP_HOST=localhost SMTP_PORT=1025 SMTP_SECURE=false # Credenciales (para produccion) # SMTP_USER= # SMTP_PASSWORD= # Remitente por defecto SMTP_FROM_NAME=Clinica Dental SMTP_FROM_EMAIL=noreply@clinica-dental.local # ============================================================================= # SEGURIDAD ADICIONAL # ============================================================================= # Rate limiting RATE_LIMIT_WINDOW=900000 RATE_LIMIT_MAX=100 # Helmet (headers de seguridad) HELMET_ENABLED=true # CSRF Protection CSRF_ENABLED=false # Throttle por IP THROTTLE_TTL=60 THROTTLE_LIMIT=10 # ============================================================================= # MONITOREO Y METRICAS # ============================================================================= # Health check endpoint HEALTH_CHECK_ENABLED=true # Metricas Prometheus (opcional) # METRICS_ENABLED=false # METRICS_PORT=9090 # Sentry (opcional) # SENTRY_DSN= # ============================================================================= # CONFIGURACION ESPECIFICA DENTAL # ============================================================================= # Nomenclatura dental (FDI por defecto) DENTAL_FDI_NOTATION=true # Version del formato de odontograma ODONTOGRAM_VERSION=2.0 # Recordatorios de citas (dias antes) APPOINTMENT_REMINDER_DAYS=2 # Validez de presupuestos (dias) BUDGET_VALIDITY_DAYS=30 # Tipos de radiografias habilitados XRAY_TYPES=periapical,panoramica,oclusal,bitewing,cefalometrica # ============================================================================= # CUMPLIMIENTO NORMATIVO (NOM-024-SSA3-2012) # ============================================================================= # Habilitar auditoria (obligatorio en produccion) AUDIT_ENABLED=true # Retencion de logs de auditoria (dias) AUDIT_RETENTION_DAYS=1825 # Encriptacion de datos sensibles DATA_ENCRYPTION=false # Firma electronica de expedientes ELECTRONIC_SIGNATURE=false # ============================================================================= # DESARROLLO Y DEBUG # ============================================================================= # Habilitar debug de TypeORM # TYPEORM_LOGGING=true # Swagger UI SWAGGER_ENABLED=true SWAGGER_TITLE=Clinica Dental API SWAGGER_VERSION=1.0.0 # Hot reload HOT_RELOAD=true # ============================================================================= # PRODUCCION # ============================================================================= # Estas variables deben configurarse via secrets manager en produccion: # # - DB_PASSWORD (secreto) # - JWT_SECRET (secreto) # - REDIS_PASSWORD (secreto) # - AWS_ACCESS_KEY_ID (si usa S3) # - AWS_SECRET_ACCESS_KEY (si usa S3) # - SMTP_USER (si usa email) # - SMTP_PASSWORD (si usa email) # - SENTRY_DSN (si usa Sentry) # - ENCRYPTION_KEY (para datos sensibles) # # Diferencias de configuracion en produccion: # - NODE_ENV=production # - LOG_LEVEL=info # - LOG_FORMAT=json # - DB_PORT=5432 (estandar) # - DB_SSL=true # - REDIS_PORT=6379 (estandar) # - STORAGE_TYPE=s3 # - SWAGGER_ENABLED=false # - HOT_RELOAD=false # - AUDIT_ENABLED=true # - DATA_ENCRYPTION=true # - ELECTRONIC_SIGNATURE=true # # IMPORTANTE: Cumplimiento NOM-024-SSA3-2012 # - Logs de auditoria inmutables # - Retencion minima 5 anos # - Backups diarios # ============================================================================= # ============================================================================= # REFERENCIAS # ============================================================================= # Inventario de entorno: orchestration/environment/ENVIRONMENT-INVENTORY.yml # Inventario de puertos: orchestration/inventarios/DEVENV-PORTS-INVENTORY.yml # Perfil DevEnv: orchestration/agents/perfiles/PERFIL-DEVENV.md # Nomenclatura FDI: https://www.fdiworlddental.org/tooth-numbering-system # =============================================================================