How siddharth-varma-raja/clauseguard works
ClauseGuard is presented as an Irish lease-review product, but the shown runtime is chiefly an identity/account API plus a small lease-template diff engine. The documented tenant workflow is upload a lease, inspect clause flags and citations, and ask grounded questions; those analysis capabilities are goals in the README, not evidenced end-to-end in the sampled implementation. The graph distinguishes that documented workflow from the implemented auth and diff components. Source excerpts support the API wiring; frontend-to-backend and analysis-pipeline connections are not shown.
Main entry points: auth.py Auth endpoints · account.py Account endpoints · firebase.py Firebase identity · deps.py User authorization
Components 19
Tenant web app
- Public interface
Development/frontend/app/(public)/page.tsx - Auth forms
Development/frontend/components/auth/LoginForm.tsx - Dashboard
Development/frontend/app/(protected)/dashboard/page.tsx
Identity API
- API application
Development/backend/app/main.py - Versioned routes
Development/backend/app/api/v1/router.py - Auth endpoints
Development/backend/app/api/v1/endpoints/auth.py - Account endpoints
Development/backend/app/api/v1/endpoints/account.py
Identity and persistence
- User authorization
Development/backend/app/api/deps.py - Firebase identity
Development/backend/app/core/firebase.py - User and audit records
Development/backend/app/models/user.py - Database sessions
Development/backend/app/database.py - User schemas
Development/backend/app/schemas/user.py
Lease review
- Lease upload and review
Development/backend/document_checker - Template comparison
Development/backend/document_checker/diff_engine.py - Checker API
Development/backend/document_checker/api.py - Flags and explanations
Development/backend/document_checker/schemas.py - Legal citations and Q&A
Other components
- Tenant
- Firebase service
Connections 25
- Tenant → Public interface: opens
Development/frontend/app/(public)/page.tsx - Tenant → Auth forms: signs in
- Tenant → Lease upload and review: submits lease
- Lease upload and review → Flags and explanations: returns findings
Development/backend/document_checker/api.py - Flags and explanations → Legal citations and Q&A: cites guidance
- Dashboard → Legal citations and Q&A: asks grounded questions
- API application → Versioned routes: mounts routes
Development/backend/app/main.py - API application → Firebase identity: initializes
Development/backend/app/main.py - Versioned routes → Auth endpoints: registers
Development/backend/app/api/v1/router.py - Versioned routes → Account endpoints: registers
Development/backend/app/api/v1/router.py - Auth endpoints → User authorization: requires user
Development/backend/app/api/v1/endpoints/auth.py - Account endpoints → User authorization: requires user
Development/backend/app/api/v1/endpoints/account.py - User authorization → Firebase identity: verifies token
Development/backend/app/api/deps.py - User authorization → Database sessions: queries users
Development/backend/app/api/deps.py - Auth endpoints → Firebase identity: manages identity
Development/backend/app/api/v1/endpoints/auth.py - Account endpoints → Firebase identity: revokes sessions
Development/backend/app/api/v1/endpoints/account.py - Auth endpoints → Database sessions: reads and writes
Development/backend/app/api/v1/endpoints/auth.py - Account endpoints → Database sessions: reads and writes
Development/backend/app/api/v1/endpoints/account.py - User and audit records → Database sessions: uses model base
Development/backend/app/models/user.py - Auth endpoints → User schemas: validates responses
Development/backend/app/api/v1/endpoints/auth.py - Account endpoints → User schemas: validates responses
Development/backend/app/api/v1/endpoints/account.py - Firebase identity → Firebase service: calls
Development/backend/app/core/firebase.py - Checker API → Template comparison: uses comparison
Development/backend/document_checker/api.py - Checker API → Flags and explanations: uses schemas
Development/backend/document_checker/api.py - Lease upload and review → Checker API: routes requests
Development/backend/document_checker/api.py