gmal-scope-builder/backend/app/main.py
DJP e18976fdb2 Initial commit - GMAL Scope Builder
Dockerized web app (FastAPI + React + PostgreSQL) for scoping client ratecards
against the GMAL master asset database. Features:
- GMAL data ingestion from Excel (390 assets, 120 roles, 5 model types)
- AI-powered document parsing and asset extraction (Claude Opus 4.6)
- AI matching engine with parallel batching, confidence scoring, caveats
- Ratecard builder with hours x volume calculation
- Excel and PDF export
- GMAL browser and inline editor
- AI cost tracking per project (persisted to DB)
- Debug panel for AI call inspection
- Dark theme UI with gold (#FFC407) accent

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:35:14 -04:00

44 lines
1.3 KiB
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api import gmal, ingest, projects, matching, ratecard
app = FastAPI(title="Scope Builder", version="1.0.0")
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000", "http://localhost:3001", "http://localhost:3010"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(gmal.router, prefix="/api/gmal", tags=["GMAL"])
app.include_router(ingest.router, prefix="/api/gmal", tags=["Ingest"])
app.include_router(projects.router, prefix="/api/projects", tags=["Projects"])
app.include_router(matching.router, prefix="/api/projects", tags=["Matching"])
app.include_router(ratecard.router, prefix="/api/projects", tags=["Ratecard"])
@app.get("/api/health")
async def health():
return {"status": "ok"}
@app.get("/api/ai/usage")
async def ai_usage():
from app.utils.claude_client import get_usage_stats
return get_usage_stats()
@app.post("/api/ai/usage/reset")
async def ai_usage_reset():
from app.utils.claude_client import reset_usage_stats
reset_usage_stats()
return {"detail": "Usage stats reset"}
@app.get("/api/ai/debug")
async def ai_debug():
from app.utils.claude_client import get_debug_log
return get_debug_log()