# aisha-jawed/disaster_management architecture

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

- Interactive diagram: https://gitdiagram.com/aisha-jawed/disaster_management
- Repository: https://github.com/aisha-jawed/disaster_management

## Overview

ResQNet coordinates disaster reports and victim rescue: citizens submit emergencies or incidents, while volunteers, NGOs, and administrators use role-specific portals to review needs, assign responders, and track status. The React app routes these workflows to an Express API, which applies access controls and priority scoring and persists records in MongoDB; Socket.IO broadcasts selected updates. The graph preserves the documented NGO, admin, dashboard, and registration capabilities, but several page and route implementations were not sampled, so their internal links are limited to documented routing or mounting evidence.

Main entry points: [`Disaster/src/App.js`](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/App.js) (Route application), [`backend/server.js`](https://github.com/aisha-jawed/disaster_management/blob/main/backend/server.js) (Express and Socket.IO), [`backend/routes/victims.js`](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/victims.js) (Victim workflows), [`backend/routes/incidents.js`](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/incidents.js) (Incident workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route application<br/>[App.js]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_dashboard["Public dashboard<br/>[Dashboard.jsx]"]
  node_sos["Emergency registration<br/>[SOS.jsx]"]
  node_reports["Incident reports<br/>[Reports.jsx]"]
  node_status["Victim status<br/>[VictimStatus.jsx]"]
  node_volunteer_ui["Volunteer portal<br/>[Volunteer.jsx]"]
  node_ngo_ui["NGO portal<br/>[NGO.jsx]"]
  node_admin_ui["Admin dashboard<br/>[Admin.jsx]"]
  node_register_ui["Account registration<br/>[RegisterPage.jsx]"]
  node_client_api["HTTP client<br/>[api.js]"]
  node_victim_service["Victim API service<br/>[victimService.js]"]
  node_report_hook["Report feed hook<br/>[useReportsMongo.js]"]
  node_priority_ui["Client priority scoring<br/>[priority.js]"]
end

subgraph group_api["API and coordination"]
  node_server["Express and Socket.IO<br/>[server.js]"]
  node_auth["JWT and role checks<br/>[auth.js]"]
  node_priority_backend["Priority scoring<br/>[priority.js]"]
end

subgraph group_response["Response workflows"]
  node_victim_routes["Victim workflows<br/>[victims.js]"]
  node_incident_routes["Incident workflows<br/>[incidents.js]"]
  node_volunteer_routes["Volunteer tasks<br/>[volunteers.js]"]
  node_ngo_routes["NGO operations<br/>[ngos.js]"]
  node_admin_routes["Administration API<br/>[admin.js]"]
  node_dashboard_routes["Dashboard incident feed"]
end

subgraph group_data["Persistence and scoring"]
  node_victim_model[("Victim records<br/>[Victim.js]")]
  node_incident_model[("Incident records<br/>[Incident.js]")]
  node_volunteer_model[("Volunteer records<br/>[Volunteer.js]")]
  node_ngo_model[("NGO records<br/>[NGO.js]")]
  node_mongo[("MongoDB")]
end

node_citizen(("Citizen"))
node_responder(("Volunteer / NGO"))
node_administrator(("Administrator"))

node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_sos
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_status
node_app -->|"routes to"| node_volunteer_ui
node_app -->|"routes to"| node_ngo_ui
node_app -->|"routes to"| node_admin_ui
node_citizen -.->|"submits request"| node_sos
node_citizen -.->|"checks status"| node_status
node_responder -.->|"uses portal"| node_volunteer_ui
node_responder -.->|"uses portal"| node_ngo_ui
node_administrator -.->|"uses portal"| node_admin_ui
node_admin_ui -->|"assigns volunteer"| node_victim_service
node_victim_service -->|"sends requests"| node_client_api
node_victim_service -->|"calls victim endpoints"| node_victim_routes
node_report_hook -->|"scores reports"| node_priority_ui
node_server -->|"mounts"| node_victim_routes
node_server -->|"mounts"| node_incident_routes
node_server -->|"mounts"| node_volunteer_routes
node_server -->|"mounts"| node_ngo_routes
node_server -->|"mounts"| node_admin_routes
node_server -->|"mounts"| node_dashboard_routes
node_server -->|"connects"| node_mongo
node_victim_routes -->|"reads and writes"| node_victim_model
node_victim_routes -->|"calculates priority"| node_priority_backend
node_victim_routes -->|"guards routes"| node_auth
node_incident_routes -->|"reads and writes"| node_incident_model
node_incident_routes -->|"calculates priority"| node_priority_backend
node_incident_routes -->|"guards routes"| node_auth
node_volunteer_routes -->|"loads rescue tasks"| node_victim_model
node_volunteer_routes -->|"reads and updates"| node_volunteer_model
node_volunteer_routes -->|"guards routes"| node_auth
node_ngo_routes -->|"uses records"| node_ngo_model
node_ngo_routes -->|"guards routes"| node_auth
node_victim_model -.->|"persists"| node_mongo
node_incident_model -.->|"persists"| node_mongo
node_volunteer_model -.->|"persists"| node_mongo
node_ngo_model -.->|"persists"| node_mongo

click node_app "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/App.js"
click node_navbar "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/components/Navbar.jsx"
click node_dashboard "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Dashboard.jsx"
click node_sos "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/SOS.jsx"
click node_reports "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Reports.jsx"
click node_status "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/VictimStatus.jsx"
click node_volunteer_ui "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Volunteer.jsx"
click node_ngo_ui "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/NGO.jsx"
click node_admin_ui "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Admin.jsx"
click node_register_ui "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/RegisterPage.jsx"
click node_client_api "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/api/api.js"
click node_victim_service "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/api/victimService.js"
click node_report_hook "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/hooks/useReportsMongo.js"
click node_priority_ui "https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/utils/priority.js"
click node_server "https://github.com/aisha-jawed/disaster_management/blob/main/backend/server.js"
click node_victim_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/victims.js"
click node_incident_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/incidents.js"
click node_volunteer_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/volunteers.js"
click node_ngo_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/ngos.js"
click node_admin_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/admin.js"
click node_dashboard_routes "https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/dashboardIncidents.js"
click node_auth "https://github.com/aisha-jawed/disaster_management/blob/main/backend/middleware/auth.js"
click node_priority_backend "https://github.com/aisha-jawed/disaster_management/blob/main/backend/middleware/priority.js"
click node_victim_model "https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Victim.js"
click node_incident_model "https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Incident.js"
click node_volunteer_model "https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Volunteer.js"
click node_ngo_model "https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/NGO.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_app,node_navbar,node_dashboard,node_sos,node_reports,node_status,node_volunteer_ui,node_ngo_ui,node_admin_ui,node_register_ui,node_client_api,node_victim_service,node_report_hook,node_priority_ui toneBlue
class node_server,node_auth,node_priority_backend toneAmber
class node_victim_routes,node_incident_routes,node_volunteer_routes,node_ngo_routes,node_admin_routes,node_dashboard_routes toneMint
class node_victim_model,node_incident_model,node_volunteer_model,node_ngo_model,node_mongo toneRose
class node_citizen,node_responder,node_administrator toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/App.js): `Disaster/src/App.js`
- [Navigation](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/components/Navbar.jsx): `Disaster/src/components/Navbar.jsx`
- [Public dashboard](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Dashboard.jsx): `Disaster/src/pages/Dashboard.jsx`
- [Emergency registration](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/SOS.jsx): `Disaster/src/pages/SOS.jsx`
- [Incident reports](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Reports.jsx): `Disaster/src/pages/Reports.jsx`
- [Victim status](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/VictimStatus.jsx): `Disaster/src/pages/VictimStatus.jsx`
- [Volunteer portal](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Volunteer.jsx): `Disaster/src/pages/Volunteer.jsx`
- [NGO portal](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/NGO.jsx): `Disaster/src/pages/NGO.jsx`
- [Admin dashboard](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/Admin.jsx): `Disaster/src/pages/Admin.jsx`
- [Account registration](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/pages/RegisterPage.jsx): `Disaster/src/pages/RegisterPage.jsx`
- [HTTP client](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/api/api.js): `Disaster/src/api/api.js`
- [Victim API service](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/api/victimService.js): `Disaster/src/api/victimService.js`
- [Report feed hook](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/hooks/useReportsMongo.js): `Disaster/src/hooks/useReportsMongo.js`
- [Client priority scoring](https://github.com/aisha-jawed/disaster_management/blob/main/Disaster/src/utils/priority.js): `Disaster/src/utils/priority.js`

### API and coordination

- [Express and Socket.IO](https://github.com/aisha-jawed/disaster_management/blob/main/backend/server.js): `backend/server.js`
- [JWT and role checks](https://github.com/aisha-jawed/disaster_management/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Priority scoring](https://github.com/aisha-jawed/disaster_management/blob/main/backend/middleware/priority.js): `backend/middleware/priority.js`

### Response workflows

- [Victim workflows](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/victims.js): `backend/routes/victims.js`
- [Incident workflows](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/incidents.js): `backend/routes/incidents.js`
- [Volunteer tasks](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/volunteers.js): `backend/routes/volunteers.js`
- [NGO operations](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/ngos.js): `backend/routes/ngos.js`
- [Administration API](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/admin.js): `backend/routes/admin.js`
- [Dashboard incident feed](https://github.com/aisha-jawed/disaster_management/blob/main/backend/routes/dashboardIncidents.js): `backend/routes/dashboardIncidents.js`

### Persistence and scoring

- [Victim records](https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Victim.js): `backend/models/Victim.js`
- [Incident records](https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Incident.js): `backend/models/Incident.js`
- [Volunteer records](https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/Volunteer.js): `backend/models/Volunteer.js`
- [NGO records](https://github.com/aisha-jawed/disaster_management/blob/main/backend/models/NGO.js): `backend/models/NGO.js`
- **MongoDB**

### Other components

- **Citizen**
- **Volunteer / NGO**
- **Administrator**

## Connections

- Route application → Navigation: renders (evidence: `Disaster/src/App.js`)
- Route application → Public dashboard: routes to (evidence: `Disaster/src/App.js`)
- Route application → Emergency registration: routes to (evidence: `Disaster/src/App.js`)
- Route application → Incident reports: routes to (evidence: `Disaster/src/App.js`)
- Route application → Victim status: routes to (evidence: `Disaster/src/App.js`)
- Route application → Volunteer portal: routes to (evidence: `Disaster/src/App.js`)
- Route application → NGO portal: routes to (evidence: `Disaster/src/App.js`)
- Route application → Admin dashboard: routes to (evidence: `Disaster/src/App.js`)
- Citizen → Emergency registration: submits request
- Citizen → Victim status: checks status
- Volunteer / NGO → Volunteer portal: uses portal
- Volunteer / NGO → NGO portal: uses portal
- Administrator → Admin dashboard: uses portal
- Admin dashboard → Victim API service: assigns volunteer (evidence: `Disaster/src/pages/Admin.jsx`)
- Victim API service → HTTP client: sends requests (evidence: `Disaster/src/api/victimService.js`)
- Victim API service → Victim workflows: calls victim endpoints (evidence: `Disaster/src/api/victimService.js`)
- Report feed hook → Client priority scoring: scores reports (evidence: `Disaster/src/hooks/useReportsMongo.js`)
- Express and Socket.IO → Victim workflows: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → Incident workflows: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → Volunteer tasks: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → NGO operations: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → Administration API: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → Dashboard incident feed: mounts (evidence: `backend/server.js`)
- Express and Socket.IO → MongoDB: connects (evidence: `backend/server.js`)
- Victim workflows → Victim records: reads and writes (evidence: `backend/routes/victims.js`)
- Victim workflows → Priority scoring: calculates priority (evidence: `backend/routes/victims.js`)
- Victim workflows → JWT and role checks: guards routes (evidence: `backend/routes/victims.js`)
- Incident workflows → Incident records: reads and writes (evidence: `backend/routes/incidents.js`)
- Incident workflows → Priority scoring: calculates priority (evidence: `backend/routes/incidents.js`)
- Incident workflows → JWT and role checks: guards routes (evidence: `backend/routes/incidents.js`)
- Volunteer tasks → Victim records: loads rescue tasks (evidence: `backend/routes/volunteers.js`)
- Volunteer tasks → Volunteer records: reads and updates (evidence: `backend/routes/volunteers.js`)
- Volunteer tasks → JWT and role checks: guards routes (evidence: `backend/routes/volunteers.js`)
- NGO operations → NGO records: uses records (evidence: `backend/routes/ngos.js`)
- NGO operations → JWT and role checks: guards routes (evidence: `backend/routes/ngos.js`)
- Victim records → MongoDB: persists (evidence: `README.md`)
- Incident records → MongoDB: persists (evidence: `README.md`)
- Volunteer records → MongoDB: persists (evidence: `README.md`)
- NGO records → MongoDB: persists (evidence: `README.md`)
