modcomms/frontend
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
..
components Fix QC scroll, show error toasts, enable Apache WS module 2026-03-18 12:52:30 +00:00
contexts Grant oversight_admin write access to campaigns and proofs 2026-03-03 13:08:54 +00:00
hooks Add PDF preview support with on-demand rasterization 2026-01-25 08:56:23 -06:00
public Fix WebSocket drops: add bidirectional keepalive pings 2026-03-18 13:10:27 +00:00
services Replace WebSocket with REST polling to fix GCP LB 30s timeout 2026-03-18 15:26:01 +00:00
utils Prepare production deployment for baic.oliver.solutions/modcomms 2026-03-06 11:54:00 +00:00
App.tsx Fix QC scroll, show error toasts, enable Apache WS module 2026-03-18 12:52:30 +00:00
constants.ts Restructure agent system: remove Tone, split Channel, implement Legal 2026-01-24 11:58:17 -06:00
index.html Fix favicon/CSS 404s; heartbeat 25s→10s already staged 2026-03-18 12:57:49 +00:00
index.tsx permissions changes 2025-12-18 16:51:27 +00:00
metadata.json permissions changes 2025-12-18 16:51:27 +00:00
package-lock.json permissions changes 2025-12-18 16:51:27 +00:00
package.json permissions changes 2025-12-18 16:51:27 +00:00
README.md permissions changes 2025-12-18 16:51:27 +00:00
tsconfig.json permissions changes 2025-12-18 16:51:27 +00:00
types.ts Add frontend RBAC: UserContext, role-based sidebar, agency filter, user management 2026-02-19 08:36:38 -06:00
vite.config.ts Replace WebSocket with REST polling to fix GCP LB 30s timeout 2026-03-18 15:26:01 +00:00

GHBanner

Run and deploy your AI Studio app

This contains everything you need to run your app locally.

View your app in AI Studio: https://ai.studio/apps/drive/1vH-R-vj0Xkk_g2ZFdHtLxNc12sFTOl2L

Run Locally

Prerequisites: Node.js

  1. Install dependencies: npm install
  2. Set the GEMINI_API_KEY in .env.local to your Gemini API key
  3. Run the app: npm run dev