# ==============================================
# Maternal App - Staging Environment
# ==============================================
# This is a template for staging environment
# Copy to .env and fill in real values

# -----------------
# Environment
# -----------------
NODE_ENV=staging
API_PORT=3020
API_URL=https://staging-api.maternal-app.com

# -----------------
# Database
# -----------------
DATABASE_HOST=staging-db.maternal-app.com
DATABASE_PORT=5432
DATABASE_NAME=maternal_staging
DATABASE_USER=maternal_staging_user
DATABASE_PASSWORD=${DATABASE_PASSWORD}
DATABASE_SSL=true
DATABASE_SSL_REJECT_UNAUTHORIZED=true

# -----------------
# Redis Cache
# -----------------
REDIS_HOST=staging-redis.maternal-app.com
REDIS_PORT=6379
REDIS_PASSWORD=${REDIS_PASSWORD}
REDIS_URL=redis://:${REDIS_PASSWORD}@staging-redis.maternal-app.com:6379
REDIS_TTL=3600

# -----------------
# MongoDB
# -----------------
MONGODB_URI=${MONGODB_URI}

# -----------------
# MinIO
# -----------------
MINIO_ENDPOINT=staging-s3.maternal-app.com
MINIO_PORT=443
MINIO_USE_SSL=true
MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
MINIO_BUCKET=maternal-staging-files
MINIO_REGION=us-east-1

# -----------------
# JWT
# -----------------
JWT_SECRET=${JWT_SECRET}
JWT_EXPIRATION=1h
JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET}
JWT_REFRESH_EXPIRATION=7d

# -----------------
# AI Services
# -----------------
AI_PROVIDER=azure

AZURE_OPENAI_ENABLED=true
AZURE_OPENAI_CHAT_ENDPOINT=${AZURE_OPENAI_CHAT_ENDPOINT}
AZURE_OPENAI_CHAT_DEPLOYMENT=${AZURE_OPENAI_CHAT_DEPLOYMENT}
AZURE_OPENAI_CHAT_API_VERSION=2025-04-01-preview
AZURE_OPENAI_CHAT_API_KEY=${AZURE_OPENAI_CHAT_API_KEY}
AZURE_OPENAI_CHAT_MAX_TOKENS=1000
AZURE_OPENAI_REASONING_EFFORT=medium

AZURE_OPENAI_WHISPER_ENDPOINT=${AZURE_OPENAI_WHISPER_ENDPOINT}
AZURE_OPENAI_WHISPER_DEPLOYMENT=whisper
AZURE_OPENAI_WHISPER_API_VERSION=2024-06-01
AZURE_OPENAI_WHISPER_API_KEY=${AZURE_OPENAI_WHISPER_API_KEY}

AZURE_OPENAI_EMBEDDINGS_ENDPOINT=${AZURE_OPENAI_EMBEDDINGS_ENDPOINT}
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT=text-embedding-ada-002
AZURE_OPENAI_EMBEDDINGS_API_VERSION=2023-05-15
AZURE_OPENAI_EMBEDDINGS_API_KEY=${AZURE_OPENAI_EMBEDDINGS_API_KEY}

# -----------------
# Security
# -----------------
CORS_ORIGIN=https://staging.maternal-app.com

# Rate Limiting (more lenient for staging)
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=200

# -----------------
# Logging
# -----------------
LOG_LEVEL=debug
LOG_DIR=logs

# -----------------
# Error Tracking
# -----------------
SENTRY_ENABLED=true
SENTRY_DSN=${SENTRY_DSN}
SENTRY_ENVIRONMENT=staging
SENTRY_SAMPLE_RATE=1.0
SENTRY_TRACES_SAMPLE_RATE=0.5
SENTRY_PROFILES_SAMPLE_RATE=0.5
APP_VERSION=1.0.0-staging

# -----------------
# Analytics
# -----------------
ANALYTICS_ENABLED=true
ANALYTICS_PROVIDER=posthog
POSTHOG_API_KEY=${POSTHOG_API_KEY}
POSTHOG_HOST=https://app.posthog.com

# -----------------
# Email
# -----------------
MAILGUN_API_KEY=${MAILGUN_API_KEY}
MAILGUN_DOMAIN=staging.maternal-app.com
MAILGUN_REGION=eu
EMAIL_FROM=noreply@staging.maternal-app.com
EMAIL_FROM_NAME=Maternal App (Staging)
APP_URL=https://staging.maternal-app.com

# -----------------
# Backups
# -----------------
BACKUP_ENABLED=true
BACKUP_SCHEDULE=0 3 * * *
BACKUP_RETENTION_DAYS=14
BACKUP_S3_BUCKET=maternal-staging-backups
BACKUP_S3_REGION=us-east-1
BACKUP_S3_ACCESS_KEY=${BACKUP_S3_ACCESS_KEY}
BACKUP_S3_SECRET_KEY=${BACKUP_S3_SECRET_KEY}
