# response-central/emergency-responsestarter architecture

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

- Interactive diagram: https://gitdiagram.com/response-central/emergency-responsestarter
- Repository: https://github.com/response-central/emergency-responsestarter

## Overview

This is a starter emergency-reporting dashboard: a user views incidents or submits a report, which the Flask API validates and saves as a location, emergency call, and incident; the dashboard can then read incident details. The React app also checks API health. The README explicitly says the system does not contact emergency services and that assignment and login are future work. The sampled source shows the API’s PostgreSQL queries and connection helper; the schema file is documented but was not sampled, so its internal details are not expanded here.

Main entry points: [`app.py`](https://github.com/response-central/emergency-responsestarter/blob/main/app.py) (Incident listing), [`src/App.jsx`](https://github.com/response-central/emergency-responsestarter/blob/main/src/App.jsx) (Dashboard view), [`database.py`](https://github.com/response-central/emergency-responsestarter/blob/main/database.py) (DB connection), [`src/main.jsx`](https://github.com/response-central/emergency-responsestarter/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_entry["React entry<br/>[main.jsx]"]
  node_dashboard["Dashboard view<br/>[App.jsx]"]
  node_reportform["Report form<br/>[App.jsx]"]
end

subgraph group_api["Flask API"]
  node_health["Health endpoint<br/>[app.py]"]
  node_incidentlist["Incident listing<br/>[app.py]"]
  node_reportapi["Report submission<br/>[app.py]"]
end

subgraph group_persistence["PostgreSQL persistence"]
  node_connection["DB connection<br/>[database.py]"]
  node_location[("Location records<br/>[schema.sql]")]
  node_emergencycall[("Emergency calls<br/>[schema.sql]")]
  node_incident[("Incident records<br/>[schema.sql]")]
end

node_user(("User"))
node_browser(("Web browser"))
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_entry
node_entry -->|"renders"| node_dashboard
node_user -->|"submits"| node_reportform
node_reportform -->|"posts report"| node_reportapi
node_dashboard -->|"loads incidents"| node_incidentlist
node_dashboard -->|"checks health"| node_health
node_reportapi -->|"opens connection"| node_connection
node_incidentlist -->|"opens connection"| node_connection
node_connection -->|"connects"| node_postgres
node_reportapi -->|"inserts"| node_location
node_reportapi -->|"inserts"| node_emergencycall
node_reportapi -->|"inserts"| node_incident
node_incidentlist -->|"queries"| node_incident
node_incidentlist -->|"joins"| node_emergencycall
node_incidentlist -->|"joins"| node_location

click node_entry "https://github.com/response-central/emergency-responsestarter/blob/main/src/main.jsx"
click node_dashboard "https://github.com/response-central/emergency-responsestarter/blob/main/src/App.jsx"
click node_reportform "https://github.com/response-central/emergency-responsestarter/blob/main/src/App.jsx"
click node_health "https://github.com/response-central/emergency-responsestarter/blob/main/app.py"
click node_incidentlist "https://github.com/response-central/emergency-responsestarter/blob/main/app.py"
click node_reportapi "https://github.com/response-central/emergency-responsestarter/blob/main/app.py"
click node_connection "https://github.com/response-central/emergency-responsestarter/blob/main/database.py"
click node_location "https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql"
click node_emergencycall "https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql"
click node_incident "https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql"

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_entry,node_dashboard,node_reportform,node_user,node_browser toneBlue
class node_health,node_incidentlist,node_reportapi,node_postgres toneAmber
class node_connection,node_location,node_emergencycall,node_incident toneMint
```

## Components

### React frontend

- [React entry](https://github.com/response-central/emergency-responsestarter/blob/main/src/main.jsx): `src/main.jsx`
- [Dashboard view](https://github.com/response-central/emergency-responsestarter/blob/main/src/App.jsx): `src/App.jsx`
- [Report form](https://github.com/response-central/emergency-responsestarter/blob/main/src/App.jsx): `src/App.jsx`

### Flask API

- [Health endpoint](https://github.com/response-central/emergency-responsestarter/blob/main/app.py): `app.py`
- [Incident listing](https://github.com/response-central/emergency-responsestarter/blob/main/app.py): `app.py`
- [Report submission](https://github.com/response-central/emergency-responsestarter/blob/main/app.py): `app.py`

### PostgreSQL persistence

- [DB connection](https://github.com/response-central/emergency-responsestarter/blob/main/database.py): `database.py`
- [Location records](https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql): `database/schema.sql`
- [Emergency calls](https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql): `database/schema.sql`
- [Incident records](https://github.com/response-central/emergency-responsestarter/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **User**
- **Web browser**
- **PostgreSQL**

## Connections

- User → Web browser: uses (evidence: `README.md`)
- Web browser → React entry: opens (evidence: `README.md`)
- React entry → Dashboard view: renders (evidence: `src/main.jsx`)
- User → Report form: submits (evidence: `src/App.jsx`)
- Report form → Report submission: posts report (evidence: `src/App.jsx`)
- Dashboard view → Incident listing: loads incidents (evidence: `src/App.jsx`)
- Dashboard view → Health endpoint: checks health (evidence: `src/App.jsx`)
- Report submission → DB connection: opens connection (evidence: `app.py`)
- Incident listing → DB connection: opens connection (evidence: `app.py`)
- DB connection → PostgreSQL: connects (evidence: `database.py`)
- Report submission → Location records: inserts (evidence: `app.py`)
- Report submission → Emergency calls: inserts (evidence: `app.py`)
- Report submission → Incident records: inserts (evidence: `app.py`)
- Incident listing → Incident records: queries (evidence: `app.py`)
- Incident listing → Emergency calls: joins (evidence: `app.py`)
- Incident listing → Location records: joins (evidence: `app.py`)
