# Vision Videoke Environment Configuration
# Subdirectory Deployment Template
# Copy this file to .env and update the values

# Application Configuration
NODE_ENV=production
PORT=3001

# Subdirectory Configuration
SUBDIRECTORY_PATH=/music
API_BASE_PATH=/music/api
PUBLIC_PATH=/music

# Domain Configuration
DOMAIN_NAME=yourdomain.com
APP_URL=https://yourdomain.com/music
API_URL=https://yourdomain.com/music/api

# SSL Configuration
SSL_EMAIL=admin@yourdomain.com

# API Keys (REQUIRED - Replace with your actual keys)
REACT_APP_OPENAI_API_KEY=your_openai_api_key_here
OPENAI_API_KEY=your_openai_api_key_here

REACT_APP_UDIO_API_KEY=your_udio_api_key_here
UDIO_API_KEY=your_udio_api_key_here

REACT_APP_ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here

REACT_APP_VEO_API_KEY=your_veo_api_key_here
VEO_API_KEY=your_veo_api_key_here

# Database Configuration (Optional)
DATABASE_URL=postgresql://user:password@localhost:5432/visionvideoke

# File Storage Configuration
UPLOAD_DIR=/var/www/html/music/uploads
TEMP_DIR=/var/www/html/music/temp
MAX_FILE_SIZE=100MB
MAX_FILES_PER_UPLOAD=10

# AWS S3 Configuration (Optional - for cloud storage)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
AWS_S3_BUCKET=visionvideoke-uploads

# Security Configuration
JWT_SECRET=your_jwt_secret_here_32_characters_min
ENCRYPTION_KEY=your_encryption_key_here_32_chars
SESSION_SECRET=your_session_secret_here
SESSION_TIMEOUT=86400000

# Payment Processing (Stripe)
REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_live_your_stripe_publishable_key
STRIPE_SECRET_KEY=sk_live_your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret

# CORS Configuration
CORS_ORIGIN=https://yourdomain.com
CORS_CREDENTIALS=true

# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100

# Feature Flags
REACT_APP_ENABLE_VOICE_CLONING=true
REACT_APP_ENABLE_VIDEO_GENERATION=true
REACT_APP_ENABLE_PAYMENTS=true
REACT_APP_ENABLE_USER_ACCOUNTS=true

# Monitoring Configuration
SENTRY_DSN=your_sentry_dsn_here
LOG_LEVEL=info
LOG_FILE=/var/log/visionvideoke/app.log

# Email Configuration (for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
SMTP_FROM=noreply@yourdomain.com

# Cache Configuration (Redis - Optional)
REDIS_URL=redis://localhost:6379
REDIS_PASSWORD=your_redis_password
CACHE_TTL=3600

# Development Configuration (for local development)
REACT_APP_DEV_API_URL=http://localhost:3001/api
REACT_APP_DEV_APP_URL=http://localhost:3000/music

# Production Build Configuration
GENERATE_SOURCEMAP=false
INLINE_RUNTIME_CHUNK=false
IMAGE_INLINE_SIZE_LIMIT=0

# Health Check Configuration
HEALTH_CHECK_ENDPOINT=/health
HEALTH_CHECK_INTERVAL=30000

# Backup Configuration
BACKUP_DIR=/var/backups/visionvideoke
BACKUP_RETENTION_DAYS=30
AUTO_BACKUP_ENABLED=true
BACKUP_SCHEDULE=0 2 * * *

# Performance Configuration
MAX_CONCURRENT_REQUESTS=100
REQUEST_TIMEOUT=30000
KEEP_ALIVE_TIMEOUT=5000

# Analytics Configuration (Optional)
GOOGLE_ANALYTICS_ID=GA-XXXXXXXXX
FACEBOOK_PIXEL_ID=your_facebook_pixel_id

# Social Media Integration (Optional)
FACEBOOK_APP_ID=your_facebook_app_id
GOOGLE_CLIENT_ID=your_google_client_id
TWITTER_API_KEY=your_twitter_api_key

# Content Security Policy
CSP_SCRIPT_SRC="'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com"
CSP_STYLE_SRC="'self' 'unsafe-inline' https://fonts.googleapis.com"
CSP_FONT_SRC="'self' https://fonts.gstatic.com"
CSP_IMG_SRC="'self' data: https:"
CSP_MEDIA_SRC="'self' https:"
CSP_CONNECT_SRC="'self' https:"

# API Rate Limiting per Service
OPENAI_RATE_LIMIT=60
UDIO_RATE_LIMIT=30
ELEVENLABS_RATE_LIMIT=100

# File Processing Configuration
MAX_IMAGE_SIZE=10MB
MAX_AUDIO_SIZE=50MB
MAX_VIDEO_SIZE=100MB
SUPPORTED_IMAGE_FORMATS=jpg,jpeg,png,gif,webp
SUPPORTED_AUDIO_FORMATS=mp3,wav,m4a,aac
SUPPORTED_VIDEO_FORMATS=mp4,webm,mov

# Queue Configuration (for background processing)
QUEUE_REDIS_URL=redis://localhost:6379
QUEUE_CONCURRENCY=5
QUEUE_MAX_ATTEMPTS=3
QUEUE_DELAY=1000

# Webhook Configuration
WEBHOOK_SECRET=your_webhook_secret_here
WEBHOOK_TIMEOUT=10000

# Maintenance Mode
MAINTENANCE_MODE=false
MAINTENANCE_MESSAGE="Vision Videoke is currently under maintenance. Please try again later."

# Debug Configuration
DEBUG_MODE=false
VERBOSE_LOGGING=false
ENABLE_PROFILING=false

