modcomms/.env.deploy.example
Vadym Samoilenko a6fc149788 Replace WebSocket with REST polling to fix GCP LB 30s timeout
POST /api/analyze submits an analysis job and returns job_id instantly.
GET /api/analyze/{job_id} returns progress + result; frontend polls every 2s.

Analysis runs as asyncio.create_task in the background — each HTTP request
completes in milliseconds, well within the 30s GCP Load Balancer limit.

- Add backend/app/services/job_store.py: in-memory AnalysisJob store with
  30-min TTL cleanup
- Add backend/app/api/analysis_routes.py: POST + GET /api/analyze endpoints
  with full analysis pipeline (hash check, DB persistence, PDF pages, etc.)
- Remove backend/app/websocket/: handlers.py, manager.py, __init__.py
- Update backend/app/main.py: wire analysis_router, store analysis_service
  in app.state, drop all WebSocket imports and endpoint
- Update frontend/services/geminiService.ts: replace WS with fetch+poll;
  function signatures unchanged so App.tsx / WIPReviewer.tsx need no edits
- Remove VITE_BACKEND_WS_URL from vite.config.ts, deploy.sh, .env.deploy.example
- Update cloudrun.yaml: remove WebSocket-specific session affinity annotation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 15:26:01 +00:00

91 lines
3.4 KiB
Text

# ModComms Deployment Configuration
# Copy this file to .env.deploy and fill in your values.
# .env.deploy is gitignored — safe to store secrets here.
#
# The deploy script auto-generates backend/.env and frontend/.env.local
# from the variables below. You do NOT need to create those files manually.
# -----------------------------------------------------------------------
# Docker / Compose
# -----------------------------------------------------------------------
# Unique name per instance (creates unique container names)
# Examples: modcomms-prod, modcomms-dev
COMPOSE_PROJECT_NAME=modcomms-prod
# Backend port (must be unique per instance on this host)
BACKEND_PORT=8000
# PostgreSQL port (must be unique per instance on this host)
POSTGRES_PORT=5432
# PostgreSQL credentials
POSTGRES_USER=modcomms
POSTGRES_PASSWORD=change_this_in_production
POSTGRES_DB=modcomms
# -----------------------------------------------------------------------
# Apache / Frontend
# -----------------------------------------------------------------------
# Directory where the built frontend is served from
FRONTEND_DEPLOY_DIR=/var/vhosts/baic.oliver.solutions/htdocs/modcomms
# Subpath the app is served under (trailing slash required).
# Use / if served from the domain root.
VITE_BASE_PATH=/modcomms/
# -----------------------------------------------------------------------
# Backend URLs
# -----------------------------------------------------------------------
# HTTP base URL of the backend (no trailing slash)
VITE_BACKEND_URL=https://baic.oliver.solutions/back
# CORS origins allowed by the backend (must match VITE_BACKEND_URL origin)
CORS_ORIGINS=https://baic.oliver.solutions
# -----------------------------------------------------------------------
# Azure AD
# -----------------------------------------------------------------------
AZURE_TENANT_ID=your_azure_tenant_id
AZURE_CLIENT_ID=your_azure_client_id
# URL Azure redirects back to after login/logout (must match App Registration)
VITE_AZURE_REDIRECT_URI=https://baic.oliver.solutions/modcomms/
# Set to true only for local dev without Azure AD
DISABLE_AUTH=false
# -----------------------------------------------------------------------
# AI / LLM APIs
# -----------------------------------------------------------------------
GEMINI_API_KEY=your_gemini_api_key
LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key
# Optional: set regional base URL to fix 401 errors (US is default).
# EU region: https://api.eu.cloud.llamaindex.ai
# Leave blank to use the default US endpoint.
LLAMA_CLOUD_BASE_URL=
# -----------------------------------------------------------------------
# Email (Mailgun)
# -----------------------------------------------------------------------
MAILGUN_API_URL=https://api.mailgun.net/v3/oliver.solutions/messages
MAILGUN_API_KEY=your_mailgun_api_key
MAILGUN_FROM=admin@oliver.solutions
SUPPORT_EMAIL=BAICsupport@oliver.agency
# -----------------------------------------------------------------------
# Apache proxy config (for reference — configure in Apache vhost, not here)
# -----------------------------------------------------------------------
#
# ProxyPass /back/ http://localhost:8000/
# ProxyPassReverse /back/ http://localhost:8000/
#
# # SPA fallback (serve index.html for all non-file routes under /modcomms/)
# <Directory /var/vhosts/baic.oliver.solutions/htdocs/modcomms>
# FallbackResource /modcomms/index.html
# </Directory>