# toijam-ghanashyam/drishti architecture

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

- Interactive diagram: https://gitdiagram.com/toijam-ghanashyam/drishti
- Repository: https://github.com/toijam-ghanashyam/drishti

## Overview

This repository combines a cadastral land-record platform with separate conflict-clustering, boundary-consensus, and evidence-ledger services. The principal workflow is importing land data, analyzing spatial conflicts, and presenting records and review tools in a dashboard; the landing page describes confidence scoring, human review, and harmonized records. Source excerpts do not establish how the main API wires those stages together, so those links are omitted. The frontend also depicts NRSC/STAC synchronization, but its excerpt simulates the result. Several backend capabilities are represented only by the file tree.

Main entry points: [`frontend/src/App.jsx`](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/App.jsx) (Dashboard router), [`boundary_consensus/consensus/orchestrator.py`](https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/orchestrator.py) (Resolution orchestrator), [`api.py`](https://github.com/toijam-ghanashyam/drishti/blob/main/api.py) (Platform API), [`frontend/src/components/dashboard/IngestionHub.jsx`](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/components/dashboard/IngestionHub.jsx) (File upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard and review"]
  node_dashboard_app["Dashboard router<br/>[App.jsx]"]
  node_ingestion_page["Ingestion hub<br/>[IngestionPage.jsx]"]
  node_upload_widget["File upload<br/>[IngestionHub.jsx]"]
  node_map_page["Map view<br/>[MapPage.jsx]"]
  node_analytics_page["Analytics<br/>[AnalyticsPage.jsx]"]
  node_records_page["Land records<br/>[RecordsPage.jsx]"]
  node_conflicts_page["Conflict review<br/>[ConflictsPage.jsx]"]
end

subgraph group_spatial["Spatial data processing"]
  node_api["Platform API<br/>[api.py]"]
  node_ingest["Shapefile ingestion<br/>[ingest.py]"]
  node_conflict_engine["Spatial conflict engine<br/>[conflict_engine.py]"]
  node_postgis[("Spatial database")]
end

subgraph group_clustering["Conflict analysis"]
  node_clustering_api["Clustering API<br/>[app.py]"]
  node_clustering_engine["Conflict clustering"]
  node_cause_analyzer["Cause analysis<br/>[cause_analyzer.py]"]
end

subgraph group_consensus["Boundary resolution"]
  node_consensus_adapter["Consensus adapter<br/>[adapter.py]"]
  node_consensus_orchestrator["Resolution orchestrator<br/>[orchestrator.py]"]
  node_stakeholder_agents["Stakeholder agents"]
  node_auction["Proposal auction<br/>[auction.py]"]
  node_payoffs["Consensus scoring<br/>[game_theory.py]"]
end

subgraph group_ledger["Evidence ledger"]
  node_ledger_api["Ledger API<br/>[app.py]"]
  node_ledger_logic["Ledger operations<br/>[ledger.py]"]
  node_commitment["Commitment generation<br/>[commitment.py]"]
  node_proof["Proof utilities<br/>[proof.py]"]
  node_ledger_files[("Ledger and audit files")]
end

node_land_user(("Land-data user"))

node_land_user -->|"uses"| node_dashboard_app
node_dashboard_app -->|"routes to"| node_ingestion_page
node_dashboard_app -->|"routes to"| node_map_page
node_dashboard_app -->|"routes to"| node_analytics_page
node_dashboard_app -->|"routes to"| node_records_page
node_dashboard_app -->|"routes to"| node_conflicts_page
node_ingestion_page -->|"requests audit logs"| node_api
node_upload_widget -->|"uploads files"| node_api
node_upload_widget -->|"requests conflict run"| node_api
node_ingest -->|"loads plots"| node_postgis
node_conflict_engine -->|"reads and writes"| node_postgis
node_clustering_api -->|"clusters conflicts"| node_clustering_engine
node_clustering_engine -->|"analyzes groups"| node_cause_analyzer
node_consensus_adapter -->|"delegates resolution"| node_consensus_orchestrator
node_consensus_orchestrator -->|"requests proposals"| node_stakeholder_agents
node_consensus_orchestrator -->|"selects winner"| node_auction
node_consensus_orchestrator -->|"scores proposals"| node_payoffs
node_ledger_api -->|"reads and writes"| node_ledger_files
node_ledger_api -->|"generates commitment"| node_commitment

click node_dashboard_app "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/App.jsx"
click node_ingestion_page "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/IngestionPage.jsx"
click node_upload_widget "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/components/dashboard/IngestionHub.jsx"
click node_map_page "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/MapPage.jsx"
click node_analytics_page "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/AnalyticsPage.jsx"
click node_records_page "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/RecordsPage.jsx"
click node_conflicts_page "https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/ConflictsPage.jsx"
click node_api "https://github.com/toijam-ghanashyam/drishti/blob/main/api.py"
click node_ingest "https://github.com/toijam-ghanashyam/drishti/blob/main/ingest.py"
click node_conflict_engine "https://github.com/toijam-ghanashyam/drishti/blob/main/conflict_engine.py"
click node_clustering_api "https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/app.py"
click node_clustering_engine "https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/clustering_engine.py"
click node_cause_analyzer "https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/cause_analyzer.py"
click node_consensus_adapter "https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/adapter.py"
click node_consensus_orchestrator "https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/orchestrator.py"
click node_stakeholder_agents "https://github.com/toijam-ghanashyam/drishti/tree/main/boundary_consensus/agents"
click node_auction "https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/auction.py"
click node_payoffs "https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/game_theory.py"
click node_ledger_api "https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/app.py"
click node_ledger_logic "https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/ledger.py"
click node_commitment "https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/commitment.py"
click node_proof "https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-zk/proof.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_dashboard_app,node_ingestion_page,node_upload_widget,node_map_page,node_analytics_page,node_records_page,node_conflicts_page,node_land_user toneBlue
class node_api,node_ingest,node_conflict_engine,node_postgis toneAmber
class node_clustering_api,node_clustering_engine,node_cause_analyzer toneMint
class node_consensus_adapter,node_consensus_orchestrator,node_stakeholder_agents,node_auction,node_payoffs toneRose
class node_ledger_api,node_ledger_logic,node_commitment,node_proof,node_ledger_files toneIndigo
```

## Components

### Dashboard and review

- [Dashboard router](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Ingestion hub](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/IngestionPage.jsx): `frontend/src/pages/dashboard/IngestionPage.jsx`
- [File upload](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/components/dashboard/IngestionHub.jsx): `frontend/src/components/dashboard/IngestionHub.jsx`
- [Map view](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/MapPage.jsx): `frontend/src/pages/dashboard/MapPage.jsx`
- [Analytics](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/AnalyticsPage.jsx): `frontend/src/pages/dashboard/AnalyticsPage.jsx`
- [Land records](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/RecordsPage.jsx): `frontend/src/pages/dashboard/RecordsPage.jsx`
- [Conflict review](https://github.com/toijam-ghanashyam/drishti/blob/main/frontend/src/pages/dashboard/ConflictsPage.jsx): `frontend/src/pages/dashboard/ConflictsPage.jsx`

### Spatial data processing

- [Platform API](https://github.com/toijam-ghanashyam/drishti/blob/main/api.py): `api.py`
- [Shapefile ingestion](https://github.com/toijam-ghanashyam/drishti/blob/main/ingest.py): `ingest.py`
- [Spatial conflict engine](https://github.com/toijam-ghanashyam/drishti/blob/main/conflict_engine.py): `conflict_engine.py`
- **Spatial database**

### Conflict analysis

- [Clustering API](https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/app.py): `conflict-clustering-service/app.py`
- [Conflict clustering](https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/clustering_engine.py): `conflict-clustering-service/clustering_engine.py`
- [Cause analysis](https://github.com/toijam-ghanashyam/drishti/blob/main/conflict-clustering-service/cause_analyzer.py): `conflict-clustering-service/cause_analyzer.py`

### Boundary resolution

- [Consensus adapter](https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/adapter.py): `boundary_consensus/adapter.py`
- [Resolution orchestrator](https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/orchestrator.py): `boundary_consensus/consensus/orchestrator.py`
- [Stakeholder agents](https://github.com/toijam-ghanashyam/drishti/tree/main/boundary_consensus/agents): `boundary_consensus/agents`
- [Proposal auction](https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/auction.py): `boundary_consensus/consensus/auction.py`
- [Consensus scoring](https://github.com/toijam-ghanashyam/drishti/blob/main/boundary_consensus/consensus/game_theory.py): `boundary_consensus/consensus/game_theory.py`

### Evidence ledger

- [Ledger API](https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/app.py): `spatial-evidence-ledger-backend/app.py`
- [Ledger operations](https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/ledger.py): `spatial-evidence-ledger-backend/ledger.py`
- [Commitment generation](https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-backend/commitment.py): `spatial-evidence-ledger-backend/commitment.py`
- [Proof utilities](https://github.com/toijam-ghanashyam/drishti/blob/main/spatial-evidence-ledger-zk/proof.py): `spatial-evidence-ledger-zk/proof.py`
- **Ledger and audit files**

### Other components

- **Land-data user**

## Connections

- Land-data user → Dashboard router: uses
- Dashboard router → Ingestion hub: routes to
- Dashboard router → Map view: routes to
- Dashboard router → Analytics: routes to
- Dashboard router → Land records: routes to
- Dashboard router → Conflict review: routes to
- Ingestion hub → Platform API: requests audit logs
- File upload → Platform API: uploads files
- File upload → Platform API: requests conflict run
- Shapefile ingestion → Spatial database: loads plots
- Spatial conflict engine → Spatial database: reads and writes
- Clustering API → Conflict clustering: clusters conflicts
- Conflict clustering → Cause analysis: analyzes groups
- Consensus adapter → Resolution orchestrator: delegates resolution
- Resolution orchestrator → Stakeholder agents: requests proposals
- Resolution orchestrator → Proposal auction: selects winner
- Resolution orchestrator → Consensus scoring: scores proposals
- Ledger API → Ledger and audit files: reads and writes
- Ledger API → Commitment generation: generates commitment
