How adhityacl/new-clm works
Legalio is a multi-tenant CLM for managing contracts, partners, insertion orders, due diligence, and document drafting. Users sign in, select an organization, work with scoped business records or create and redline contract documents, then monitor activity and renewals. The main internal layers are the React application, Express API and SQLite persistence, and shared authorization and policy logic. The README documents additional AI, Google, and administration capabilities; several of their implementation paths are present in the tree but were not sampled, so those links are marked unverified.
Main entry points: App.tsx Application Shell · server.ts Express API · authConsoleRoutes.ts Admin Console API · documentRoutes.ts Document API
Components 27
Application UI
- Application Shell
src/App.tsx - Language Provider
src/context/LanguageContext.tsx
Business Records
- Dashboard
src/components/DashboardView.tsx - Contracts
src/components/ContractsView.tsx - Partners and Evaluation
src/components/PartnersView.tsx - Partner Spendings
src/components/PartnerSpendingView.tsx - Insertion Orders
src/components/IOView.tsx - Legal Structure
src/components/HierarchyTreemapView.tsx - Bulk Import
src/components/BulkImportView.tsx - Tenant Settings
src/components/SettingsView.tsx
Document Creator
- Contract Creator
src/components/ContractCreatorView.tsx - Document Explorer and Redlining
src/components/documents/DocumentExplorer.tsx - Document API
src/server/documentRoutes.ts
Identity and Scope
- Sign-in and Session
src/context/AuthContext.tsx - Organization Context
src/context/TenantContext.tsx - RBAC Engine
server/rbac.ts - RBAC Routes
server/rbacRoutes.ts - Admin Console API
src/server/authConsoleRoutes.ts - Tenant Policy Packs
src/lib/policy/index.ts
API and Integrations
- Express API
server.ts - SQLite Data
src/lib/auth.ts - Document Parsing and OCR
src/lib/cheapOcrPipeline.ts - Google Drive Sync
src/lib/googleDriveSync.ts - Google Gemini
- Google Drive and Sheets
- SMTP Email
Other components
- User
Connections 32
- User → Application Shell: uses
- Application Shell → Sign-in and Session: provides session
src/App.tsx - Application Shell → Organization Context: provides tenant
src/App.tsx - Application Shell → Language Provider: provides language
src/App.tsx - Application Shell → Dashboard: renders
src/App.tsx - Application Shell → Contracts: renders
src/App.tsx - Application Shell → Partners and Evaluation: renders
src/App.tsx - Application Shell → Partner Spendings: renders
src/App.tsx - Application Shell → Insertion Orders: renders
src/App.tsx - Application Shell → Legal Structure: renders
src/App.tsx - Application Shell → Bulk Import: renders
src/App.tsx - Application Shell → Tenant Settings: renders
src/App.tsx - Application Shell → Contract Creator: renders
src/App.tsx - Contract Creator → Document Explorer and Redlining: includes explorer
- Contract Creator → Google Gemini: uses AI workflows
- Document Explorer and Redlining → Document API: requests documents
- Express API → Document API: mounts routes
server.ts - Document API → RBAC Engine: checks permissions
src/server/documentRoutes.ts - Document API → SQLite Data: reads and writes
src/server/documentRoutes.ts - Express API → RBAC Routes: mounts routes
server.ts - RBAC Routes → RBAC Engine: delegates decisions
server/rbacRoutes.ts - Express API → Admin Console API: mounts routes
server.ts - Admin Console API → RBAC Engine: enforces access
src/server/authConsoleRoutes.ts - Admin Console API → Tenant Policy Packs: resolves settings
src/server/authConsoleRoutes.ts - Express API → SQLite Data: persists application data
server.ts - Document Parsing and OCR → SQLite Data: caches extraction
src/lib/cheapOcrPipeline.ts - Express API → Google Drive Sync: provisions folders
server.ts - Google Drive Sync → Google Drive and Sheets: synchronizes files
- Express API → Google Gemini: provides AI features
- Admin Console API → SMTP Email: sends invitations
- User → Sign-in and Session: signs in
- Organization Context → Express API: loads tenant data