# harsh01-ux/sarkar-sathi architecture

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

- Interactive diagram: https://gitdiagram.com/harsh01-ux/sarkar-sathi
- Repository: https://github.com/harsh01-ux/sarkar-sathi

## Overview

Sarkari Saathi is a bilingual guide to Indian government services. Users can browse the service catalog or search by text or voice, then open a service guide with eligibility, application details, required documents, process steps, fees, notes, and official sources. The graph follows the documented React routes and component relationships; browser speech capabilities are shown as external integrations. Unsampled modules are included where the SOURCE INDEX identifies their role, but no unverified links are inferred.

Main entry points: [`src/hooks/useLanguage.js`](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useLanguage.js) (Language preference), [`src/pages/ServiceDetail.jsx`](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/ServiceDetail.jsx) (Service detail page), [`src/App.jsx`](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/App.jsx) (App router), [`src/pages/Home.jsx`](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/Home.jsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_app["App router<br/>[App.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_discovery["Service discovery"]
  node_home["Home page<br/>[Home.jsx]"]
  node_services["Services page<br/>[Services.jsx]"]
  node_search["Service search<br/>[SearchBox.jsx]"]
  node_examples["Example queries<br/>[ExampleQueries.jsx]"]
  node_servicecard["Service card<br/>[ServiceCard.jsx]"]
  node_states["Empty states<br/>[States.jsx]"]
end

subgraph group_guides["Service guides"]
  node_detail["Service detail page<br/>[ServiceDetail.jsx]"]
  node_guideheader["Guide header<br/>[GuideHeader.jsx]"]
  node_checklist["Document checklist"]
  node_process["Process steps<br/>[ProcessSteps.jsx]"]
  node_official["Official sources<br/>[OfficialSource.jsx]"]
  node_infosection["Guide information section<br/>[InfoSection.jsx]"]
end

subgraph group_shared["Shared language and voice"]
  node_voiceinput["Voice input<br/>[useVoiceInput.js]"]
  node_voiceoutput["Voice playback<br/>[useVoiceOutput.js]"]
  node_language["Language preference<br/>[useLanguage.js]"]
end

subgraph group_content["Service content"]
  node_translations["UI translations<br/>[translations.js]"]
  node_catalog["Service catalog and matching<br/>[services.js]"]
end

node_visitor(("Service seeker"))
node_speechrecognition["Browser speech recognition"]
node_speechsynthesis["Browser speech synthesis"]

node_visitor -->|"opens"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_services
node_app -->|"routes to"| node_detail
node_app -->|"renders"| node_footer
node_home -->|"renders"| node_search
node_home -->|"renders"| node_examples
node_home -->|"renders"| node_servicecard
node_home -->|"reads"| node_catalog
node_services -->|"renders"| node_search
node_services -->|"renders"| node_servicecard
node_services -->|"renders"| node_states
node_services -->|"reads"| node_catalog
node_search -->|"matches query"| node_catalog
node_search -->|"uses"| node_voiceinput
node_voiceinput -->|"requests speech"| node_speechrecognition
node_examples -->|"reads"| node_catalog
node_detail -->|"reads"| node_catalog
node_detail -->|"renders"| node_guideheader
node_detail -->|"renders"| node_checklist
node_detail -->|"renders"| node_process
node_detail -->|"renders"| node_official
node_detail -->|"renders"| node_infosection
node_process -->|"uses"| node_voiceoutput
node_voiceoutput -->|"speaks through"| node_speechsynthesis
node_search -->|"reads"| node_language
node_home -->|"reads"| node_language
node_detail -->|"reads"| node_language
node_navbar -->|"uses"| node_language
node_servicecard -->|"uses"| node_language
node_checklist -->|"uses"| node_language
node_guideheader -->|"uses"| node_language
node_process -->|"uses"| node_language
node_states -->|"uses"| node_language
node_examples -->|"uses"| node_language
node_language -->|"reads"| node_translations

click node_app "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/App.jsx"
click node_home "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/Home.jsx"
click node_services "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/Services.jsx"
click node_search "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/SearchBox.jsx"
click node_voiceinput "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useVoiceInput.js"
click node_examples "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ExampleQueries.jsx"
click node_servicecard "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ServiceCard.jsx"
click node_states "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/States.jsx"
click node_detail "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/ServiceDetail.jsx"
click node_guideheader "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/GuideHeader.jsx"
click node_checklist "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/DocumentChecklist.jsx"
click node_process "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ProcessSteps.jsx"
click node_voiceoutput "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useVoiceOutput.js"
click node_official "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/OfficialSource.jsx"
click node_infosection "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/InfoSection.jsx"
click node_navbar "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/Navbar.jsx"
click node_footer "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/Footer.jsx"
click node_language "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useLanguage.js"
click node_translations "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/data/translations.js"
click node_catalog "https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/data/services.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_navbar,node_footer,node_speechrecognition,node_speechsynthesis toneBlue
class node_home,node_services,node_search,node_examples,node_servicecard,node_states toneAmber
class node_detail,node_guideheader,node_checklist,node_process,node_official,node_infosection toneMint
class node_voiceinput,node_voiceoutput,node_language toneRose
class node_translations,node_catalog,node_visitor toneIndigo
```

## Components

### App navigation

- [App router](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation bar](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Footer](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Service discovery

- [Home page](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Services page](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/Services.jsx): `src/pages/Services.jsx`
- [Service search](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/SearchBox.jsx): `src/components/SearchBox.jsx`
- [Example queries](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ExampleQueries.jsx): `src/components/ExampleQueries.jsx`
- [Service card](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ServiceCard.jsx): `src/components/ServiceCard.jsx`
- [Empty states](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/States.jsx): `src/components/States.jsx`

### Service guides

- [Service detail page](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/pages/ServiceDetail.jsx): `src/pages/ServiceDetail.jsx`
- [Guide header](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/GuideHeader.jsx): `src/components/GuideHeader.jsx`
- [Document checklist](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/DocumentChecklist.jsx): `src/components/DocumentChecklist.jsx`
- [Process steps](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/ProcessSteps.jsx): `src/components/ProcessSteps.jsx`
- [Official sources](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/OfficialSource.jsx): `src/components/OfficialSource.jsx`
- [Guide information section](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/components/InfoSection.jsx): `src/components/InfoSection.jsx`

### Shared language and voice

- [Voice input](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useVoiceInput.js): `src/hooks/useVoiceInput.js`
- [Voice playback](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useVoiceOutput.js): `src/hooks/useVoiceOutput.js`
- [Language preference](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/hooks/useLanguage.js): `src/hooks/useLanguage.js`

### Service content

- [UI translations](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/data/translations.js): `src/data/translations.js`
- [Service catalog and matching](https://github.com/harsh01-ux/sarkar-sathi/blob/main/src/data/services.js): `src/data/services.js`

### Other components

- **Service seeker**
- **Browser speech recognition**
- **Browser speech synthesis**

## Connections

- Service seeker → App router: opens
- App router → Navigation bar: renders (evidence: `src/App.jsx`)
- App router → Home page: routes to (evidence: `src/App.jsx`)
- App router → Services page: routes to (evidence: `src/App.jsx`)
- App router → Service detail page: routes to (evidence: `src/App.jsx`)
- App router → Footer: renders (evidence: `src/App.jsx`)
- Home page → Service search: renders (evidence: `src/pages/Home.jsx`)
- Home page → Example queries: renders (evidence: `src/pages/Home.jsx`)
- Home page → Service card: renders (evidence: `src/pages/Home.jsx`)
- Home page → Service catalog and matching: reads (evidence: `src/pages/Home.jsx`)
- Services page → Service search: renders (evidence: `src/pages/Services.jsx`)
- Services page → Service card: renders (evidence: `src/pages/Services.jsx`)
- Services page → Empty states: renders (evidence: `src/pages/Services.jsx`)
- Services page → Service catalog and matching: reads (evidence: `src/pages/Services.jsx`)
- Service search → Service catalog and matching: matches query (evidence: `src/components/SearchBox.jsx`)
- Service search → Voice input: uses (evidence: `src/components/SearchBox.jsx`)
- Voice input → Browser speech recognition: requests speech (evidence: `src/hooks/useVoiceInput.js`)
- Example queries → Service catalog and matching: reads (evidence: `src/components/ExampleQueries.jsx`)
- Service detail page → Service catalog and matching: reads (evidence: `src/pages/ServiceDetail.jsx`)
- Service detail page → Guide header: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Service detail page → Document checklist: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Service detail page → Process steps: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Service detail page → Official sources: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Service detail page → Guide information section: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Process steps → Voice playback: uses (evidence: `src/components/ProcessSteps.jsx`)
- Voice playback → Browser speech synthesis: speaks through (evidence: `src/hooks/useVoiceOutput.js`)
- Service search → Language preference: reads (evidence: `src/components/SearchBox.jsx`)
- Home page → Language preference: reads (evidence: `src/pages/Home.jsx`)
- Service detail page → Language preference: reads (evidence: `src/pages/ServiceDetail.jsx`)
- Navigation bar → Language preference: uses (evidence: `src/components/Navbar.jsx`)
- Service card → Language preference: uses (evidence: `src/components/ServiceCard.jsx`)
- Document checklist → Language preference: uses (evidence: `src/components/DocumentChecklist.jsx`)
- Guide header → Language preference: uses (evidence: `src/components/GuideHeader.jsx`)
- Process steps → Language preference: uses (evidence: `src/components/ProcessSteps.jsx`)
- Empty states → Language preference: uses (evidence: `src/components/States.jsx`)
- Example queries → Language preference: uses (evidence: `src/components/ExampleQueries.jsx`)
- Language preference → UI translations: reads (evidence: `src/hooks/useLanguage.js`)
