# .env.example # ============================================================================ # ENVIRONMENT VARIABLES TEMPLATE # ============================================================================ # Copy this file to .env and fill in your values. # For local development with Docker/Podman, these defaults should work out of the box. # # IMPORTANT: Never commit .env files with real credentials to version control! # ============================================================================ # =================== # Database Configuration # =================== # PostgreSQL connection settings # For container development, use the service name "postgres" DB_HOST=postgres DB_PORT=5432 DB_USER=postgres DB_PASSWORD=postgres DB_NAME=flyer_crawler_dev # =================== # Redis Configuration # =================== # Redis URL for caching and job queues # For container development, use the service name "redis" REDIS_URL=redis://redis:6379 # Optional: Redis password (leave empty if not required) REDIS_PASSWORD= # =================== # Application Settings # =================== NODE_ENV=development # Frontend URL for CORS and email links FRONTEND_URL=http://localhost:3000 # Flyer Base URL - used for seed data and flyer image URLs # Dev container: https://localhost (NOT 127.0.0.1 - avoids SSL mixed-origin issues) # Test: https://flyer-crawler-test.projectium.com # Production: https://flyer-crawler.projectium.com FLYER_BASE_URL=https://localhost # =================== # Authentication # =================== # REQUIRED: Secret key for signing JWT tokens (generate a random 64+ character string) JWT_SECRET=your-super-secret-jwt-key-change-this-in-production # OAuth Providers (Optional - enable social login) # Google OAuth - https://console.cloud.google.com/apis/credentials GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= # GitHub OAuth - https://github.com/settings/developers GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= # =================== # AI/ML Services # =================== # REQUIRED: Google Gemini API key for flyer OCR processing GEMINI_API_KEY=your-gemini-api-key # =================== # External APIs # =================== # Optional: Google Maps API key for geocoding store addresses GOOGLE_MAPS_API_KEY= # =================== # Email Configuration (Optional) # =================== # SMTP settings for sending emails (deal notifications, password reset) SMTP_HOST= SMTP_PORT=587 SMTP_SECURE=false SMTP_USER= SMTP_PASS= SMTP_FROM_EMAIL=noreply@example.com # =================== # Worker Configuration (Optional) # =================== # Concurrency settings for background job workers WORKER_CONCURRENCY=1 EMAIL_WORKER_CONCURRENCY=10 ANALYTICS_WORKER_CONCURRENCY=1 CLEANUP_WORKER_CONCURRENCY=10 # Worker lock duration in milliseconds (default: 2 minutes) WORKER_LOCK_DURATION=120000 # =================== # Error Tracking (ADR-015) # =================== # Sentry-compatible error tracking via Bugsink (self-hosted) # DSNs are created in Bugsink UI at https://localhost:8443 (dev) or your production URL # # Dev container projects: # - Project 1: Backend API (Dev) - receives Pino, PostgreSQL errors # - Project 2: Frontend (Dev) - receives browser errors via Sentry SDK # - Project 4: Infrastructure (Dev) - receives Redis, NGINX, Vite errors # # Backend DSN - for Express/Node.js errors (internal container URL) SENTRY_DSN=http://@localhost:8000/1 # Frontend DSN - for React/browser errors (uses nginx proxy for browser access) # Note: Browsers cannot reach localhost:8000 directly, so we use nginx proxy at /bugsink-api/ VITE_SENTRY_DSN=https://@localhost/bugsink-api/2 # Environment name for error grouping (defaults to NODE_ENV) SENTRY_ENVIRONMENT=development VITE_SENTRY_ENVIRONMENT=development # Enable/disable error tracking (default: true) SENTRY_ENABLED=true VITE_SENTRY_ENABLED=true # Enable debug mode for SDK troubleshooting (default: false) SENTRY_DEBUG=false VITE_SENTRY_DEBUG=false # =================== # Source Maps Upload (ADR-015) # =================== # Set to 'true' to enable source map generation and upload during builds # Only used in CI/CD pipelines (deploy-to-prod.yml, deploy-to-test.yml) GENERATE_SOURCE_MAPS=true # Auth token for uploading source maps to Bugsink # Create at: https://bugsink.projectium.com (Settings > API Keys) # Required for de-minified stack traces in error reports SENTRY_AUTH_TOKEN= # URL of your Bugsink instance (for source map uploads) SENTRY_URL=https://bugsink.projectium.com # =================== # Feature Flags (ADR-024) # =================== # Feature flags control the availability of features at runtime. # All flags default to disabled (false) when not set or set to any value other than 'true'. # Set to 'true' to enable a feature. # # Backend flags use: FEATURE_SNAKE_CASE # Frontend flags use: VITE_FEATURE_SNAKE_CASE (VITE_ prefix required for client-side access) # # Lifecycle: # 1. Add flag with default false # 2. Enable via env var when ready for testing/rollout # 3. Remove conditional code when feature is fully rolled out # 4. Remove flag from config within 3 months of full rollout # # See: docs/adr/0024-feature-flagging-strategy.md # Backend Feature Flags # FEATURE_BUGSINK_SYNC=false # Enable Bugsink error sync integration # FEATURE_ADVANCED_RBAC=false # Enable advanced RBAC features # FEATURE_NEW_DASHBOARD=false # Enable new dashboard experience # FEATURE_BETA_RECIPES=false # Enable beta recipe features # FEATURE_EXPERIMENTAL_AI=false # Enable experimental AI features # FEATURE_DEBUG_MODE=false # Enable debug mode for development # Frontend Feature Flags (VITE_ prefix required) # VITE_FEATURE_NEW_DASHBOARD=false # Enable new dashboard experience # VITE_FEATURE_BETA_RECIPES=false # Enable beta recipe features # VITE_FEATURE_EXPERIMENTAL_AI=false # Enable experimental AI features # VITE_FEATURE_DEBUG_MODE=false # Enable debug mode for development