# eshwarhs170-a11y/gramsetu architecture

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

- Interactive diagram: https://gitdiagram.com/eshwarhs170-a11y/gramsetu
- Repository: https://github.com/eshwarhs170-a11y/gramsetu

## Overview

GramSetu is a Karnataka civic and farmer-services portal. Citizens enter through the public site, sign in, and use a location-aware dashboard for schemes, market information, weather, crop diagnosis, inquiries, and grievances; officials use a separate dashboard to manage cases. The graph includes documented product branches even where their implementation was not sampled. Edges reflect excerpts, the source index, or README statements; unsampled subsystem links are omitted rather than inferred.

Main entry points: [`src/App.jsx`](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/App.jsx) (Route dispatcher), [`src/pages/VillagerDashboard.jsx`](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/VillagerDashboard.jsx) (Citizen dashboard), [`src/components/CropScanner.jsx`](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/CropScanner.jsx) (Crop disease scanner), [`src/pages/OfficialDashboard.jsx`](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/OfficialDashboard.jsx) (Official case hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access &amp; navigation"]
  node_app["Route dispatcher<br/>[App.jsx]"]
  node_landing["Public landing<br/>[LandingPage.jsx]"]
  node_districts["District explorer<br/>[DistrictPage.jsx]"]
end

subgraph group_citizen["Citizen services"]
  node_citizen_login["Citizen login<br/>[VillagerLogin.jsx]"]
  node_citizen_dashboard["Citizen dashboard"]
  node_citizen_features["Citizen service screens"]
  node_crop_scanner["Crop disease scanner<br/>[CropScanner.jsx]"]
  node_inquiry["Farmer helpdesk"]
end

subgraph group_official["Administration"]
  node_official_login["Official login<br/>[OfficialLogin.jsx]"]
  node_official_dashboard["Official case hub"]
  node_escalation["Grievance escalation<br/>[escalation.js]"]
end

subgraph group_shared["Shared capabilities"]
  node_voice_ui["Voice assistant widget"]
  node_voice_context["Speech context<br/>[VoiceContext.jsx]"]
  node_voice_commands["Voice and AI services<br/>[voiceCommands.js]"]
  node_crop_knowledge["Crop disease data"]
  node_schemes["Schemes catalogue<br/>[schemesData.js]"]
  node_market["APMC price feeds<br/>[fetchPrices.js]"]
  node_weather["Weather advisories<br/>[fetchWeather.js]"]
end

subgraph group_platform["Data &amp; integrations"]
  node_firebase_client["Firebase client<br/>[firebase.js]"]
  node_firestore[("Firestore")]
  node_gemini["Google Gemini"]
  node_speech_api["Browser speech APIs"]
end

node_citizen_actor(("Rural citizens"))
node_official_actor(("Government officials"))

node_citizen_actor -->|"opens portal"| node_app
node_official_actor -->|"opens portal"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_districts
node_app -->|"routes to"| node_citizen_login
node_app -->|"routes to"| node_citizen_dashboard
node_app -->|"routes to"| node_official_login
node_app -->|"routes to"| node_official_dashboard
node_citizen_dashboard -->|"offers diagnosis"| node_crop_scanner
node_citizen_dashboard -->|"offers helpdesk"| node_inquiry
node_inquiry -->|"writes inquiries"| node_firebase_client
node_official_dashboard -->|"updates inquiries"| node_firebase_client
node_firebase_client -->|"connects to"| node_firestore
node_official_dashboard -->|"uses escalation"| node_escalation
node_citizen_dashboard -->|"loads prices"| node_market
node_citizen_dashboard -->|"offers forecasts"| node_weather
node_citizen_dashboard -->|"browses schemes"| node_schemes
node_crop_scanner -->|"requests AI analysis"| node_voice_commands
node_crop_scanner -->|"uses disease data"| node_crop_knowledge
node_voice_ui -->|"uses speech state"| node_voice_context
node_voice_context -->|"recognizes and speaks"| node_speech_api
node_voice_commands -->|"requests AI"| node_gemini
node_landing -->|"opens helpdesk"| node_inquiry

click node_app "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/App.jsx"
click node_landing "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/LandingPage.jsx"
click node_districts "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/DistrictPage.jsx"
click node_citizen_login "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/VillagerLogin.jsx"
click node_citizen_dashboard "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/VillagerDashboard.jsx"
click node_citizen_features "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/VillagerScreens.jsx"
click node_crop_scanner "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/CropScanner.jsx"
click node_inquiry "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/FarmerInquiryModal.jsx"
click node_official_login "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/OfficialLogin.jsx"
click node_official_dashboard "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/OfficialDashboard.jsx"
click node_escalation "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/escalation.js"
click node_voice_ui "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/VoiceAssistantWidget.jsx"
click node_voice_context "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/context/VoiceContext.jsx"
click node_voice_commands "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/voiceCommands.js"
click node_crop_knowledge "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/data/cropDiseasesData.js"
click node_schemes "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/data/schemesData.js"
click node_market "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/fetchPrices.js"
click node_weather "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/fetchWeather.js"
click node_firebase_client "https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/firebase.js"

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_landing,node_districts toneBlue
class node_citizen_login,node_citizen_dashboard,node_citizen_features,node_crop_scanner,node_inquiry toneAmber
class node_official_login,node_official_dashboard,node_escalation toneMint
class node_voice_ui,node_voice_context,node_voice_commands,node_crop_knowledge,node_schemes,node_market,node_weather toneRose
class node_firebase_client,node_firestore,node_gemini,node_speech_api,node_citizen_actor,node_official_actor toneIndigo
```

## Components

### Access & navigation

- [Route dispatcher](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/App.jsx): `src/App.jsx`
- [Public landing](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/LandingPage.jsx): `src/pages/LandingPage.jsx`
- [District explorer](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/DistrictPage.jsx): `src/pages/DistrictPage.jsx`

### Citizen services

- [Citizen login](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/VillagerLogin.jsx): `src/pages/VillagerLogin.jsx`
- [Citizen dashboard](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/VillagerDashboard.jsx): `src/pages/VillagerDashboard.jsx`
- [Citizen service screens](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/VillagerScreens.jsx): `src/components/VillagerScreens.jsx`
- [Crop disease scanner](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/CropScanner.jsx): `src/components/CropScanner.jsx`
- [Farmer helpdesk](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/FarmerInquiryModal.jsx): `src/components/FarmerInquiryModal.jsx`

### Administration

- [Official login](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/OfficialLogin.jsx): `src/pages/OfficialLogin.jsx`
- [Official case hub](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/pages/OfficialDashboard.jsx): `src/pages/OfficialDashboard.jsx`
- [Grievance escalation](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/escalation.js): `src/utils/escalation.js`

### Shared capabilities

- [Voice assistant widget](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/components/VoiceAssistantWidget.jsx): `src/components/VoiceAssistantWidget.jsx`
- [Speech context](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/context/VoiceContext.jsx): `src/context/VoiceContext.jsx`
- [Voice and AI services](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/voiceCommands.js): `src/utils/voiceCommands.js`
- [Crop disease data](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/data/cropDiseasesData.js): `src/data/cropDiseasesData.js`
- [Schemes catalogue](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/data/schemesData.js): `src/data/schemesData.js`
- [APMC price feeds](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/fetchPrices.js): `src/utils/fetchPrices.js`
- [Weather advisories](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/utils/fetchWeather.js): `src/utils/fetchWeather.js`

### Data & integrations

- [Firebase client](https://github.com/eshwarhs170-a11y/gramsetu/blob/main/src/firebase.js): `src/firebase.js`
- **Firestore**
- **Google Gemini**
- **Browser speech APIs**

### Other components

- **Rural citizens**
- **Government officials**

## Connections

- Rural citizens → Route dispatcher: opens portal (evidence: `README.md`)
- Government officials → Route dispatcher: opens portal (evidence: `README.md`)
- Route dispatcher → Public landing: routes to (evidence: `src/App.jsx`)
- Route dispatcher → District explorer: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Citizen login: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Citizen dashboard: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Official login: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Official case hub: routes to (evidence: `src/App.jsx`)
- Citizen dashboard → Crop disease scanner: offers diagnosis (evidence: `README.md`)
- Citizen dashboard → Farmer helpdesk: offers helpdesk
- Farmer helpdesk → Firebase client: writes inquiries (evidence: `src/components/FarmerInquiryModal.jsx`)
- Official case hub → Firebase client: updates inquiries (evidence: `src/pages/OfficialDashboard.jsx`)
- Firebase client → Firestore: connects to (evidence: `src/firebase.js`)
- Official case hub → Grievance escalation: uses escalation (evidence: `src/pages/OfficialDashboard.jsx`)
- Citizen dashboard → APMC price feeds: loads prices
- Citizen dashboard → Weather advisories: offers forecasts (evidence: `README.md`)
- Citizen dashboard → Schemes catalogue: browses schemes
- Crop disease scanner → Voice and AI services: requests AI analysis (evidence: `src/components/CropScanner.jsx`)
- Crop disease scanner → Crop disease data: uses disease data (evidence: `src/components/CropScanner.jsx`)
- Voice assistant widget → Speech context: uses speech state (evidence: `src/components/VoiceAssistantWidget.jsx`)
- Speech context → Browser speech APIs: recognizes and speaks (evidence: `README.md`)
- Voice and AI services → Google Gemini: requests AI (evidence: `src/utils/voiceCommands.js`)
- Public landing → Farmer helpdesk: opens helpdesk (evidence: `src/pages/LandingPage.jsx`)
