# kiru6006/vetri-tvk-legal-agent architecture

> Architecture diagram of the GitHub repository kiru6006/vetri-tvk-legal-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kiru6006/vetri-tvk-legal-agent
- Repository: https://github.com/kiru6006/vetri-tvk-legal-agent

## Overview

This is a React/TypeScript executive litigation-intelligence frontend for Tamil Nadu government decision-makers. The principal workflow is to enter the executive dashboard, identify urgent or high-exposure matters, then inspect case details, hearings, departmental responsibility, and advocate preparation. Separate views cover workload, risk, reports, contacts, and classification; Vetri Copilot is a global assistant. Phase 1 uses synthetic data and a mock API, not live judicial ingestion or backend services. Edges reflect the displayed route, import, and documented relationships; other page-to-data wiring is not asserted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/App.tsx) (Client router), [`frontend/src/services/mockApi.ts`](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/services/mockApi.ts) (Mock API), [`frontend/src/components/layout/Layout.tsx`](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/layout/Layout.tsx) (Application layout), [`frontend/src/components/copilot/VetriCopilot.tsx`](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/copilot/VetriCopilot.tsx) (Vetri Copilot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application shell"]
  node_app["Client router<br/>[App.tsx]"]
  node_layout["Application layout<br/>[Layout.tsx]"]
  node_sidebar["Navigation<br/>[Sidebar.tsx]"]
  node_settings["Configuration<br/>[SettingsPage.tsx]"]
  node_copilot["Vetri Copilot<br/>[VetriCopilot.tsx]"]
end

subgraph group_command["Executive command"]
  node_dashboard["Executive dashboard<br/>[DashboardPage.tsx]"]
  node_workload["Workload exposure"]
  node_risk["Risk intelligence"]
  node_reports["Briefing reports<br/>[ReportsPage.tsx]"]
  node_notifications["Attention center"]
  node_assistant_page["Assistant page<br/>[AssistantPage.tsx]"]
end

subgraph group_litigation["Litigation operations"]
  node_calendar["Judicial calendar<br/>[CalendarPage.tsx]"]
  node_case_explorer["Case explorer"]
  node_case_detail["Case details<br/>[CaseDetailPage.tsx]"]
  node_case_types["Matter classification<br/>[CaseTypesPage.tsx]"]
  node_court_types["Court classification<br/>[CourtTypesPage.tsx]"]
  node_quick_modal["Case quick view<br/>[CaseQuickModal.tsx]"]
end

subgraph group_reference["People and jurisdiction"]
  node_departments["Departments"]
  node_department_detail["Department detail"]
  node_districts["Districts<br/>[DistrictsPage.tsx]"]
  node_advocates["Advocate preparation<br/>[AdvocatesPage.tsx]"]
  node_officials["Government officials<br/>[OfficialsPage.tsx]"]
  node_contact_modal["Official contact dossier"]
end

subgraph group_data["Synthetic data layer"]
  node_mock_api["Mock API<br/>[mockApi.ts]"]
  node_mock_cases["Synthetic case records<br/>[mockCases.ts]"]
  node_mock_dashboard["Dashboard metrics<br/>[mockDashboard.ts]"]
  node_mock_departments["Department records<br/>[mockDepartments.ts]"]
  node_mock_districts["District records<br/>[mockDistricts.ts]"]
  node_mock_advocates["Advocate records<br/>[mockAdvocates.ts]"]
  node_mock_officials["Official records<br/>[mockOfficials.ts]"]
end

node_decision_user(("CMO / senior law officers"))

node_decision_user -->|"opens platform"| node_app
node_app -->|"mounts routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_workload
node_app -->|"routes to"| node_calendar
node_app -->|"routes to"| node_case_explorer
node_app -->|"routes to"| node_case_detail
node_app -->|"routes to"| node_case_types
node_app -->|"routes to"| node_court_types
node_app -->|"routes to"| node_departments
node_app -->|"routes to"| node_department_detail
node_app -->|"routes to"| node_advocates
node_app -->|"routes to"| node_officials
node_app -->|"routes to"| node_districts
node_app -->|"routes to"| node_risk
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_assistant_page
node_app -->|"routes to"| node_notifications
node_app -->|"routes to"| node_settings
node_layout -->|"renders"| node_sidebar
node_layout -->|"renders"| node_copilot
node_copilot -->|"reads records"| node_mock_cases
node_mock_api -->|"reads records"| node_mock_cases
node_mock_api -->|"reads records"| node_mock_departments
node_mock_api -->|"reads records"| node_mock_districts
node_mock_api -->|"reads records"| node_mock_advocates
node_mock_api -->|"reads records"| node_mock_officials
node_mock_api -->|"reads metrics"| node_mock_dashboard

click node_app "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/App.tsx"
click node_layout "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/layout/Layout.tsx"
click node_sidebar "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/layout/Sidebar.tsx"
click node_dashboard "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_workload "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/WorkloadCriticalPage.tsx"
click node_risk "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/RiskIntelligencePage.tsx"
click node_reports "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/ReportsPage.tsx"
click node_notifications "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/NotificationsPage.tsx"
click node_calendar "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CalendarPage.tsx"
click node_case_explorer "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseExplorerPage.tsx"
click node_case_detail "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseDetailPage.tsx"
click node_case_types "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseTypesPage.tsx"
click node_court_types "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CourtTypesPage.tsx"
click node_departments "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DepartmentsPage.tsx"
click node_department_detail "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DepartmentDetailPage.tsx"
click node_districts "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DistrictsPage.tsx"
click node_advocates "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/AdvocatesPage.tsx"
click node_officials "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/OfficialsPage.tsx"
click node_assistant_page "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/AssistantPage.tsx"
click node_settings "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/SettingsPage.tsx"
click node_copilot "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/copilot/VetriCopilot.tsx"
click node_quick_modal "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/cases/CaseQuickModal.tsx"
click node_contact_modal "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/officials/OfficialContactModal.tsx"
click node_mock_api "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/services/mockApi.ts"
click node_mock_cases "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockCases.ts"
click node_mock_dashboard "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDashboard.ts"
click node_mock_departments "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDepartments.ts"
click node_mock_districts "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDistricts.ts"
click node_mock_advocates "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockAdvocates.ts"
click node_mock_officials "https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockOfficials.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_layout,node_sidebar,node_settings,node_copilot toneBlue
class node_dashboard,node_workload,node_risk,node_reports,node_notifications,node_assistant_page toneAmber
class node_calendar,node_case_explorer,node_case_detail,node_case_types,node_court_types,node_quick_modal toneMint
class node_departments,node_department_detail,node_districts,node_advocates,node_officials,node_contact_modal toneRose
class node_mock_api,node_mock_cases,node_mock_dashboard,node_mock_departments,node_mock_districts,node_mock_advocates,node_mock_officials,node_decision_user toneIndigo
```

## Components

### Application shell

- [Client router](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Application layout](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/layout/Layout.tsx): `frontend/src/components/layout/Layout.tsx`
- [Navigation](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/layout/Sidebar.tsx): `frontend/src/components/layout/Sidebar.tsx`
- [Configuration](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/SettingsPage.tsx): `frontend/src/pages/SettingsPage.tsx`
- [Vetri Copilot](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/copilot/VetriCopilot.tsx): `frontend/src/components/copilot/VetriCopilot.tsx`

### Executive command

- [Executive dashboard](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Workload exposure](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/WorkloadCriticalPage.tsx): `frontend/src/pages/WorkloadCriticalPage.tsx`
- [Risk intelligence](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/RiskIntelligencePage.tsx): `frontend/src/pages/RiskIntelligencePage.tsx`
- [Briefing reports](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/ReportsPage.tsx): `frontend/src/pages/ReportsPage.tsx`
- [Attention center](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/NotificationsPage.tsx): `frontend/src/pages/NotificationsPage.tsx`
- [Assistant page](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/AssistantPage.tsx): `frontend/src/pages/AssistantPage.tsx`

### Litigation operations

- [Judicial calendar](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CalendarPage.tsx): `frontend/src/pages/CalendarPage.tsx`
- [Case explorer](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseExplorerPage.tsx): `frontend/src/pages/CaseExplorerPage.tsx`
- [Case details](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseDetailPage.tsx): `frontend/src/pages/CaseDetailPage.tsx`
- [Matter classification](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CaseTypesPage.tsx): `frontend/src/pages/CaseTypesPage.tsx`
- [Court classification](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/CourtTypesPage.tsx): `frontend/src/pages/CourtTypesPage.tsx`
- [Case quick view](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/cases/CaseQuickModal.tsx): `frontend/src/components/cases/CaseQuickModal.tsx`

### People and jurisdiction

- [Departments](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DepartmentsPage.tsx): `frontend/src/pages/DepartmentsPage.tsx`
- [Department detail](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DepartmentDetailPage.tsx): `frontend/src/pages/DepartmentDetailPage.tsx`
- [Districts](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/DistrictsPage.tsx): `frontend/src/pages/DistrictsPage.tsx`
- [Advocate preparation](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/AdvocatesPage.tsx): `frontend/src/pages/AdvocatesPage.tsx`
- [Government officials](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/pages/OfficialsPage.tsx): `frontend/src/pages/OfficialsPage.tsx`
- [Official contact dossier](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/components/officials/OfficialContactModal.tsx): `frontend/src/components/officials/OfficialContactModal.tsx`

### Synthetic data layer

- [Mock API](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/services/mockApi.ts): `frontend/src/services/mockApi.ts`
- [Synthetic case records](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockCases.ts): `frontend/src/data/mockCases.ts`
- [Dashboard metrics](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDashboard.ts): `frontend/src/data/mockDashboard.ts`
- [Department records](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDepartments.ts): `frontend/src/data/mockDepartments.ts`
- [District records](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockDistricts.ts): `frontend/src/data/mockDistricts.ts`
- [Advocate records](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockAdvocates.ts): `frontend/src/data/mockAdvocates.ts`
- [Official records](https://github.com/kiru6006/vetri-tvk-legal-agent/blob/main/frontend/src/data/mockOfficials.ts): `frontend/src/data/mockOfficials.ts`

### Other components

- **CMO / senior law officers**

## Connections

- CMO / senior law officers → Client router: opens platform (evidence: `README.md`)
- Client router → Application layout: mounts routes (evidence: `frontend/src/App.tsx`)
- Client router → Executive dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Workload exposure: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Judicial calendar: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Case explorer: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Case details: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Matter classification: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Court classification: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Departments: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Department detail: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Advocate preparation: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Government officials: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Districts: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Risk intelligence: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Briefing reports: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Assistant page: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Attention center: routes to (evidence: `frontend/src/App.tsx`)
- Client router → Configuration: routes to (evidence: `frontend/src/App.tsx`)
- Application layout → Navigation: renders (evidence: `frontend/src/components/layout/Layout.tsx`)
- Application layout → Vetri Copilot: renders (evidence: `frontend/src/components/layout/Layout.tsx`)
- Vetri Copilot → Synthetic case records: reads records (evidence: `frontend/src/components/copilot/VetriCopilot.tsx`)
- Mock API → Synthetic case records: reads records (evidence: `frontend/src/services/mockApi.ts`)
- Mock API → Department records: reads records (evidence: `frontend/src/services/mockApi.ts`)
- Mock API → District records: reads records (evidence: `frontend/src/services/mockApi.ts`)
- Mock API → Advocate records: reads records (evidence: `frontend/src/services/mockApi.ts`)
- Mock API → Official records: reads records (evidence: `frontend/src/services/mockApi.ts`)
- Mock API → Dashboard metrics: reads metrics (evidence: `frontend/src/services/mockApi.ts`)
