# sivamanikoppisetti/voters architecture

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

- Interactive diagram: https://gitdiagram.com/sivamanikoppisetti/voters
- Repository: https://github.com/sivamanikoppisetti/voters

## Overview

Voter Insights is a bilingual electoral-roll website. Voters browse counts from the generated chart data by constituency, mandal, village, booth, street and household, or search voter records and retrieve household members through Supabase. The data-preparation workflow loads CSV rows into Supabase and separately rebuilds the website’s counts-only data.json. README evidence establishes the website capabilities and database functions; the HTML and SQL implementations were not sampled, so their internal routing is not expanded here.

Main entry points: [`tools/load_to_supabase.py`](https://github.com/sivamanikoppisetti/voters/blob/main/tools/load_to_supabase.py) (CSV loader), [`index.html`](https://github.com/sivamanikoppisetti/voters/blob/main/index.html) (Voter search), [`supabase/schema.sql`](https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql) (search_voters), [`config.js`](https://github.com/sivamanikoppisetti/voters/blob/main/config.js) (Supabase config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website"]
  node_hierarchy["Roll browsing<br/>[index.html]"]
  node_charts["Charts and counts<br/>[index.html]"]
  node_votersearch["Voter search<br/>[index.html]"]
  node_housemembers["House members<br/>[index.html]"]
  node_chartdata["Chart data<br/>[data.json]"]
  node_clientconfig["Supabase config<br/>[config.js]"]
end

subgraph group_serving["Search Service"]
  node_searchapi["search_voters<br/>[schema.sql]"]
  node_membersapi["house_members<br/>[schema.sql]"]
  node_voterstore[("Voter records<br/>[schema.sql]")]
end

subgraph group_ingestion["Data Preparation"]
  node_loader["CSV loader"]
  node_preparation["Row preparation"]
  node_summaries["Summary builder<br/>[site_data.py]"]
end

node_visitor(("Website visitor"))
node_csvsource["Electoral-roll CSV"]
node_supabase[("Supabase database")]

node_visitor -->|"browses levels"| node_hierarchy
node_hierarchy -->|"displays counts"| node_charts
node_charts -->|"reads data"| node_chartdata
node_visitor -->|"searches voters"| node_votersearch
node_votersearch -->|"uses endpoint config"| node_clientconfig
node_votersearch -->|"calls"| node_searchapi
node_visitor -->|"views household"| node_housemembers
node_housemembers -->|"uses endpoint config"| node_clientconfig
node_housemembers -->|"calls"| node_membersapi
node_searchapi -->|"searches records"| node_voterstore
node_membersapi -->|"reads members"| node_voterstore
node_csvsource -->|"provides rows"| node_loader
node_loader -->|"prepares rows"| node_preparation
node_loader -->|"loads and reads"| node_supabase
node_loader -->|"builds summaries"| node_summaries
node_summaries -->|"writes counts"| node_chartdata
node_clientconfig -->|"configures access"| node_supabase
node_searchapi -->|"served by"| node_supabase
node_membersapi -->|"served by"| node_supabase

click node_hierarchy "https://github.com/sivamanikoppisetti/voters/blob/main/index.html"
click node_charts "https://github.com/sivamanikoppisetti/voters/blob/main/index.html"
click node_votersearch "https://github.com/sivamanikoppisetti/voters/blob/main/index.html"
click node_housemembers "https://github.com/sivamanikoppisetti/voters/blob/main/index.html"
click node_chartdata "https://github.com/sivamanikoppisetti/voters/blob/main/data.json"
click node_clientconfig "https://github.com/sivamanikoppisetti/voters/blob/main/config.js"
click node_searchapi "https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql"
click node_membersapi "https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql"
click node_voterstore "https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql"
click node_loader "https://github.com/sivamanikoppisetti/voters/blob/main/tools/load_to_supabase.py"
click node_preparation "https://github.com/sivamanikoppisetti/voters/blob/main/tools/load_to_supabase.py"
click node_summaries "https://github.com/sivamanikoppisetti/voters/blob/main/tools/site_data.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_hierarchy,node_charts,node_votersearch,node_housemembers,node_chartdata,node_clientconfig toneBlue
class node_searchapi,node_membersapi,node_voterstore,node_supabase toneAmber
class node_loader,node_preparation,node_summaries toneMint
class node_visitor,node_csvsource toneIndigo
```

## Components

### Website

- [Roll browsing](https://github.com/sivamanikoppisetti/voters/blob/main/index.html): `index.html`
- [Charts and counts](https://github.com/sivamanikoppisetti/voters/blob/main/index.html): `index.html`
- [Voter search](https://github.com/sivamanikoppisetti/voters/blob/main/index.html): `index.html`
- [House members](https://github.com/sivamanikoppisetti/voters/blob/main/index.html): `index.html`
- [Chart data](https://github.com/sivamanikoppisetti/voters/blob/main/data.json): `data.json`
- [Supabase config](https://github.com/sivamanikoppisetti/voters/blob/main/config.js): `config.js`

### Search Service

- [search_voters](https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql): `supabase/schema.sql`
- [house_members](https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql): `supabase/schema.sql`
- [Voter records](https://github.com/sivamanikoppisetti/voters/blob/main/supabase/schema.sql): `supabase/schema.sql`

### Data Preparation

- [CSV loader](https://github.com/sivamanikoppisetti/voters/blob/main/tools/load_to_supabase.py): `tools/load_to_supabase.py`
- [Row preparation](https://github.com/sivamanikoppisetti/voters/blob/main/tools/load_to_supabase.py): `tools/load_to_supabase.py`
- [Summary builder](https://github.com/sivamanikoppisetti/voters/blob/main/tools/site_data.py): `tools/site_data.py`

### Other components

- **Website visitor**
- **Electoral-roll CSV**
- **Supabase database**

## Connections

- Website visitor → Roll browsing: browses levels (evidence: `README.md`)
- Roll browsing → Charts and counts: displays counts (evidence: `README.md`)
- Charts and counts → Chart data: reads data (evidence: `README.md`)
- Website visitor → Voter search: searches voters (evidence: `README.md`)
- Voter search → Supabase config: uses endpoint config (evidence: `README.md`)
- Voter search → search_voters: calls (evidence: `README.md`)
- Website visitor → House members: views household (evidence: `README.md`)
- House members → Supabase config: uses endpoint config (evidence: `README.md`)
- House members → house_members: calls (evidence: `README.md`)
- search_voters → Voter records: searches records (evidence: `README.md`)
- house_members → Voter records: reads members (evidence: `README.md`)
- Electoral-roll CSV → CSV loader: provides rows (evidence: `tools/load_to_supabase.py`)
- CSV loader → Row preparation: prepares rows (evidence: `tools/load_to_supabase.py`)
- CSV loader → Supabase database: loads and reads (evidence: `tools/load_to_supabase.py`)
- CSV loader → Summary builder: builds summaries (evidence: `tools/load_to_supabase.py`)
- Summary builder → Chart data: writes counts
- Supabase config → Supabase database: configures access (evidence: `README.md`)
- search_voters → Supabase database: served by (evidence: `README.md`)
- house_members → Supabase database: served by (evidence: `README.md`)
