# millenium-l/emergency-response architecture

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

- Interactive diagram: https://gitdiagram.com/millenium-l/emergency-response
- Repository: https://github.com/millenium-l/emergency-response

## Overview

ERS is a Django emergency-reporting and coordination application. Public users register and submit incidents; staff manage incidents and responder assignments, while responders accept or reject requests and update response status. The main runtime is Django views and forms over the domain models, with signals creating assignment notifications and a scheduled job expiring unanswered requests. The README documents dashboards, department management, geographic views, and administrative notifications; some of those implementations are only partially sampled, so their internal links are omitted or marked unverified.

Main entry points: [`emergencyresponse_pr/emergencyresponse_app/views.py`](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/views.py) (Incident Views), [`emergencyresponse_pr/emergencyresponse_app/scheduler.py`](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/scheduler.py) (Expiry Scheduler), [`emergencyresponse_pr/emergencyresponse_app/models.py`](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py) (Incident Records), [`emergencyresponse_pr/emergencyresponse_app/apps.py`](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/apps.py) (App Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; Access"]
  node_account_views["Account Views<br/>[views.py]"]
  node_account_forms["Registration Form<br/>[forms.py]"]
end

subgraph group_operations["Incident Operations"]
  node_incident_views["Incident Views<br/>[views.py]"]
  node_incident_forms["Incident Forms<br/>[forms.py]"]
  node_incident_data[("Incident Records<br/>[models.py]")]
  node_map_assets["Map Interface<br/>[leaflet.js]"]
end

subgraph group_coordination["Responder Coordination"]
  node_responder_ops["Responder &amp; Assignment<br/>[views.py]"]
  node_response_history[("Response History<br/>[models.py]")]
end

subgraph group_platform["Notifications &amp; Scheduling"]
  node_notification_records[("Notification Records<br/>[models.py]")]
  node_assignment_signals["Assignment Signals<br/>[signals.py]"]
  node_expiry_scheduler["Expiry Scheduler<br/>[scheduler.py]"]
  node_app_startup["App Startup<br/>[apps.py]"]
end

node_public(("Public User"))
node_responder_actor(("Responder"))
node_dept_admin(("Department Admin"))
node_super_admin(("Super Admin"))

node_public -->|"registers or logs in"| node_account_views
node_account_views -->|"validates registration"| node_account_forms
node_public -->|"reports incidents"| node_incident_views
node_dept_admin -->|"manages incidents"| node_incident_views
node_super_admin -->|"oversees incidents"| node_incident_views
node_responder_actor -->|"handles assignments"| node_responder_ops
node_incident_views -->|"validates reports"| node_incident_forms
node_incident_views -->|"creates and updates"| node_incident_data
node_responder_ops -->|"queries and assigns"| node_incident_data
node_responder_ops -.->|"records response actions"| node_response_history
node_assignment_signals -->|"creates notifications"| node_notification_records
node_expiry_scheduler -->|"expires requests"| node_incident_data
node_expiry_scheduler -->|"records expiry alerts"| node_notification_records
node_app_startup -->|"loads signals"| node_assignment_signals
node_app_startup -->|"starts scheduler"| node_expiry_scheduler
node_responder_ops -->|"reads responder alerts"| node_notification_records
node_incident_views -.->|"uses geographic views"| node_map_assets

click node_account_views "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/accounts/views.py"
click node_account_forms "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/accounts/forms.py"
click node_incident_views "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/views.py"
click node_incident_forms "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/forms.py"
click node_incident_data "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py"
click node_responder_ops "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/views.py"
click node_response_history "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py"
click node_notification_records "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py"
click node_assignment_signals "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/signals.py"
click node_expiry_scheduler "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/scheduler.py"
click node_app_startup "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/apps.py"
click node_map_assets "https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/static/js/leaflet.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_account_views,node_account_forms,node_public toneBlue
class node_incident_views,node_incident_forms,node_incident_data,node_map_assets toneAmber
class node_responder_ops,node_response_history toneMint
class node_notification_records,node_assignment_signals,node_expiry_scheduler,node_app_startup toneRose
class node_responder_actor,node_dept_admin,node_super_admin toneIndigo
```

## Components

### Identity & Access

- [Account Views](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/accounts/views.py): `emergencyresponse_pr/accounts/views.py`
- [Registration Form](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/accounts/forms.py): `emergencyresponse_pr/accounts/forms.py`

### Incident Operations

- [Incident Views](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/views.py): `emergencyresponse_pr/emergencyresponse_app/views.py`
- [Incident Forms](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/forms.py): `emergencyresponse_pr/emergencyresponse_app/forms.py`
- [Incident Records](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py): `emergencyresponse_pr/emergencyresponse_app/models.py`
- [Map Interface](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/static/js/leaflet.js): `emergencyresponse_pr/static/js/leaflet.js`

### Responder Coordination

- [Responder & Assignment](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/views.py): `emergencyresponse_pr/emergencyresponse_app/views.py`
- [Response History](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py): `emergencyresponse_pr/emergencyresponse_app/models.py`

### Notifications & Scheduling

- [Notification Records](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/models.py): `emergencyresponse_pr/emergencyresponse_app/models.py`
- [Assignment Signals](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/signals.py): `emergencyresponse_pr/emergencyresponse_app/signals.py`
- [Expiry Scheduler](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/scheduler.py): `emergencyresponse_pr/emergencyresponse_app/scheduler.py`
- [App Startup](https://github.com/millenium-l/emergency-response/blob/main/emergencyresponse_pr/emergencyresponse_app/apps.py): `emergencyresponse_pr/emergencyresponse_app/apps.py`

### Other components

- **Public User**
- **Responder**
- **Department Admin**
- **Super Admin**

## Connections

- Public User → Account Views: registers or logs in
- Account Views → Registration Form: validates registration (evidence: `emergencyresponse_pr/accounts/views.py`)
- Public User → Incident Views: reports incidents
- Department Admin → Incident Views: manages incidents
- Super Admin → Incident Views: oversees incidents
- Responder → Responder & Assignment: handles assignments
- Incident Views → Incident Forms: validates reports (evidence: `emergencyresponse_pr/emergencyresponse_app/views.py`)
- Incident Views → Incident Records: creates and updates (evidence: `emergencyresponse_pr/emergencyresponse_app/views.py`)
- Responder & Assignment → Incident Records: queries and assigns (evidence: `emergencyresponse_pr/emergencyresponse_app/views.py`)
- Responder & Assignment → Response History: records response actions (evidence: `emergencyresponse_pr/emergencyresponse_app/views.py`)
- Assignment Signals → Notification Records: creates notifications (evidence: `emergencyresponse_pr/emergencyresponse_app/signals.py`)
- Expiry Scheduler → Incident Records: expires requests (evidence: `emergencyresponse_pr/emergencyresponse_app/scheduler.py`)
- Expiry Scheduler → Notification Records: records expiry alerts (evidence: `emergencyresponse_pr/emergencyresponse_app/scheduler.py`)
- App Startup → Assignment Signals: loads signals (evidence: `emergencyresponse_pr/emergencyresponse_app/apps.py`)
- App Startup → Expiry Scheduler: starts scheduler (evidence: `emergencyresponse_pr/emergencyresponse_app/apps.py`)
- Responder & Assignment → Notification Records: reads responder alerts (evidence: `emergencyresponse_pr/emergencyresponse_app/views.py`)
- Incident Views → Map Interface: uses geographic views
