# One env file for the whole app backend, including the AI coach that runs inside it. # Copy to backend/.env (git-ignored) and fill in. Run commands from backend/ so both settings loaders find it. # --- App backend --- ENV=dev # dev | test | prod (prod hides /docs) DATABASE_URL=postgresql+asyncpg://USER:PASSWORD@HOST:5432/postgres?ssl=require # Supabase session pooler (IPv4) JWT_SECRET= # long random string STORAGE_ENDPOINT=https://nyc3.digitaloceanspaces.com STORAGE_REGION=nyc3 STORAGE_BUCKET=baseball-app STORAGE_KEY= STORAGE_SECRET= # Optional, needed from milestone 3/4 on RESEND_API_KEY= # password reset email EMAIL_FROM=no-reply@cognivision.app PASSWORD_RESET_URL=https://cognivision.app/reset-password FCM_PROJECT_ID= # push notifications FCM_SERVICE_ACCOUNT_FILE= APPLE_CLIENT_IDS=[] # Sign in with Apple audiences, JSON list GOOGLE_CLIENT_IDS=[] # Google sign-in audiences, JSON list PRO_PRODUCT_IDS=["pro_monthly"] APPLE_BUNDLE_ID= APPLE_ENVIRONMENT=Production # Production | Sandbox GOOGLE_PACKAGE_NAME= GOOGLE_SERVICE_ACCOUNT_FILE= GOOGLE_PUBSUB_AUDIENCE= # --- AI coach (ai_coach package, runs inside the backend) --- GOOGLE_API_KEY= # Gemini; empty = rule-based coaching text only COACH_MODEL=gemini-3.8-flash COACH_ESCALATION_MODEL=gemini-3.8-flash COACH_DAILY_BUDGET_USD=1.00 COACH_CACHE_PATH=.coach_cache/responses.sqlite3 COACH_CACHE_TTL_DAYS=30 COACH_FAILURE_CACHE_TTL_S=300 COACH_TIMEOUT_S=20 COACH_MAX_OUTPUT_TOKENS=700 COACH_ENV=dev COACH_LOG_DIR=.coach_cache/logs COACH_LOG_LEVEL=INFO COACH_TRACING=false LANGSMITH_API_KEY= LANGSMITH_PROJECT=ai-coach # Private database audit of every backend HTTP request/response (apply migrations first). API_AUDIT_ENABLED=true API_AUDIT_MAX_BODY_BYTES=1048576 API_AUDIT_WRITE_TIMEOUT_S=2 API_AUDIT_RETENTION_DAYS=30 # Set this to the deployed Git commit/build identifier for incident correlation. SERVICE_VERSION=0.1.0 # Trusted operator account UUIDs allowed to GET /v1/admin/api-logs. Empty denies everyone. API_AUDIT_READER_ACCOUNT_IDS=[]