# tcpd/lokdhaba architecture

> Architecture diagram of the GitHub repository tcpd/lokdhaba, 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/tcpd/lokdhaba
- Repository: https://github.com/tcpd/lokdhaba

## Overview

LokDhaba is a Shiny-based tool for disseminating and visualising Indian election data. Its apparent user workflow is to open the app, choose general- or assembly-election views, explore charts or maps, and access data downloads. The tree shows separate AE and GE visualisation modules and a dedicated downloader. The README confirms the product purpose and Shiny entry point, while the supplied source excerpts do not show runtime wiring; inferred connections are therefore dashed and uncited.

Main entry points: [`app.R`](https://github.com/tcpd/lokdhaba/blob/master/app.R) (Shiny app), [`AE/aeOptionsInput.R`](https://github.com/tcpd/lokdhaba/blob/master/AE/aeOptionsInput.R) (AE options), [`GE/geOptionsInput.R`](https://github.com/tcpd/lokdhaba/blob/master/GE/geOptionsInput.R) (GE options), [`DataDownloader/dataDownloadOptions.R`](https://github.com/tcpd/lokdhaba/blob/master/DataDownloader/dataDownloadOptions.R) (Download options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_shiny_app["Shiny app<br/>[app.R]"]
  node_shared_runtime["Shared runtime<br/>[global.R]"]
end

subgraph group_assembly["Assembly elections"]
  node_ae_options["AE options<br/>[aeOptionsInput.R]"]
  node_ae_charts["AE charts"]
  node_ae_maps["AE maps"]
  node_ae_catalog["AE catalog<br/>[chartsMaps.csv]"]
end

subgraph group_general["General elections"]
  node_ge_options["GE options<br/>[geOptionsInput.R]"]
  node_ge_charts["GE charts"]
  node_ge_maps["GE maps"]
  node_ge_catalog["GE catalog<br/>[chartsMaps.csv]"]
end

subgraph group_downloads["Data access"]
  node_download_ui["Download options"]
  node_browse_ui["Browse options"]
  node_download_helpers["Download helpers"]
end

subgraph group_metadata["Dataset metadata"]
  node_dataset_metadata["Election dataset"]
end

node_visitor(("Visitor"))

node_visitor -.->|"opens"| node_shiny_app
node_shiny_app -.->|"uses"| node_shared_runtime
node_shiny_app -.->|"offers"| node_ae_options
node_shiny_app -.->|"offers"| node_ge_options
node_ae_options -.->|"selects"| node_ae_charts
node_ae_options -.->|"selects"| node_ae_maps
node_ae_options -.->|"configures"| node_ae_catalog
node_ge_options -.->|"selects"| node_ge_charts
node_ge_options -.->|"selects"| node_ge_maps
node_ge_options -.->|"configures"| node_ge_catalog
node_shiny_app -.->|"offers"| node_download_ui
node_shiny_app -.->|"offers"| node_browse_ui
node_download_ui -.->|"delegates"| node_download_helpers
node_visitor -.->|"views"| node_dataset_metadata

click node_shiny_app "https://github.com/tcpd/lokdhaba/blob/master/app.R"
click node_shared_runtime "https://github.com/tcpd/lokdhaba/blob/master/global.R"
click node_ae_options "https://github.com/tcpd/lokdhaba/blob/master/AE/aeOptionsInput.R"
click node_ae_charts "https://github.com/tcpd/lokdhaba/tree/master/AE/plugins/Charts"
click node_ae_maps "https://github.com/tcpd/lokdhaba/tree/master/AE/plugins/Maps"
click node_ae_catalog "https://github.com/tcpd/lokdhaba/blob/master/AE/chartsMaps.csv"
click node_ge_options "https://github.com/tcpd/lokdhaba/blob/master/GE/geOptionsInput.R"
click node_ge_charts "https://github.com/tcpd/lokdhaba/tree/master/GE/plugins/Charts"
click node_ge_maps "https://github.com/tcpd/lokdhaba/tree/master/GE/plugins/Maps"
click node_ge_catalog "https://github.com/tcpd/lokdhaba/blob/master/GE/chartsMaps.csv"
click node_download_ui "https://github.com/tcpd/lokdhaba/blob/master/DataDownloader/dataDownloadOptions.R"
click node_browse_ui "https://github.com/tcpd/lokdhaba/blob/master/DataDownloader/browseDataOptions.R"
click node_download_helpers "https://github.com/tcpd/lokdhaba/blob/master/utils/utils-datadownloader.R"
click node_dataset_metadata "https://github.com/tcpd/lokdhaba/blob/master/www/metadata_lokdhaba.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_shiny_app,node_shared_runtime toneBlue
class node_ae_options,node_ae_charts,node_ae_maps,node_ae_catalog toneAmber
class node_ge_options,node_ge_charts,node_ge_maps,node_ge_catalog toneMint
class node_download_ui,node_browse_ui,node_download_helpers toneRose
class node_dataset_metadata,node_visitor toneIndigo
```

## Components

### Application

- [Shiny app](https://github.com/tcpd/lokdhaba/blob/master/app.R): `app.R`
- [Shared runtime](https://github.com/tcpd/lokdhaba/blob/master/global.R): `global.R`

### Assembly elections

- [AE options](https://github.com/tcpd/lokdhaba/blob/master/AE/aeOptionsInput.R): `AE/aeOptionsInput.R`
- [AE charts](https://github.com/tcpd/lokdhaba/tree/master/AE/plugins/Charts): `AE/plugins/Charts`
- [AE maps](https://github.com/tcpd/lokdhaba/tree/master/AE/plugins/Maps): `AE/plugins/Maps`
- [AE catalog](https://github.com/tcpd/lokdhaba/blob/master/AE/chartsMaps.csv): `AE/chartsMaps.csv`

### General elections

- [GE options](https://github.com/tcpd/lokdhaba/blob/master/GE/geOptionsInput.R): `GE/geOptionsInput.R`
- [GE charts](https://github.com/tcpd/lokdhaba/tree/master/GE/plugins/Charts): `GE/plugins/Charts`
- [GE maps](https://github.com/tcpd/lokdhaba/tree/master/GE/plugins/Maps): `GE/plugins/Maps`
- [GE catalog](https://github.com/tcpd/lokdhaba/blob/master/GE/chartsMaps.csv): `GE/chartsMaps.csv`

### Data access

- [Download options](https://github.com/tcpd/lokdhaba/blob/master/DataDownloader/dataDownloadOptions.R): `DataDownloader/dataDownloadOptions.R`
- [Browse options](https://github.com/tcpd/lokdhaba/blob/master/DataDownloader/browseDataOptions.R): `DataDownloader/browseDataOptions.R`
- [Download helpers](https://github.com/tcpd/lokdhaba/blob/master/utils/utils-datadownloader.R): `utils/utils-datadownloader.R`

### Dataset metadata

- [Election dataset](https://github.com/tcpd/lokdhaba/blob/master/www/metadata_lokdhaba.js): `www/metadata_lokdhaba.js`

### Other components

- **Visitor**

## Connections

- Visitor → Shiny app: opens
- Shiny app → Shared runtime: uses
- Shiny app → AE options: offers
- Shiny app → GE options: offers
- AE options → AE charts: selects
- AE options → AE maps: selects
- AE options → AE catalog: configures
- GE options → GE charts: selects
- GE options → GE maps: selects
- GE options → GE catalog: configures
- Shiny app → Download options: offers
- Shiny app → Browse options: offers
- Download options → Download helpers: delegates
- Visitor → Election dataset: views
