# bhavyasoni21/bhoomisetu architecture

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

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

## Overview

BhoomiSetu is a parcel-centric land-governance platform: citizens search parcels and submit requests; officers and verifiers review cases, collect evidence, and act on shared parcel records; administrators configure workflows and oversee governance. The graph preserves the documented GIS, records, workflow, AI, imagery, multilingual, and offline capabilities. Some subsystem links are based on README descriptions and the file tree; unsampled implementations are not expanded into speculative call chains.

Main entry points: [`frontend/src/App.tsx`](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/App.tsx) (Portal application), [`frontend/src/services/apiService.ts`](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/services/apiService.ts) (API client), [`backend-py/app/main.py`](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/main.py) (FastAPI application), [`frontend/src/pages/CitizenPortal.tsx`](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/CitizenPortal.tsx) (Citizen portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_spa["Portal application<br/>[App.tsx]"]
  node_citizen_portal["Citizen portal<br/>[CitizenPortal.tsx]"]
  node_officer_portal["Officer portal<br/>[OfficerPortal.tsx]"]
  node_verifier_portal["Verifier portal<br/>[VerifierPortal.tsx]"]
  node_admin_portal["Admin portal<br/>[AdminPortal.tsx]"]
  node_offline_sync["Offline evidence sync"]
end

subgraph group_domain["Land services"]
  node_parcel_ui["Parcel search and view<br/>[Parcel360View.tsx]"]
  node_map_ui["GIS map<br/>[MapComponent.tsx]"]
  node_change_ui["Change detection"]
  node_ai_ui["AI assistant<br/>[ai-chat.tsx]"]
  node_language["Language support"]
  node_change_service["Change analysis"]
end

subgraph group_workflow["Case workflows"]
  node_workflow_service["Workflow service"]
end

subgraph group_platform["API and persistence"]
  node_api_client["API client<br/>[apiService.ts]"]
  node_app_entry["FastAPI application<br/>[main.py]"]
  node_parcel_routes["Parcel and GIS routes<br/>[parcels.py]"]
  node_workflow_routes["Workflow routes<br/>[workflows.py]"]
  node_ai_routes["AI routes<br/>[ai.py]"]
  node_imagery_routes["Imagery routes"]
  node_database[("PostGIS database<br/>[database.py]")]
end

subgraph group_integrations["External integrations"]
  node_earth_engine["Satellite imagery"]
  node_task_worker["Imagery task worker"]
  node_storage["Document storage"]
  node_supabase[("Supabase Storage")]
  node_gee["Google Earth Engine"]
  node_bhashini_service["Bhashini language service<br/>[bhashini.py]"]
end

node_citizens(("Citizens"))
node_officers(("Officers"))
node_verifiers(("Field verifiers"))
node_admins(("Administrators"))

node_citizens -->|"use portal"| node_spa
node_officers -->|"use portal"| node_spa
node_verifiers -->|"use portal"| node_spa
node_admins -->|"use portal"| node_spa
node_spa -->|"routes to"| node_citizen_portal
node_spa -->|"routes to"| node_officer_portal
node_spa -->|"routes to"| node_verifier_portal
node_spa -->|"routes to"| node_admin_portal
node_citizen_portal -->|"presents"| node_parcel_ui
node_officer_portal -->|"presents"| node_map_ui
node_officer_portal -->|"presents"| node_change_ui
node_citizen_portal -->|"offers assistance"| node_ai_ui
node_verifier_portal -->|"queues evidence"| node_offline_sync
node_offline_sync -->|"replays evidence"| node_api_client
node_parcel_ui -->|"requests parcel data"| node_api_client
node_map_ui -->|"requests map data"| node_api_client
node_change_ui -->|"requests analysis"| node_api_client
node_ai_ui -->|"sends queries"| node_api_client
node_spa -->|"selects language"| node_language
node_api_client -->|"sends API requests"| node_app_entry
node_app_entry -->|"mounts routes"| node_parcel_routes
node_app_entry -->|"mounts routes"| node_workflow_routes
node_app_entry -->|"mounts routes"| node_ai_routes
node_app_entry -->|"mounts routes"| node_imagery_routes
node_parcel_routes -->|"reads parcel data"| node_database
node_workflow_routes -->|"delegates workflow"| node_workflow_service
node_workflow_service -->|"persists workflow"| node_database
node_workflow_routes -->|"stores evidence"| node_storage
node_storage -.->|"uploads and downloads"| node_supabase
node_imagery_routes -->|"analyzes images"| node_change_service
node_imagery_routes -->|"fetches satellite imagery"| node_earth_engine
node_earth_engine -->|"queries imagery"| node_gee
node_task_worker -->|"fetches imagery"| node_earth_engine
node_task_worker -->|"updates job status"| node_database
node_ai_routes -.->|"translates text"| node_bhashini_service

click node_spa "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/App.tsx"
click node_citizen_portal "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/CitizenPortal.tsx"
click node_officer_portal "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/OfficerPortal.tsx"
click node_verifier_portal "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/VerifierPortal.tsx"
click node_admin_portal "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/AdminPortal.tsx"
click node_offline_sync "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/services/verifierLocalSyncService.ts"
click node_parcel_ui "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/parcels/Parcel360View.tsx"
click node_map_ui "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/map/MapComponent.tsx"
click node_change_ui "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/change-detection/ChangeDetectionPanel.tsx"
click node_ai_ui "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/components/ai/ai-chat.tsx"
click node_language "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/context/LanguageContext.tsx"
click node_api_client "https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/services/apiService.ts"
click node_app_entry "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/main.py"
click node_parcel_routes "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/parcels.py"
click node_workflow_routes "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/workflows.py"
click node_ai_routes "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/ai.py"
click node_imagery_routes "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/change_detection.py"
click node_workflow_service "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/workflows_service.py"
click node_change_service "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/change_detection_service.py"
click node_earth_engine "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/earth_engine_service.py"
click node_task_worker "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/tasks/earth_engine_tasks.py"
click node_database "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/database.py"
click node_storage "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/common/supabase_storage.py"
click node_bhashini_service "https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/bhashini.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_spa,node_citizen_portal,node_officer_portal,node_verifier_portal,node_admin_portal,node_offline_sync toneBlue
class node_parcel_ui,node_map_ui,node_change_ui,node_ai_ui,node_language,node_change_service toneAmber
class node_workflow_service toneMint
class node_api_client,node_app_entry,node_parcel_routes,node_workflow_routes,node_ai_routes,node_imagery_routes,node_database toneRose
class node_earth_engine,node_task_worker,node_storage,node_supabase,node_gee,node_bhashini_service,node_citizens,node_officers,node_verifiers,node_admins toneIndigo
```

## Components

### User experience

- [Portal application](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Citizen portal](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/CitizenPortal.tsx): `frontend/src/pages/CitizenPortal.tsx`
- [Officer portal](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/OfficerPortal.tsx): `frontend/src/pages/OfficerPortal.tsx`
- [Verifier portal](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/VerifierPortal.tsx): `frontend/src/pages/VerifierPortal.tsx`
- [Admin portal](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/pages/AdminPortal.tsx): `frontend/src/pages/AdminPortal.tsx`
- [Offline evidence sync](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/services/verifierLocalSyncService.ts): `frontend/src/services/verifierLocalSyncService.ts`

### Land services

- [Parcel search and view](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/parcels/Parcel360View.tsx): `frontend/src/features/parcels/Parcel360View.tsx`
- [GIS map](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/map/MapComponent.tsx): `frontend/src/features/map/MapComponent.tsx`
- [Change detection](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/features/change-detection/ChangeDetectionPanel.tsx): `frontend/src/features/change-detection/ChangeDetectionPanel.tsx`
- [AI assistant](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/components/ai/ai-chat.tsx): `frontend/src/components/ai/ai-chat.tsx`
- [Language support](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/context/LanguageContext.tsx): `frontend/src/context/LanguageContext.tsx`
- [Change analysis](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/change_detection_service.py): `backend-py/app/services/change_detection_service.py`

### Case workflows

- [Workflow service](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/workflows_service.py): `backend-py/app/services/workflows_service.py`

### API and persistence

- [API client](https://github.com/bhavyasoni21/bhoomisetu/blob/main/frontend/src/services/apiService.ts): `frontend/src/services/apiService.ts`
- [FastAPI application](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/main.py): `backend-py/app/main.py`
- [Parcel and GIS routes](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/parcels.py): `backend-py/app/routers/parcels.py`
- [Workflow routes](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/workflows.py): `backend-py/app/routers/workflows.py`
- [AI routes](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/ai.py): `backend-py/app/routers/ai.py`
- [Imagery routes](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/routers/change_detection.py): `backend-py/app/routers/change_detection.py`
- [PostGIS database](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/database.py): `backend-py/app/database.py`

### External integrations

- [Satellite imagery](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/earth_engine_service.py): `backend-py/app/services/earth_engine_service.py`
- [Imagery task worker](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/tasks/earth_engine_tasks.py): `backend-py/app/tasks/earth_engine_tasks.py`
- [Document storage](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/common/supabase_storage.py): `backend-py/app/common/supabase_storage.py`
- **Supabase Storage**
- **Google Earth Engine**
- [Bhashini language service](https://github.com/bhavyasoni21/bhoomisetu/blob/main/backend-py/app/services/bhashini.py): `backend-py/app/services/bhashini.py`

### Other components

- **Citizens**
- **Officers**
- **Field verifiers**
- **Administrators**

## Connections

- Citizens → Portal application: use portal
- Officers → Portal application: use portal
- Field verifiers → Portal application: use portal
- Administrators → Portal application: use portal
- Portal application → Citizen portal: routes to
- Portal application → Officer portal: routes to
- Portal application → Verifier portal: routes to
- Portal application → Admin portal: routes to
- Citizen portal → Parcel search and view: presents
- Officer portal → GIS map: presents
- Officer portal → Change detection: presents
- Citizen portal → AI assistant: offers assistance
- Verifier portal → Offline evidence sync: queues evidence
- Offline evidence sync → API client: replays evidence
- Parcel search and view → API client: requests parcel data
- GIS map → API client: requests map data
- Change detection → API client: requests analysis
- AI assistant → API client: sends queries
- Portal application → Language support: selects language
- API client → FastAPI application: sends API requests
- FastAPI application → Parcel and GIS routes: mounts routes
- FastAPI application → Workflow routes: mounts routes
- FastAPI application → AI routes: mounts routes
- FastAPI application → Imagery routes: mounts routes
- Parcel and GIS routes → PostGIS database: reads parcel data
- Workflow routes → Workflow service: delegates workflow
- Workflow service → PostGIS database: persists workflow
- Workflow routes → Document storage: stores evidence
- Document storage → Supabase Storage: uploads and downloads
- Imagery routes → Change analysis: analyzes images
- Imagery routes → Satellite imagery: fetches satellite imagery
- Satellite imagery → Google Earth Engine: queries imagery
- Imagery task worker → Satellite imagery: fetches imagery
- Imagery task worker → PostGIS database: updates job status
- AI routes → Bhashini language service: translates text
