# aadityasingh0709/bhoomisetu-sih26016 architecture

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

- Interactive diagram: https://gitdiagram.com/aadityasingh0709/bhoomisetu-sih26016
- Repository: https://github.com/aadityasingh0709/bhoomisetu-sih26016

## Overview

BhoomiSetu is a land-acquisition governance platform: officers authenticate, work within project and department scopes, track statutory progress, raise and resolve bottlenecks, and view project telemetry. Its React client calls a Node API backed by MongoDB, with a Python ML service for precedent suggestions, conversational guidance, and learning from saved resolutions. The README also documents GIS mapping, credential dispatch, and the six-stage lifecycle. Some of those capabilities are documented but their implementation paths were not sampled, so their links are shown only where documented or otherwise evidenced.

Main entry points: [`frontend/src/App.jsx`](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/App.jsx) (Application routes), [`backend/controllers/projectController.js`](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/projectController.js) (Project lifecycle), [`backend/models`](https://github.com/aadityasingh0709/bhoomisetu-sih26016/tree/main/backend/models) (Project and case records), [`backend/server.js`](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/server.js) (HTTP API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Officer workspace"]
  node_webapp["Application routes<br/>[App.jsx]"]
  node_login["Project-scoped login<br/>[LoginPage.jsx]"]
  node_session["Auth session<br/>[authStore.js]"]
  node_dashboard["Dashboard and GIS<br/>[DashboardPage.jsx]"]
  node_map["Map view<br/>[MapView.jsx]"]
  node_projects["Project workspace"]
  node_department["Department updates"]
  node_alertsui["Alerts and copilot<br/>[AlertsPage.jsx]"]
  node_projectapi["Project API client<br/>[projects.js]"]
  node_alertapi["Alert API client<br/>[alerts.js]"]
end

subgraph group_governance["Project governance"]
  node_projectctrl["Project lifecycle"]
  node_alertctrl["Bottleneck decisions<br/>[alertController.js]"]
  node_dashctrl["Progress telemetry"]
  node_notifications["Credential dispatch"]
end

subgraph group_api["API and access"]
  node_server["HTTP API server<br/>[server.js]"]
  node_auth["JWT and RBAC<br/>[auth.js]"]
  node_authroutes["Authentication endpoints<br/>[authRoutes.js]"]
  node_projectroutes["Project endpoints<br/>[projectRoutes.js]"]
end

subgraph group_records["Governance records"]
  node_records[("Project and case records")]
end

subgraph group_intelligence["AI guidance"]
  node_aiapi["AI endpoints<br/>[aiRoutes.js]"]
  node_airecs["Recommendation service"]
  node_ml["Semantic precedent engine<br/>[app.py]"]
end

node_officer(("Platform users"))
node_emailwhatsapp(("Email and WhatsApp"))

node_officer -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_login
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_projects
node_webapp -->|"routes to"| node_department
node_webapp -->|"routes to"| node_alertsui
node_login -->|"sets session"| node_session
node_dashboard -->|"renders"| node_map
node_dashboard -->|"requests data"| node_projectapi
node_projects -->|"requests data"| node_projectapi
node_department -->|"updates progress"| node_projectapi
node_alertsui -->|"requests alerts"| node_alertapi
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_projectroutes
node_server -->|"mounts"| node_aiapi
node_authroutes -->|"protects routes"| node_auth
node_projectroutes -->|"protects routes"| node_auth
node_projectroutes -->|"dispatches"| node_projectctrl
node_projectctrl -->|"reads and writes"| node_records
node_alertctrl -->|"reads and writes"| node_records
node_dashctrl -->|"reads"| node_records
node_projectctrl -->|"dispatches credentials"| node_notifications
node_notifications -.->|"sends credentials"| node_emailwhatsapp
node_aiapi -->|"calls"| node_airecs
node_airecs -->|"HTTP requests"| node_ml
node_alertsui -.->|"requests guidance"| node_aiapi
node_airecs -.->|"learns resolutions"| node_ml
node_projectctrl -->|"tracks six stages"| node_records

click node_webapp "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/auth/LoginPage.jsx"
click node_session "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/store/authStore.js"
click node_dashboard "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/dashboard/DashboardPage.jsx"
click node_map "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/components/MapView.jsx"
click node_projects "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/projects/ProjectDetailPage.jsx"
click node_department "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/department/DepartmentWorkspace.jsx"
click node_alertsui "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/alerts/AlertsPage.jsx"
click node_projectapi "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/api/projects.js"
click node_alertapi "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/api/alerts.js"
click node_server "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/server.js"
click node_auth "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/middleware/auth.js"
click node_authroutes "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/authRoutes.js"
click node_projectroutes "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/projectRoutes.js"
click node_projectctrl "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/projectController.js"
click node_alertctrl "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/alertController.js"
click node_dashctrl "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/dashboardController.js"
click node_records "https://github.com/aadityasingh0709/bhoomisetu-sih26016/tree/main/backend/models"
click node_notifications "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/services/notificationService.js"
click node_aiapi "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/aiRoutes.js"
click node_airecs "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/services/aiRecommendationService.js"
click node_ml "https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/bhoomisetu-ml-service/app.py"

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_webapp,node_login,node_session,node_dashboard,node_map,node_projects,node_department,node_alertsui,node_projectapi,node_alertapi,node_officer toneBlue
class node_projectctrl,node_alertctrl,node_dashctrl,node_notifications toneAmber
class node_server,node_auth,node_authroutes,node_projectroutes toneMint
class node_records toneRose
class node_aiapi,node_airecs,node_ml,node_emailwhatsapp toneIndigo
```

## Components

### Officer workspace

- [Application routes](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Project-scoped login](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/auth/LoginPage.jsx): `frontend/src/features/auth/LoginPage.jsx`
- [Auth session](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/store/authStore.js): `frontend/src/store/authStore.js`
- [Dashboard and GIS](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/dashboard/DashboardPage.jsx): `frontend/src/features/dashboard/DashboardPage.jsx`
- [Map view](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/components/MapView.jsx): `frontend/src/components/MapView.jsx`
- [Project workspace](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/projects/ProjectDetailPage.jsx): `frontend/src/features/projects/ProjectDetailPage.jsx`
- [Department updates](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/department/DepartmentWorkspace.jsx): `frontend/src/features/department/DepartmentWorkspace.jsx`
- [Alerts and copilot](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/features/alerts/AlertsPage.jsx): `frontend/src/features/alerts/AlertsPage.jsx`
- [Project API client](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/api/projects.js): `frontend/src/api/projects.js`
- [Alert API client](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/frontend/src/api/alerts.js): `frontend/src/api/alerts.js`

### Project governance

- [Project lifecycle](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/projectController.js): `backend/controllers/projectController.js`
- [Bottleneck decisions](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/alertController.js): `backend/controllers/alertController.js`
- [Progress telemetry](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/controllers/dashboardController.js): `backend/controllers/dashboardController.js`
- [Credential dispatch](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/services/notificationService.js): `backend/services/notificationService.js`

### API and access

- [HTTP API server](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/server.js): `backend/server.js`
- [JWT and RBAC](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Authentication endpoints](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Project endpoints](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/projectRoutes.js): `backend/routes/projectRoutes.js`

### Governance records

- [Project and case records](https://github.com/aadityasingh0709/bhoomisetu-sih26016/tree/main/backend/models): `backend/models`

### AI guidance

- [AI endpoints](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/routes/aiRoutes.js): `backend/routes/aiRoutes.js`
- [Recommendation service](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/backend/services/aiRecommendationService.js): `backend/services/aiRecommendationService.js`
- [Semantic precedent engine](https://github.com/aadityasingh0709/bhoomisetu-sih26016/blob/main/bhoomisetu-ml-service/app.py): `bhoomisetu-ml-service/app.py`

### Other components

- **Platform users**
- **Email and WhatsApp**

## Connections

- Platform users → Application routes: uses (evidence: `README.md`)
- Application routes → Project-scoped login: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Dashboard and GIS: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Project workspace: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Department updates: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Alerts and copilot: routes to (evidence: `frontend/src/App.jsx`)
- Project-scoped login → Auth session: sets session (evidence: `frontend/src/features/auth/LoginPage.jsx`)
- Dashboard and GIS → Map view: renders (evidence: `frontend/src/features/dashboard/DashboardPage.jsx`)
- Dashboard and GIS → Project API client: requests data (evidence: `frontend/src/features/dashboard/DashboardPage.jsx`)
- Project workspace → Project API client: requests data (evidence: `frontend/src/features/projects/ProjectDetailPage.jsx`)
- Department updates → Project API client: updates progress (evidence: `frontend/src/features/department/DepartmentWorkspace.jsx`)
- Alerts and copilot → Alert API client: requests alerts (evidence: `frontend/src/features/alerts/AlertsPage.jsx`)
- HTTP API server → Authentication endpoints: mounts (evidence: `backend/server.js`)
- HTTP API server → Project endpoints: mounts (evidence: `backend/server.js`)
- HTTP API server → AI endpoints: mounts (evidence: `backend/server.js`)
- Authentication endpoints → JWT and RBAC: protects routes (evidence: `backend/routes/authRoutes.js`)
- Project endpoints → JWT and RBAC: protects routes (evidence: `backend/routes/projectRoutes.js`)
- Project endpoints → Project lifecycle: dispatches (evidence: `backend/routes/projectRoutes.js`)
- Project lifecycle → Project and case records: reads and writes (evidence: `backend/controllers/projectController.js`)
- Bottleneck decisions → Project and case records: reads and writes (evidence: `backend/controllers/alertController.js`)
- Progress telemetry → Project and case records: reads (evidence: `backend/controllers/dashboardController.js`)
- Project lifecycle → Credential dispatch: dispatches credentials (evidence: `backend/controllers/projectController.js`)
- Credential dispatch → Email and WhatsApp: sends credentials (evidence: `README.md`)
- AI endpoints → Recommendation service: calls (evidence: `backend/routes/aiRoutes.js`)
- Recommendation service → Semantic precedent engine: HTTP requests (evidence: `backend/services/aiRecommendationService.js`)
- Alerts and copilot → AI endpoints: requests guidance (evidence: `README.md`)
- Recommendation service → Semantic precedent engine: learns resolutions (evidence: `backend/services/aiRecommendationService.js`)
- Project lifecycle → Project and case records: tracks six stages (evidence: `backend/models/Project.js`)
