# rishisinhasly7/citypulse architecture

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

- Interactive diagram: https://gitdiagram.com/rishisinhasly7/citypulse
- Repository: https://github.com/rishisinhasly7/citypulse

## Overview

CityPulse is a civic-issue reporting and agency-management web app. The main workflow is citizen intake, issue registration in Firestore, public map/list monitoring, agency review and status updates, then citizen confirmation, dispute/appeal oversight, and performance reporting. App.tsx is the sampled coordinator for intake, role verification, and some resolution handling; AgencyPortal provides agency operations. Other major capabilities are represented from the source index and README-adjacent source excerpts, but unsampled wiring is not inferred.

Main entry points: [`src/App.tsx`](https://github.com/rishisinhasly7/citypulse/blob/main/src/App.tsx) (Portal Coordinator), [`src/utils/db.ts`](https://github.com/rishisinhasly7/citypulse/blob/main/src/utils/db.ts) (Issue And Profile Data), [`src/components/LanguageContext.tsx`](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/LanguageContext.tsx) (Language Context), [`src/components/ReportIssueModal.tsx`](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/ReportIssueModal.tsx) (Issue Intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coord["Application Coordination"]
  node_app["Portal Coordinator<br/>[App.tsx]"]
end

subgraph group_citizen["Citizen Reporting"]
  node_report["Issue Intake"]
  node_location["Manual Location"]
  node_issuecard["Issue Card<br/>[IssueCard.tsx]"]
  node_map["Civic Map"]
end

subgraph group_operations["Agency Operations"]
  node_agency["Agency Workspace<br/>[AgencyPortal.tsx]"]
end

subgraph group_oversight["Oversight And Insights"]
  node_stats["Agency Scorecard<br/>[StatsDashboard.tsx]"]
end

subgraph group_platform["Shared Platform"]
  node_dbutil["Issue And Profile Data<br/>[db.ts]"]
  node_firestore[("Firestore")]
  node_firebase["Firebase Setup<br/>[firebase.ts]"]
  node_seed["Sample Issue Records<br/>[initialData.ts]"]
  node_types["Civic Domain Types<br/>[types.ts]"]
  node_language["Language Context"]
  node_translations["English And Hindi Text<br/>[translation.ts]"]
end

node_user(("Portal User"))

node_user -->|"uses portal"| node_app
node_app -->|"opens intake"| node_report
node_report -.->|"submits report"| node_app
node_app -->|"registers issue"| node_dbutil
node_dbutil -->|"reads and writes"| node_firestore
node_dbutil -->|"uses database setup"| node_firebase
node_firebase -->|"initializes"| node_firestore
node_dbutil -->|"seeds empty store"| node_seed
node_app -->|"shows workspace"| node_agency
node_agency -.->|"updates complaints"| node_firestore
node_app -->|"confirms resolution"| node_firestore
node_app -.->|"shows issue map"| node_map
node_app -.->|"shows issue details"| node_issuecard
node_app -.->|"shows scorecard"| node_stats
node_app -.->|"offers manual location"| node_location
node_app -->|"verifies profile"| node_dbutil
node_report -->|"reads translations"| node_language
node_issuecard -.->|"reads translations"| node_language
node_map -.->|"reads translations"| node_language
node_language -->|"selects language text"| node_translations
node_dbutil -->|"uses domain records"| node_types
node_app -.->|"uses issue records"| node_types
node_agency -.->|"uses issue records"| node_types

click node_app "https://github.com/rishisinhasly7/citypulse/blob/main/src/App.tsx"
click node_report "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/ReportIssueModal.tsx"
click node_location "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/ManualLocationPicker.tsx"
click node_issuecard "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/IssueCard.tsx"
click node_map "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/CivicMapAnimation.tsx"
click node_agency "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/AgencyPortal.tsx"
click node_stats "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/StatsDashboard.tsx"
click node_dbutil "https://github.com/rishisinhasly7/citypulse/blob/main/src/utils/db.ts"
click node_firebase "https://github.com/rishisinhasly7/citypulse/blob/main/src/firebase.ts"
click node_seed "https://github.com/rishisinhasly7/citypulse/blob/main/src/initialData.ts"
click node_types "https://github.com/rishisinhasly7/citypulse/blob/main/src/types.ts"
click node_language "https://github.com/rishisinhasly7/citypulse/blob/main/src/components/LanguageContext.tsx"
click node_translations "https://github.com/rishisinhasly7/citypulse/blob/main/src/utils/translation.ts"

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_user toneBlue
class node_report,node_location,node_issuecard,node_map toneAmber
class node_agency toneMint
class node_stats toneRose
class node_dbutil,node_firestore,node_firebase,node_seed,node_types,node_language,node_translations toneIndigo
```

## Components

### Application Coordination

- [Portal Coordinator](https://github.com/rishisinhasly7/citypulse/blob/main/src/App.tsx): `src/App.tsx`

### Citizen Reporting

- [Issue Intake](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/ReportIssueModal.tsx): `src/components/ReportIssueModal.tsx`
- [Manual Location](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/ManualLocationPicker.tsx): `src/components/ManualLocationPicker.tsx`
- [Issue Card](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/IssueCard.tsx): `src/components/IssueCard.tsx`
- [Civic Map](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/CivicMapAnimation.tsx): `src/components/CivicMapAnimation.tsx`

### Agency Operations

- [Agency Workspace](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/AgencyPortal.tsx): `src/components/AgencyPortal.tsx`

### Oversight And Insights

- [Agency Scorecard](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/StatsDashboard.tsx): `src/components/StatsDashboard.tsx`

### Shared Platform

- [Issue And Profile Data](https://github.com/rishisinhasly7/citypulse/blob/main/src/utils/db.ts): `src/utils/db.ts`
- **Firestore**
- [Firebase Setup](https://github.com/rishisinhasly7/citypulse/blob/main/src/firebase.ts): `src/firebase.ts`
- [Sample Issue Records](https://github.com/rishisinhasly7/citypulse/blob/main/src/initialData.ts): `src/initialData.ts`
- [Civic Domain Types](https://github.com/rishisinhasly7/citypulse/blob/main/src/types.ts): `src/types.ts`
- [Language Context](https://github.com/rishisinhasly7/citypulse/blob/main/src/components/LanguageContext.tsx): `src/components/LanguageContext.tsx`
- [English And Hindi Text](https://github.com/rishisinhasly7/citypulse/blob/main/src/utils/translation.ts): `src/utils/translation.ts`

### Other components

- **Portal User**

## Connections

- Portal User → Portal Coordinator: uses portal
- Portal Coordinator → Issue Intake: opens intake (evidence: `src/App.tsx`)
- Issue Intake → Portal Coordinator: submits report (evidence: `src/App.tsx`)
- Portal Coordinator → Issue And Profile Data: registers issue (evidence: `src/App.tsx`)
- Issue And Profile Data → Firestore: reads and writes (evidence: `src/utils/db.ts`)
- Issue And Profile Data → Firebase Setup: uses database setup (evidence: `src/utils/db.ts`)
- Firebase Setup → Firestore: initializes (evidence: `src/firebase.ts`)
- Issue And Profile Data → Sample Issue Records: seeds empty store (evidence: `src/utils/db.ts`)
- Portal Coordinator → Agency Workspace: shows workspace (evidence: `src/App.tsx`)
- Agency Workspace → Firestore: updates complaints
- Portal Coordinator → Firestore: confirms resolution (evidence: `src/App.tsx`)
- Portal Coordinator → Civic Map: shows issue map (evidence: `src/App.tsx`)
- Portal Coordinator → Issue Card: shows issue details (evidence: `src/App.tsx`)
- Portal Coordinator → Agency Scorecard: shows scorecard (evidence: `src/App.tsx`)
- Portal Coordinator → Manual Location: offers manual location (evidence: `src/App.tsx`)
- Portal Coordinator → Issue And Profile Data: verifies profile (evidence: `src/App.tsx`)
- Issue Intake → Language Context: reads translations (evidence: `src/components/ReportIssueModal.tsx`)
- Issue Card → Language Context: reads translations (evidence: `src/components/IssueCard.tsx`)
- Civic Map → Language Context: reads translations (evidence: `src/components/CivicMapAnimation.tsx`)
- Language Context → English And Hindi Text: selects language text (evidence: `src/components/LanguageContext.tsx`)
- Issue And Profile Data → Civic Domain Types: uses domain records (evidence: `src/utils/db.ts`)
- Portal Coordinator → Civic Domain Types: uses issue records (evidence: `src/App.tsx`)
- Agency Workspace → Civic Domain Types: uses issue records (evidence: `src/components/AgencyPortal.tsx`)
