# PRODUCTION-READY ENVIRONMENT CONFIGURATION
# Copy this file to .env and configure with your actual values

# ==========================================
# DATABASE CONFIGURATION
# ==========================================
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nearbuymarts_cloudserver
DB_USERNAME=nearbuymarts_cloudserver
DB_PASSWORD=nearbuymarts_cloudserver
DB_CONNECTION_LIMIT=10

# ==========================================
# SECURITY CONFIGURATION
# ==========================================
# Generate a secure token: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
ADMIN_SECRET_TOKEN=your_super_secure_random_token_here_64_characters_long

# ==========================================
# CORS CONFIGURATION
# ==========================================
# Comma-separated list of allowed origins (no spaces after commas)
CORS_ORIGIN=https://nearbuymarts.com,https://www.nearbuymarts.com,https://cloud.nearbuymarts.com,https://api.nearbuymarts.com,https://v1.nearbuymarts.com,https://v2.nearbuymarts.com

# ==========================================
# WHATSAPP CONFIGURATION
# ==========================================
# WhatsApp Web version to use
WA_VERSION=[2,3000,1021163342]

# Record messages types: text, media, or both
RECORD_MESSAGES=text,media

# Autoreply back menu keywords (comma-separated)
AUTOREPLY_BACK_MENU=back

# Create WhatsApp instance as MOBILE device (instead of Web)
MOBILE=true

# Disable QR code display via API
# DISABLE_GET_QR=true

# Disable server info endpoint
# DISABLE_SERVER_INFO=true

# Custom device browser information (shows in WhatsApp > Linked Devices)
# DEVICE_BROWSER=["NearBuy Communications Gateway","Safari","10.0"]

# Baileys version to use (if you have multiple versions)
# BAILEYS_VERSION=7.0.0

# ==========================================
# PROXY CONFIGURATION (Optional)
# ==========================================
# ProxyScrape API for rotating proxies
# Documentation: https://docs.proxyscrape.com
# PROXYSCRAPE=https://api.proxyscrape.com/v2/?request=displayproxies&protocol=http&timeout=10000&country=us&ssl=no&anonymity=elite

# ==========================================
# SERVER CONFIGURATION
# ==========================================
PORT=3000
NODE_ENV=production

# ==========================================
# RATE LIMITING
# ==========================================
# Rate limit: max requests per 15 minutes
RATE_LIMIT_MAX=100
RATE_LIMIT_STRICT_MAX=10

# ==========================================
# LOGGING
# ==========================================
# Log level: trace, debug, info, warn, error, fatal
LOG_LEVEL=info

# ==========================================
# DEFAULT COUNTRY CODE
# ==========================================
# Used for phone number formatting (ISO 2-letter code)
DEFAULT_COUNTRY=NG

# ==========================================
# NOTES
# ==========================================
# 1. NEVER commit this .env file to Git
# 2. Use strong, unique passwords for database and admin token
# 3. Generate admin token with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# 4. Restart Node.js after changing any values here
# 5. Keep this file secure with proper file permissions: chmod 600 .env
