# manimegala90/tnvotesui architecture

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

- Interactive diagram: https://gitdiagram.com/manimegala90/tnvotesui
- Repository: https://github.com/manimegala90/tnvotesui

## Overview

TN Votes is a React portal for exploring Tamil Nadu election constituencies, constituency details, candidates, and results. The main visitor workflow is routed through the app shell to a feature screen, where hooks manage search/filter state and request constituency data through service and repository layers. Candidate browsing is a separate client-side flow backed by the candidate hook. The graph preserves the documented screens and detail-page capabilities; evidence for some unsampled UI internals and provider behavior is limited to the README or source index.

Main entry points: [`src/Routes.jsx`](https://github.com/manimegala90/tnvotesui/blob/main/src/Routes.jsx) (Route dispatch), [`src/CandidateDirectory.jsx`](https://github.com/manimegala90/tnvotesui/blob/main/src/CandidateDirectory.jsx) (Candidate directory), [`src/services/constituencyService.jsx`](https://github.com/manimegala90/tnvotesui/blob/main/src/services/constituencyService.jsx) (Constituency service), [`src/App.jsx`](https://github.com/manimegala90/tnvotesui/blob/main/src/App.jsx) (App bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Portal and routing"]
  node_app["App bootstrap<br/>[App.jsx]"]
  node_routes["Route dispatch<br/>[Routes.jsx]"]
  node_layout["App shell<br/>[Layout.jsx]"]
end

subgraph group_features["Election screens"]
  node_home["Home and spotlight<br/>[Home.jsx]"]
  node_results["Election results<br/>[Results.jsx]"]
  node_constituencies["Constituency directory<br/>[Constituencies.jsx]"]
  node_detail["Constituency detail"]
  node_candidates["Candidate directory"]
  node_coming["Coming soon pages<br/>[ComingSoon.jsx]"]
end

subgraph group_ui["Shared interface"]
  node_constituency_ui["Constituency panels"]
  node_candidate_ui["Candidate cards<br/>[CandidateCard.jsx]"]
  node_candidate_modal["Candidate profile"]
  node_shared_ui["Search and paging"]
  node_detail_panels["Detail visualizations"]
end

subgraph group_data["Data access"]
  node_service["Constituency service"]
  node_repository["Constituency repository"]
  node_provider_select["Provider selection<br/>[index.jsx]"]
  node_api_data["API data access<br/>[index.js]"]
  node_election_data[("Election datasets")]
end

subgraph group_state["State and presentation"]
  node_constituency_state["Constituency queries"]
  node_directory_state["Directory queries<br/>[useDirectory.js]"]
  node_candidate_state["Candidate filtering<br/>[useCandidate.js]"]
  node_theme["Theme preferences<br/>[ThemeContext.jsx]"]
end

node_visitor(("Portal visitor"))
node_theme_storage[("Browser theme storage")]

node_visitor -->|"opens portal"| node_app
node_app -->|"renders routes"| node_routes
node_app -->|"provides theme"| node_theme
node_routes -->|"wraps screens"| node_layout
node_routes -->|"routes home"| node_home
node_routes -->|"routes results"| node_results
node_routes -->|"routes directory"| node_constituencies
node_routes -->|"routes detail"| node_detail
node_routes -->|"routes candidates"| node_candidates
node_routes -->|"routes fallback"| node_coming
node_home -->|"loads spotlight"| node_constituency_state
node_results -->|"loads results data"| node_constituency_state
node_constituencies -->|"loads directory"| node_directory_state
node_detail -->|"requests detail"| node_service
node_candidates -->|"filters candidates"| node_candidate_state
node_home -->|"renders cards"| node_constituency_ui
node_results -->|"renders cards"| node_constituency_ui
node_candidates -->|"renders cards"| node_candidate_ui
node_candidates -->|"opens profile"| node_candidate_modal
node_candidates -->|"uses search paging"| node_shared_ui
node_constituencies -->|"uses directory controls"| node_shared_ui
node_detail -->|"renders detail panels"| node_detail_panels
node_constituency_state -->|"requests constituencies"| node_service
node_directory_state -->|"requests directory data"| node_service
node_service -->|"delegates queries"| node_repository
node_repository -->|"delegates queries"| node_provider_select
node_api_data -->|"imports datasets"| node_election_data
node_theme -->|"reads and writes"| node_theme_storage

click node_app "https://github.com/manimegala90/tnvotesui/blob/main/src/App.jsx"
click node_routes "https://github.com/manimegala90/tnvotesui/blob/main/src/Routes.jsx"
click node_layout "https://github.com/manimegala90/tnvotesui/blob/main/src/Layout.jsx"
click node_home "https://github.com/manimegala90/tnvotesui/blob/main/src/Home.jsx"
click node_results "https://github.com/manimegala90/tnvotesui/blob/main/src/Results.jsx"
click node_constituencies "https://github.com/manimegala90/tnvotesui/blob/main/src/Constituencies.jsx"
click node_detail "https://github.com/manimegala90/tnvotesui/blob/main/src/ConstituencyDetail.jsx"
click node_candidates "https://github.com/manimegala90/tnvotesui/blob/main/src/CandidateDirectory.jsx"
click node_coming "https://github.com/manimegala90/tnvotesui/blob/main/src/ComingSoon.jsx"
click node_constituency_ui "https://github.com/manimegala90/tnvotesui/blob/main/src/components/ConstituencyCard.jsx"
click node_candidate_ui "https://github.com/manimegala90/tnvotesui/blob/main/src/components/CandidateCard.jsx"
click node_candidate_modal "https://github.com/manimegala90/tnvotesui/blob/main/src/components/CandidateDetailModal.jsx"
click node_shared_ui "https://github.com/manimegala90/tnvotesui/tree/main/src/components"
click node_detail_panels "https://github.com/manimegala90/tnvotesui/tree/main/src/components"
click node_constituency_state "https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useConstituencies.js"
click node_directory_state "https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useDirectory.js"
click node_candidate_state "https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useCandidate.js"
click node_theme "https://github.com/manimegala90/tnvotesui/blob/main/src/context/ThemeContext.jsx"
click node_service "https://github.com/manimegala90/tnvotesui/blob/main/src/services/constituencyService.jsx"
click node_repository "https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/repositories/constituencyRepository.jsx"
click node_provider_select "https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/providers/index.jsx"
click node_api_data "https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/api/index.js"
click node_election_data "https://github.com/manimegala90/tnvotesui/tree/main/src/data"

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_routes,node_layout toneBlue
class node_home,node_results,node_constituencies,node_detail,node_candidates,node_coming,node_theme_storage toneAmber
class node_constituency_ui,node_candidate_ui,node_candidate_modal,node_shared_ui,node_detail_panels toneMint
class node_service,node_repository,node_provider_select,node_api_data,node_election_data toneRose
class node_constituency_state,node_directory_state,node_candidate_state,node_theme,node_visitor toneIndigo
```

## Components

### Portal and routing

- [App bootstrap](https://github.com/manimegala90/tnvotesui/blob/main/src/App.jsx): `src/App.jsx`
- [Route dispatch](https://github.com/manimegala90/tnvotesui/blob/main/src/Routes.jsx): `src/Routes.jsx`
- [App shell](https://github.com/manimegala90/tnvotesui/blob/main/src/Layout.jsx): `src/Layout.jsx`

### Election screens

- [Home and spotlight](https://github.com/manimegala90/tnvotesui/blob/main/src/Home.jsx): `src/Home.jsx`
- [Election results](https://github.com/manimegala90/tnvotesui/blob/main/src/Results.jsx): `src/Results.jsx`
- [Constituency directory](https://github.com/manimegala90/tnvotesui/blob/main/src/Constituencies.jsx): `src/Constituencies.jsx`
- [Constituency detail](https://github.com/manimegala90/tnvotesui/blob/main/src/ConstituencyDetail.jsx): `src/ConstituencyDetail.jsx`
- [Candidate directory](https://github.com/manimegala90/tnvotesui/blob/main/src/CandidateDirectory.jsx): `src/CandidateDirectory.jsx`
- [Coming soon pages](https://github.com/manimegala90/tnvotesui/blob/main/src/ComingSoon.jsx): `src/ComingSoon.jsx`

### Shared interface

- [Constituency panels](https://github.com/manimegala90/tnvotesui/blob/main/src/components/ConstituencyCard.jsx): `src/components/ConstituencyCard.jsx`
- [Candidate cards](https://github.com/manimegala90/tnvotesui/blob/main/src/components/CandidateCard.jsx): `src/components/CandidateCard.jsx`
- [Candidate profile](https://github.com/manimegala90/tnvotesui/blob/main/src/components/CandidateDetailModal.jsx): `src/components/CandidateDetailModal.jsx`
- [Search and paging](https://github.com/manimegala90/tnvotesui/tree/main/src/components): `src/components`
- [Detail visualizations](https://github.com/manimegala90/tnvotesui/tree/main/src/components): `src/components`

### Data access

- [Constituency service](https://github.com/manimegala90/tnvotesui/blob/main/src/services/constituencyService.jsx): `src/services/constituencyService.jsx`
- [Constituency repository](https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/repositories/constituencyRepository.jsx): `src/infrastructure/repositories/constituencyRepository.jsx`
- [Provider selection](https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/providers/index.jsx): `src/infrastructure/providers/index.jsx`
- [API data access](https://github.com/manimegala90/tnvotesui/blob/main/src/infrastructure/api/index.js): `src/infrastructure/api/index.js`
- [Election datasets](https://github.com/manimegala90/tnvotesui/tree/main/src/data): `src/data`

### State and presentation

- [Constituency queries](https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useConstituencies.js): `src/hooks/useConstituencies.js`
- [Directory queries](https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useDirectory.js): `src/hooks/useDirectory.js`
- [Candidate filtering](https://github.com/manimegala90/tnvotesui/blob/main/src/hooks/useCandidate.js): `src/hooks/useCandidate.js`
- [Theme preferences](https://github.com/manimegala90/tnvotesui/blob/main/src/context/ThemeContext.jsx): `src/context/ThemeContext.jsx`

### Other components

- **Portal visitor**
- **Browser theme storage**

## Connections

- Portal visitor → App bootstrap: opens portal (evidence: `README.md`)
- App bootstrap → Route dispatch: renders routes (evidence: `src/App.jsx`)
- App bootstrap → Theme preferences: provides theme (evidence: `src/App.jsx`)
- Route dispatch → App shell: wraps screens (evidence: `src/Routes.jsx`)
- Route dispatch → Home and spotlight: routes home (evidence: `src/Routes.jsx`)
- Route dispatch → Election results: routes results (evidence: `src/Routes.jsx`)
- Route dispatch → Constituency directory: routes directory (evidence: `src/Routes.jsx`)
- Route dispatch → Constituency detail: routes detail (evidence: `src/Routes.jsx`)
- Route dispatch → Candidate directory: routes candidates (evidence: `src/Routes.jsx`)
- Route dispatch → Coming soon pages: routes fallback (evidence: `src/Routes.jsx`)
- Home and spotlight → Constituency queries: loads spotlight (evidence: `src/Home.jsx`)
- Election results → Constituency queries: loads results data (evidence: `src/Results.jsx`)
- Constituency directory → Directory queries: loads directory (evidence: `src/Constituencies.jsx`)
- Constituency detail → Constituency service: requests detail (evidence: `src/ConstituencyDetail.jsx`)
- Candidate directory → Candidate filtering: filters candidates (evidence: `src/CandidateDirectory.jsx`)
- Home and spotlight → Constituency panels: renders cards (evidence: `src/Home.jsx`)
- Election results → Constituency panels: renders cards (evidence: `src/Results.jsx`)
- Candidate directory → Candidate cards: renders cards (evidence: `src/CandidateDirectory.jsx`)
- Candidate directory → Candidate profile: opens profile (evidence: `src/CandidateDirectory.jsx`)
- Candidate directory → Search and paging: uses search paging (evidence: `src/CandidateDirectory.jsx`)
- Constituency directory → Search and paging: uses directory controls (evidence: `src/Constituencies.jsx`)
- Constituency detail → Detail visualizations: renders detail panels (evidence: `src/ConstituencyDetail.jsx`)
- Constituency queries → Constituency service: requests constituencies (evidence: `src/hooks/useConstituencies.js`)
- Directory queries → Constituency service: requests directory data (evidence: `src/hooks/useDirectory.js`)
- Constituency service → Constituency repository: delegates queries (evidence: `src/services/constituencyService.jsx`)
- Constituency repository → Provider selection: delegates queries (evidence: `src/infrastructure/repositories/constituencyRepository.jsx`)
- API data access → Election datasets: imports datasets (evidence: `src/infrastructure/api/index.js`)
- Theme preferences → Browser theme storage: reads and writes (evidence: `src/context/ThemeContext.jsx`)
