113 lines
4 KiB
Markdown
113 lines
4 KiB
Markdown
---
|
||
name: "Mod Comms"
|
||
client: Barclays
|
||
status: active
|
||
tech: [Python, FastAPI, React, Vite, TypeScript, PostgreSQL, Gemini, Docker]
|
||
local_path: /Users/ai_leed/Documents/Projects/Oliver/modcomms
|
||
deploy: docker compose up --build
|
||
url:
|
||
server: baic (web-03)
|
||
tags: [barclays, ai, compliance, proof-review, multi-agent, gcp]
|
||
created: 2026-04-14
|
||
last_commit: 2026-04-15
|
||
commits: 203
|
||
---
|
||
|
||
## Overview
|
||
AI-powered proof review tool for Barclays marketing materials. Multi-agent system analyzes uploaded proofs (images/PDFs) for:
|
||
- Legal compliance
|
||
- Brand adherence
|
||
- Tone of voice
|
||
- Channel suitability
|
||
|
||
4 specialist AI agents run in parallel, lead agent synthesizes the final verdict. Real-time WebSocket streaming (switched to REST polling due to GCP LB 30s timeout).
|
||
|
||
Backup: `modcomms_backup/`
|
||
|
||
## Tech Stack
|
||
- **Frontend:** React 18 + Vite + TypeScript (port 3000)
|
||
- **Backend:** Python + FastAPI + Uvicorn (port 8000)
|
||
- **Database:** PostgreSQL 16 (Alembic migrations)
|
||
- **AI:** Google Gemini Pro (primary) + Flash (fallback)
|
||
- **Auth:** Azure AD (MSAL)
|
||
- **Infrastructure:** Docker + docker-compose
|
||
- **Deployed on:** GCP (Google Cloud Platform)
|
||
|
||
## Architecture
|
||
```
|
||
Frontend (React/Vite :3000)
|
||
↓ REST polling (switched from WebSocket due to GCP 30s LB timeout)
|
||
Backend (FastAPI :8000)
|
||
↓
|
||
4 AI Agents (Gemini) → Lead Agent → Final Verdict
|
||
↓
|
||
PostgreSQL + File Storage
|
||
```
|
||
|
||
## Deployment
|
||
- **Run:** `docker compose up --build`
|
||
- **Local:** Frontend :3000, Backend :8000
|
||
- **Server:** GCP (Google Cloud Platform)
|
||
- **Local path:** `/Users/ai_leed/Documents/Projects/Oliver/modcomms`
|
||
|
||
### Environment Variables
|
||
**Frontend (`frontend/.env.local`)**
|
||
```
|
||
GEMINI_API_KEY=
|
||
VITE_BACKEND_WS_URL=ws://localhost:8000/ws/analyze
|
||
VITE_BACKEND_URL=http://localhost:8000
|
||
```
|
||
**Backend (`backend/.env`)**
|
||
```
|
||
GEMINI_API_KEY=
|
||
DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/modcomms
|
||
AZURE_TENANT_ID=
|
||
AZURE_CLIENT_ID=
|
||
CORS_ORIGINS=http://localhost:3000
|
||
DISABLE_AUTH=true # local dev only
|
||
```
|
||
|
||
### Dev Commands
|
||
```bash
|
||
# Frontend
|
||
cd frontend && npm install && npm run dev
|
||
|
||
# Backend
|
||
cd backend && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||
|
||
# Database migrations
|
||
cd backend && alembic upgrade head
|
||
```
|
||
|
||
## Timeline / Git History
|
||
| Date | Change |
|
||
|------|--------|
|
||
| 2026-04-15 | Replace logo SVG with PNG v6 in Sidebar and PDF Report |
|
||
| 2026-04-15 | Add deploy-dev.sh for dev server (sudo docker, fix dist permissions) |
|
||
| 2026-04-14 | Replace logo with v6 SVG across Sidebar and PDF Report |
|
||
| 2026-03-19 | Add CSV export of campaign data for super_admin and oversight_admin |
|
||
| 2026-03-18 | **Critical:** Switch WebSocket → REST polling (GCP LB 30s timeout fix) |
|
||
| 2026-03-18 | Switch AI model: Pro primary, Flash fallback |
|
||
| 2026-03-18 | Fix WebSocket keepalive + 25s→10s heartbeat |
|
||
| 2026-03-16 | Fix PDF logo URL with Vite base path in production |
|
||
| 2026-03-16 | Fix LlamaParse 401 + update logo to v5 |
|
||
|
||
## Sessions
|
||
### 2026-04-15 – Replace logo with file from /Volumes/SSD/Downloads/BAR-ModComms-logos-v6.png
|
||
**Asked:** Replace logo with file from /Volumes/SSD/Downloads/BAR-ModComms-logos-v6.png and set up server deployment process.
|
||
**Done:** Created deploy-dev.sh script with dev-specific configurations (sudo docker compose, port 8001, dev project name) and successfully deployed changes.
|
||
|
||
### 2026-04-14 – Project catalogued
|
||
**Done:** Added to Obsidian second brain with full details from CLAUDE.md and git history.
|
||
|
||
---
|
||
## Change Log
|
||
| Date | Requested | Changed | Files |
|
||
|------|-----------|---------|-------|
|
||
| 2026-04-15 | Logo replacement, deployment scripts | Added deploy-dev.sh with sudo docker compose and dev port 8001, configured git pull workflow | deploy-dev.sh, deploy.sh |
|
||
| 2026-04-14 | Logo update | Replace logo with v6 SVG | Sidebar, PDF Report |
|
||
| 2026-03-18 | Fix dropped connections on GCP | WebSocket → REST polling | backend, frontend |
|
||
|
||
## Related
|
||
- [[enterprise-ai-hub-nexus/Enterprise AI Hub Nexus]] (similar AI platform)
|
||
- [[semblance/Semblance]] (same GCP deployment issues)
|