# khushi-321-codes/community-hero-ai architecture

> Architecture diagram of the GitHub repository khushi-321-codes/community-hero-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khushi-321-codes/community-hero-ai
- Repository: https://github.com/khushi-321-codes/community-hero-ai

## Overview

Community Hero is a single-file Streamlit civic-safety application. Citizens use it to register and track complaints, view local issues, activate emergency safeguards, and request legal guidance. The README documents map, voting, multimedia evidence, telemetry, and dashboard capabilities; the excerpts show the Gemini call with mock fallback and a simulated safe-word trigger. Those documented but unsampled features are represented without inferring their internal wiring or persistent storage.

Main entry points: [`App.py`](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py) (Streamlit App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_civic["Civic Reporting"]
  node_app["Streamlit App<br/>[App.py]"]
  node_complaint["Complaint Registration<br/>[App.py]"]
  node_evidence["Media Evidence<br/>[App.py]"]
  node_map["Hyperlocal Issue Map<br/>[App.py]"]
  node_votes["Issue Upvoting<br/>[App.py]"]
  node_tracker["Status Tracker<br/>[App.py]"]
  node_dashboard["Impact Dashboard<br/>[App.py]"]
end

subgraph group_safety["Safety Response"]
  node_sos["SOS Travel Hub<br/>[App.py]"]
  node_safe_word["Safe-Word Simulator<br/>[App.py]"]
  node_telemetry["Telemetry Broadcast<br/>[App.py]"]
  node_helplines["Emergency Helplines<br/>[App.py]"]
end

subgraph group_legal["Legal Guidance"]
  node_legal["Legal Mitra<br/>[App.py]"]
  node_fallback["Legal Mock Fallback<br/>[App.py]"]
end

node_citizen(("Citizen"))
node_authorities["Local Authorities"]
node_gemini["Gemini API"]

node_citizen -->|"uses"| node_app
node_app -->|"offers"| node_complaint
node_complaint -->|"accepts"| node_evidence
node_app -->|"renders"| node_map
node_map -->|"supports"| node_votes
node_app -->|"shows progress"| node_tracker
node_app -->|"offers"| node_dashboard
node_app -->|"offers"| node_sos
node_sos -->|"simulates trigger"| node_safe_word
node_sos -->|"broadcasts"| node_telemetry
node_telemetry -->|"notifies"| node_authorities
node_sos -->|"provides calls"| node_helplines
node_app -->|"offers consultation"| node_legal
node_legal -->|"requests advice"| node_gemini
node_legal -->|"falls back"| node_fallback

click node_app "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_complaint "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_evidence "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_map "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_votes "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_tracker "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_dashboard "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_sos "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_safe_word "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_telemetry "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_helplines "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_legal "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py"
click node_fallback "https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.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_app,node_complaint,node_evidence,node_map,node_votes,node_tracker,node_dashboard toneBlue
class node_sos,node_safe_word,node_telemetry,node_helplines toneAmber
class node_legal,node_fallback,node_gemini toneMint
class node_citizen,node_authorities toneIndigo
```

## Components

### Civic Reporting

- [Streamlit App](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Complaint Registration](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Media Evidence](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Hyperlocal Issue Map](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Issue Upvoting](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Status Tracker](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Impact Dashboard](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`

### Safety Response

- [SOS Travel Hub](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Safe-Word Simulator](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Telemetry Broadcast](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Emergency Helplines](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`

### Legal Guidance

- [Legal Mitra](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`
- [Legal Mock Fallback](https://github.com/khushi-321-codes/community-hero-ai/blob/main/App.py): `App.py`

### Other components

- **Citizen**
- **Local Authorities**
- **Gemini API**

## Connections

- Citizen → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → Complaint Registration: offers (evidence: `README.md`)
- Complaint Registration → Media Evidence: accepts (evidence: `README.md`)
- Streamlit App → Hyperlocal Issue Map: renders (evidence: `README.md`)
- Hyperlocal Issue Map → Issue Upvoting: supports (evidence: `README.md`)
- Streamlit App → Status Tracker: shows progress (evidence: `README.md`)
- Streamlit App → Impact Dashboard: offers (evidence: `App.py`)
- Streamlit App → SOS Travel Hub: offers (evidence: `README.md`)
- SOS Travel Hub → Safe-Word Simulator: simulates trigger (evidence: `App.py`)
- SOS Travel Hub → Telemetry Broadcast: broadcasts (evidence: `README.md`)
- Telemetry Broadcast → Local Authorities: notifies (evidence: `README.md`)
- SOS Travel Hub → Emergency Helplines: provides calls (evidence: `App.py`)
- Streamlit App → Legal Mitra: offers consultation (evidence: `README.md`)
- Legal Mitra → Gemini API: requests advice (evidence: `App.py`)
- Legal Mitra → Legal Mock Fallback: falls back (evidence: `App.py`)
