# umdhodi/brics-citizenpulse-ai architecture

> Architecture diagram of the GitHub repository umdhodi/brics-citizenpulse-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/umdhodi/brics-citizenpulse-ai
- Repository: https://github.com/umdhodi/brics-citizenpulse-ai

## Overview

BRICS CitizenPulse AI is a browser-based governance dashboard for collecting multilingual citizen infrastructure requests, mapping demand, and helping policymakers prioritize investment. The principal workflow runs from citizen text or voice input through speech transcription and Gemini or local NLP classification, then presents categorized and urgency-scored requests in map, analytics, and policymaker views. The policymaker view ranks requests, simulates budget impact, and can generate a policy brief. The graph reflects the sampled controller and module behavior plus README-described capabilities; some view initialization and page wiring were not included in the excerpts.

Main entry points: [`js/app.js`](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/app.js) (App Controller), [`js/geminiEngine.js`](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/geminiEngine.js) (Request NLP), [`js/mockData.js`](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mockData.js) (Feedback Records), [`js/mapView.js`](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mapView.js) (GIS Hotspot Map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Citizen Intake"]
  node_recorder["Speech Recorder<br/>[speechRecorder.js]"]
  node_requests["Feedback Records<br/>[mockData.js]"]
end

subgraph group_processing["Request Processing"]
  node_processor["Request NLP<br/>[geminiEngine.js]"]
end

subgraph group_insight["Governance Insights"]
  node_map["GIS Hotspot Map<br/>[mapView.js]"]
  node_analytics["Demand Analytics<br/>[analyticsView.js]"]
  node_policymaker["Priority &amp; Budget<br/>[policymakerView.js]"]
  node_brief["Policy Brief<br/>[geminiEngine.js]"]
end

subgraph group_platform["Browser Platform"]
  node_webapp["Web Interface<br/>[index.html]"]
  node_controller["App Controller<br/>[app.js]"]
  node_config["Nation &amp; Category Config<br/>[config.js]"]
end

node_citizens(("Citizens"))
node_speechapi["Web Speech API"]
node_gemini["Google Gemini"]
node_tiles["Carto Map Tiles"]

node_citizens -->|"submit feedback"| node_webapp
node_webapp -->|"dispatch input"| node_controller
node_controller -->|"start recording"| node_recorder
node_recorder -.->|"transcribe speech"| node_speechapi
node_recorder -->|"return transcript"| node_controller
node_controller -->|"process request"| node_processor
node_processor -.->|"classify request"| node_gemini
node_processor -->|"return analysis"| node_controller
node_controller -->|"update feedback"| node_requests
node_controller -->|"read nation settings"| node_config
node_map -->|"read feedback"| node_requests
node_map -->|"read map settings"| node_config
node_map -->|"load tiles"| node_tiles
node_analytics -->|"read feedback"| node_requests
node_policymaker -->|"read feedback"| node_requests
node_policymaker -->|"request policy brief"| node_processor
node_processor -.->|"synthesize brief"| node_gemini
node_processor -->|"return briefing"| node_brief

click node_webapp "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/index.html"
click node_controller "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/app.js"
click node_recorder "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/speechRecorder.js"
click node_requests "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mockData.js"
click node_config "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/config.js"
click node_processor "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/geminiEngine.js"
click node_map "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mapView.js"
click node_analytics "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/analyticsView.js"
click node_policymaker "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/policymakerView.js"
click node_brief "https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/geminiEngine.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_recorder,node_requests toneBlue
class node_processor toneAmber
class node_map,node_analytics,node_policymaker,node_brief,node_speechapi toneMint
class node_webapp,node_controller,node_config toneRose
class node_citizens,node_gemini,node_tiles toneIndigo
```

## Components

### Citizen Intake

- [Speech Recorder](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/speechRecorder.js): `js/speechRecorder.js`
- [Feedback Records](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mockData.js): `js/mockData.js`

### Request Processing

- [Request NLP](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/geminiEngine.js): `js/geminiEngine.js`

### Governance Insights

- [GIS Hotspot Map](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/mapView.js): `js/mapView.js`
- [Demand Analytics](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/analyticsView.js): `js/analyticsView.js`
- [Priority & Budget](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/policymakerView.js): `js/policymakerView.js`
- [Policy Brief](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/geminiEngine.js): `js/geminiEngine.js`

### Browser Platform

- [Web Interface](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/index.html): `index.html`
- [App Controller](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/app.js): `js/app.js`
- [Nation & Category Config](https://github.com/umdhodi/brics-citizenpulse-ai/blob/main/js/config.js): `js/config.js`

### Other components

- **Citizens**
- **Web Speech API**
- **Google Gemini**
- **Carto Map Tiles**

## Connections

- Citizens → Web Interface: submit feedback
- Web Interface → App Controller: dispatch input
- App Controller → Speech Recorder: start recording
- Speech Recorder → Web Speech API: transcribe speech
- Speech Recorder → App Controller: return transcript
- App Controller → Request NLP: process request
- Request NLP → Google Gemini: classify request
- Request NLP → App Controller: return analysis
- App Controller → Feedback Records: update feedback
- App Controller → Nation & Category Config: read nation settings
- GIS Hotspot Map → Feedback Records: read feedback
- GIS Hotspot Map → Nation & Category Config: read map settings
- GIS Hotspot Map → Carto Map Tiles: load tiles
- Demand Analytics → Feedback Records: read feedback
- Priority & Budget → Feedback Records: read feedback
- Priority & Budget → Request NLP: request policy brief
- Request NLP → Google Gemini: synthesize brief
- Request NLP → Policy Brief: return briefing
