# DocForge Backend Environment Variables # Copy this to .env and fill in your values # ── Auth ────────────────────────────────────────────────────────────────────── # Secret key for signing JWTs — change this in production! SECRET_KEY=change_me_to_a_long_random_string_in_production # Fernet key for encrypting stored API keys (32-byte URL-safe base64) # Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" # If omitted, derived from SECRET_KEY (fine for dev, use a real key in prod) ENCRYPTION_KEY= # URL of your frontend (used in device-flow verification_uri + OAuth redirects) FRONTEND_URL=http://localhost:3000 # URL of this backend (used to build OAuth callback URIs) BACKEND_URL=http://localhost:8000 # ── OAuth (Google + GitHub sign-in) ────────────────────────────────────────── # Google: https://console.cloud.google.com/apis/credentials # Authorised redirect URI to add: BACKEND_URL/api/auth/oauth/google/callback GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= # GitHub: https://github.com/settings/developers → OAuth Apps # Callback URL to set: BACKEND_URL/api/auth/oauth/github/callback GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= # ── Fallback AI keys (used when user has no keys stored) ───────────────────── # Optional: lets unauthenticated / keyless users still get a result. # Leave blank to require every user to supply their own key. GEMINI_API_KEY= GROQ_API_KEY= # ── Storage ─────────────────────────────────────────────────────────────────── # Redis URL (optional — uses in-memory cache if not set) REDIS_URL=redis://localhost:6379 # Supabase (recommended for production — stores users, API keys, cache, device codes) # Required tables: users, user_api_keys, device_codes, cache_entries, corrections SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key # ── Misc ────────────────────────────────────────────────────────────────────── # Playwright timeout in milliseconds PLAYWRIGHT_TIMEOUT=60000 # Set to true to use in-memory fallbacks (no Redis/Supabase required) # Perfect for local development DEV_MODE=true