# nikhilpandey-tech/bhoominetra architecture

> Architecture diagram of the GitHub repository nikhilpandey-tech/bhoominetra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nikhilpandey-tech/bhoominetra
- Repository: https://github.com/nikhilpandey-tech/bhoominetra

## Overview

BhoomiNetra is a land-acquisition monitoring and decision-support application. Users sign in, review projects and their predicted delay risk, then use explanations, recommendations, simulations, alerts, maps, and reports to guide follow-up. The frontend talks to a FastAPI backend; its ML service calls a separate prediction/explanation service. A separate training pipeline builds model artifacts. The README is empty, and most route and page implementations were not sampled, so those links are limited to documented capabilities and visible entry points.

Main entry points: [`backend/app/main.py`](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/main.py) (FastAPI application), [`ml/src/train_pipeline.py`](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/train_pipeline.py) (Train pipeline), [`Frontend/src/App.jsx`](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/App.jsx) (App shell), [`backend/app/database/database.py`](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/database/database.py) (Relational database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_web["BhoomiNetra UI<br/>[main.jsx]"]
  node_app["App shell<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_project_pages["Project views<br/>[projects.jsx]"]
  node_decision_pages["Decision views<br/>[risk-analysis.jsx]"]
end

subgraph group_api["Application API"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_project_routes["Project routes<br/>[projects.py]"]
  node_prediction_routes["Prediction routes<br/>[predictions.py]"]
  node_decision_routes["Decision services<br/>[recommendations.py]"]
  node_other_routes["Operations routes"]
  node_models["Domain records"]
  node_db[("Relational database<br/>[database.py]")]
  node_ml_adapter["ML adapter<br/>[ml_service.py]"]
end

subgraph group_mlruntime["ML runtime"]
  node_ml_service["Prediction service<br/>[app.py]"]
  node_model_artifacts["Model artifacts<br/>[app.py]"]
end

subgraph group_training["Model training"]
  node_training_entry["Training entry<br/>[run_pipeline.py]"]
  node_training_pipeline["Train pipeline<br/>[train_pipeline.py]"]
  node_ml_audit["Data audit<br/>[data_audit.py]"]
  node_ml_selection["Model experiments<br/>[model_selection.py]"]
  node_ml_explain["SHAP explainability<br/>[explainability.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -->|"routes to"| node_app
node_app -->|"requests"| node_api_client
node_app -->|"shows"| node_project_pages
node_app -->|"shows"| node_decision_pages
node_api_client -->|"HTTP requests"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_project_routes
node_api_app -->|"mounts"| node_prediction_routes
node_api_app -->|"mounts"| node_decision_routes
node_api_app -->|"mounts"| node_other_routes
node_auth_routes -->|"queries, writes"| node_db
node_project_routes -->|"database access"| node_db
node_prediction_routes -->|"prediction calls"| node_ml_adapter
node_decision_routes -->|"database access"| node_db
node_db -->|"persists"| node_models
node_ml_adapter -->|"HTTP calls"| node_ml_service
node_ml_service -->|"loads"| node_model_artifacts
node_training_entry -->|"runs"| node_training_pipeline
node_training_pipeline -->|"audits data"| node_ml_audit
node_training_pipeline -->|"runs experiments"| node_ml_selection
node_training_pipeline -.->|"generates SHAP"| node_ml_explain
node_training_pipeline -->|"writes models"| node_model_artifacts

click node_web "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/main.jsx"
click node_app "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/App.jsx"
click node_api_client "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/lib/api.js"
click node_project_pages "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/pages/projects.jsx"
click node_decision_pages "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/pages/risk-analysis.jsx"
click node_api_app "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/auth.py"
click node_project_routes "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/projects.py"
click node_prediction_routes "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/predictions.py"
click node_decision_routes "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/recommendations.py"
click node_other_routes "https://github.com/nikhilpandey-tech/bhoominetra/tree/main/backend/app/routes"
click node_models "https://github.com/nikhilpandey-tech/bhoominetra/tree/main/backend/app/models"
click node_db "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/database/database.py"
click node_ml_adapter "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/services/ml_service.py"
click node_ml_service "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/app.py"
click node_training_entry "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/run_pipeline.py"
click node_training_pipeline "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/train_pipeline.py"
click node_ml_audit "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/data_audit.py"
click node_ml_selection "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/model_selection.py"
click node_ml_explain "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/explainability.py"
click node_model_artifacts "https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/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_web,node_app,node_api_client,node_project_pages,node_decision_pages,node_user toneBlue
class node_api_app,node_auth_routes,node_project_routes,node_prediction_routes,node_decision_routes,node_other_routes,node_models,node_db,node_ml_adapter toneAmber
class node_ml_service,node_model_artifacts toneMint
class node_training_entry,node_training_pipeline,node_ml_audit,node_ml_selection,node_ml_explain toneRose
```

## Components

### User interface

- [BhoomiNetra UI](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/main.jsx): `Frontend/src/main.jsx`
- [App shell](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [API client](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/lib/api.js): `Frontend/src/lib/api.js`
- [Project views](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/pages/projects.jsx): `Frontend/src/pages/projects.jsx`
- [Decision views](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/Frontend/src/pages/risk-analysis.jsx): `Frontend/src/pages/risk-analysis.jsx`

### Application API

- [FastAPI application](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Project routes](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/projects.py): `backend/app/routes/projects.py`
- [Prediction routes](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/predictions.py): `backend/app/routes/predictions.py`
- [Decision services](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/routes/recommendations.py): `backend/app/routes/recommendations.py`
- [Operations routes](https://github.com/nikhilpandey-tech/bhoominetra/tree/main/backend/app/routes): `backend/app/routes`
- [Domain records](https://github.com/nikhilpandey-tech/bhoominetra/tree/main/backend/app/models): `backend/app/models`
- [Relational database](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/database/database.py): `backend/app/database/database.py`
- [ML adapter](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/backend/app/services/ml_service.py): `backend/app/services/ml_service.py`

### ML runtime

- [Prediction service](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/app.py): `ml/app.py`
- [Model artifacts](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/app.py): `ml/app.py`

### Model training

- [Training entry](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/run_pipeline.py): `ml/run_pipeline.py`
- [Train pipeline](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/train_pipeline.py): `ml/src/train_pipeline.py`
- [Data audit](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/data_audit.py): `ml/src/data_audit.py`
- [Model experiments](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/model_selection.py): `ml/src/model_selection.py`
- [SHAP explainability](https://github.com/nikhilpandey-tech/bhoominetra/blob/main/ml/src/explainability.py): `ml/src/explainability.py`

### Other components

- **User**

## Connections

- User → BhoomiNetra UI: uses
- BhoomiNetra UI → App shell: routes to
- App shell → API client: requests
- App shell → Project views: shows
- App shell → Decision views: shows
- API client → FastAPI application: HTTP requests
- FastAPI application → Authentication: mounts
- FastAPI application → Project routes: mounts
- FastAPI application → Prediction routes: mounts
- FastAPI application → Decision services: mounts
- FastAPI application → Operations routes: mounts
- Authentication → Relational database: queries, writes
- Project routes → Relational database: database access
- Prediction routes → ML adapter: prediction calls
- Decision services → Relational database: database access
- Relational database → Domain records: persists
- ML adapter → Prediction service: HTTP calls
- Prediction service → Model artifacts: loads
- Training entry → Train pipeline: runs
- Train pipeline → Data audit: audits data
- Train pipeline → Model experiments: runs experiments
- Train pipeline → SHAP explainability: generates SHAP
- Train pipeline → Model artifacts: writes models
