Service Topology
nil-net). The frontend proxies /api/* requests to the backend via Vite’s dev server proxy.
Request Flow
- Browser hits
localhost:3000→ Vite serves the Vue SPA - API calls from the SPA go to
/api/v1/*→ Vite proxies tobackend:8000 - Backend validates JWT from
Authorization: Bearerheader - Database queries run via SQLAlchemy async sessions over asyncpg
- File operations (contract upload/download) go through MinIO’s S3 API with presigned URLs
Authentication Flow
admin, agreement_manager, read_only
Tiers: standard, premium (gates benchmark grid, peer group features)
Key Design Decisions
| Decision | Rationale |
|---|---|
| UUIDs as primary keys | Prevents enumeration, simplifies multi-tenancy |
| University-scoped queries | Every query filters by user.university_id for data isolation |
| JSONB for AI extraction data | Stores raw extraction output for audit trail without rigid schema |
percentile_cont for benchmarks | PostgreSQL native function, no application-level stats needed |
| pdfplumber for extraction | Runs locally, no external API dependency, works in Docker |
| MinIO for file storage | S3-compatible API, presigned URLs for secure downloads, local dev friendly |
| TanStack Query on frontend | Automatic cache invalidation, deduplication, background refetch |