---
name: "GMAL Scope Builder"
client: Oliver Internal
status: active
tech: [Python, FastAPI, React, TypeScript, Vite, PostgreSQL, Claude Opus 4.6, Docker, Azure SSO]
local_path: /Users/ai_leed/Documents/Projects/Oliver/gmal-scope-builder
deploy: docker compose up --build
url: 
server: Deployed (base path /gsb)
tags: [oliver, gmal, ratecard, fte, ai, claude, postgres, azure-sso]
created: 2026-04-14
last_commit: 2026-03-31
commits: 23
---

## Overview
AI-powered scoping tool matching client deliverables against GMAL master asset database. Builds ratecards with hours per role and calculates FTE headcount.

**Workflow:**
1. Upload client brief (Word/Excel) → Claude Opus 4.6 parses it
2. AI matches deliverables to GMAL asset catalog
3. System builds ratecard (hours per role) + FTE model
4. Excel export with GMAL standard caveats

## Tech Stack
- **Frontend:** React 18 + TypeScript + Vite + React Router + Axios (port 3010)
- **Backend:** FastAPI + SQLAlchemy async + asyncpg + Uvicorn (port 8001)
- **Database:** PostgreSQL 16 (port 5433)
- **AI:** Claude Opus 4.6 via Anthropic SDK (tool_use for structured output)
- **Auth:** Azure SSO (MSAL v5) + `DEV_AUTH_BYPASS` env var for local dev
- **Infrastructure:** Docker + docker-compose (3 services)

## Ports
| Service | Port |
|---------|------|
| Frontend (Vite) | 3010 |
| Backend API | 8001 |
| PostgreSQL | 5433 |

## Dev Commands
```bash
# Docker (primary)
cp .env.example .env       # Add ANTHROPIC_API_KEY
docker compose build
docker compose up -d
docker compose logs backend --tail 50

# One-time: populate GMAL catalog (place Excel in data/)
curl -X POST http://localhost:8001/api/gmal/ingest

# DB backup
docker compose exec db pg_dump -U scope_user -d scope_builder > backups/dump.sql

# Without Docker
cd frontend && npm install && npm run dev
cd backend && uvicorn app.main:app --reload --port 8000
```

## Deployment
- **Run:** `docker compose up --build`
- **Deploy script:** `deploy.sh`
- **Base path:** `/gsb`
- **Local path:** `/Users/ai_leed/Documents/Projects/Oliver/gmal-scope-builder`

## Timeline / Git History
| Date | Change |
|------|--------|
| 2026-03-31 | Add GMAL standard caveats to ratecard Excel export |
| 2026-03-30 | Fix 401: send ID token instead of Graph access token |
| 2026-03-30 | Fix logout for MSAL v5: use clearCache() |
| 2026-03-30 | Fix 504 timeouts on upload/match + broken exports |
| 2026-03-28 | Add Azure SSO + production deployment config |
| 2026-03-28 | Add deploy.sh + fix TS build errors |
| 2026-03-28 | Add DEV_AUTH_BYPASS for local dev |
| 2026-03-28 | Increase Vite proxy timeout to 5min for long AI calls |

## Sessions
### 2026-04-14 – Project catalogued
**Done:** Added to Obsidian second brain with full details.

---
## Change Log
| Date | Requested | Changed | Files |
|------|-----------|---------|-------|
| 2026-03-31 | Add caveats to export | GMAL standard caveats row in Excel | export.py |
| 2026-03-28 | Add Azure SSO | MSAL v5 auth + production config | frontend, backend |

## Related
- [[build-a-squad/Build A Squad]] (same FTE scoping concept)
- [[ac-helper/AC Helper]]
