# khushbu677/disaster_management architecture

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

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

## Overview

ResQNet coordinates victim registration and rescue-status tracking with incident reporting, prioritization, volunteer task handling, NGO aid offers, and administration. The React application routes users to role-specific screens, whose API services communicate with an Express backend; backend routes enforce access rules and operate on MongoDB models. The README also documents maps, priority-sorted dashboards, and live updates. Some frontend integrations and role workflows are unsampled, so their links are omitted where source evidence is unavailable.

Main entry points: [`backend/server.js`](https://github.com/khushbu677/disaster_management/blob/main/backend/server.js) (Express and Socket server), [`Disaster/src/App.js`](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/App.js) (App routes), [`Disaster/src/api/api.js`](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/api.js) (Axios API client), [`Disaster/src/pages/Admin.jsx`](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Admin.jsx) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React application"]
  node_app_routes["App routes<br/>[App.js]"]
  node_victim_portal["Victim registration and status<br/>[SOS.jsx]"]
  node_status_page["Status tracker<br/>[VictimStatus.jsx]"]
  node_volunteer_page["Volunteer portal<br/>[Volunteer.jsx]"]
  node_ngo_page["NGO portal<br/>[NGO.jsx]"]
  node_admin_page["Admin operations<br/>[Admin.jsx]"]
  node_dashboard_page["Incident dashboard<br/>[Dashboard.jsx]"]
  node_reports_page["Incident reports<br/>[Reports.jsx]"]
  node_map_view["Incident map<br/>[MapView.jsx]"]
  node_report_form["Incident report form<br/>[ReportForm.jsx]"]
  node_priority_ui["Priority scoring<br/>[priority.js]"]
end

subgraph group_client_api["API client"]
  node_victim_service["Victim API service<br/>[victimService.js]"]
  node_volunteer_service["Volunteer API service"]
  node_ngo_service["NGO API service<br/>[ngoService.js]"]
  node_admin_service["Admin API service<br/>[adminService.js]"]
  node_dashboard_service["Dashboard API service"]
  node_api_client["Axios API client<br/>[api.js]"]
end

subgraph group_backend["Backend services"]
  node_server["Express and Socket server<br/>[server.js]"]
  node_victim_routes["Victim routes<br/>[victims.js]"]
  node_volunteer_routes["Volunteer routes<br/>[volunteers.js]"]
  node_ngo_routes["NGO routes<br/>[ngos.js]"]
  node_incident_routes["Incident routes<br/>[incidents.js]"]
  node_dashboard_routes["Dashboard incident routes"]
  node_admin_routes["Admin routes<br/>[admin.js]"]
  node_auth["JWT and role checks<br/>[auth.js]"]
  node_priority_backend["Priority calculations<br/>[priority.js]"]
  node_db_config["Database connection<br/>[db.js]"]
end

subgraph group_domain_data["Rescue domain and data"]
  node_victim_model["Victim records<br/>[Victim.js]"]
  node_volunteer_model["Volunteer records<br/>[Volunteer.js]"]
  node_ngo_model["NGO records<br/>[NGO.js]"]
  node_incident_model["Incident records<br/>[Incident.js]"]
end

node_user(("Victim, responders, admin"))
node_mongo[("MongoDB")]

node_user -->|"uses"| node_app_routes
node_app_routes -->|"routes to"| node_dashboard_page
node_app_routes -->|"routes to"| node_victim_portal
node_app_routes -->|"routes to"| node_status_page
node_app_routes -->|"routes to"| node_volunteer_page
node_app_routes -->|"routes to"| node_ngo_page
node_app_routes -->|"routes to"| node_admin_page
node_app_routes -->|"routes to"| node_reports_page
node_victim_portal -->|"submits registration"| node_victim_service
node_status_page -->|"checks status"| node_victim_service
node_volunteer_page -->|"requests tasks"| node_volunteer_service
node_ngo_page -->|"uses"| node_ngo_service
node_admin_page -->|"uses"| node_admin_service
node_admin_page -->|"assigns responders"| node_victim_service
node_admin_page -->|"loads dashboard"| node_dashboard_service
node_dashboard_page -->|"loads incidents"| node_dashboard_service
node_reports_page -->|"loads incidents"| node_dashboard_service
node_dashboard_page -.->|"renders"| node_map_view
node_dashboard_page -.->|"offers reporting"| node_report_form
node_victim_service -->|"sends requests"| node_api_client
node_volunteer_service -->|"sends requests"| node_api_client
node_ngo_service -->|"sends requests"| node_api_client
node_admin_service -->|"sends requests"| node_api_client
node_dashboard_service -->|"sends requests"| node_api_client
node_api_client -.->|"calls REST API"| node_server
node_server -->|"connects through"| node_db_config
node_db_config -->|"connects"| node_mongo
node_server -->|"mounts"| node_victim_routes
node_server -->|"mounts"| node_volunteer_routes
node_server -->|"mounts"| node_ngo_routes
node_server -->|"mounts"| node_incident_routes
node_server -->|"mounts"| node_dashboard_routes
node_server -->|"mounts"| node_admin_routes
node_server -->|"queries reports"| node_incident_model
node_victim_routes -->|"reads and writes"| node_victim_model
node_victim_routes -->|"calculates score"| node_priority_backend
node_victim_routes -->|"protects routes"| node_auth
node_volunteer_routes -->|"uses records"| node_volunteer_model
node_volunteer_routes -->|"uses records"| node_victim_model
node_volunteer_routes -->|"protects routes"| node_auth
node_ngo_routes -->|"uses records"| node_ngo_model
node_ngo_routes -->|"protects routes"| node_auth
node_incident_routes -->|"uses records"| node_incident_model
node_incident_routes -->|"calculates score"| node_priority_backend
node_incident_routes -->|"protects routes"| node_auth
node_dashboard_routes -->|"queries incidents"| node_incident_model
node_dashboard_routes -->|"uses scoring"| node_priority_backend
node_admin_routes -->|"uses records"| node_victim_model

click node_app_routes "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/App.js"
click node_victim_portal "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/SOS.jsx"
click node_status_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/VictimStatus.jsx"
click node_volunteer_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Volunteer.jsx"
click node_ngo_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/NGO.jsx"
click node_admin_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Admin.jsx"
click node_dashboard_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Dashboard.jsx"
click node_reports_page "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Reports.jsx"
click node_map_view "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/components/MapView.jsx"
click node_report_form "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/components/ReportForm.jsx"
click node_priority_ui "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/utils/priority.js"
click node_victim_service "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/victimService.js"
click node_volunteer_service "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/volunteerService.js"
click node_ngo_service "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/ngoService.js"
click node_admin_service "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/adminService.js"
click node_dashboard_service "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/dashboardService.js"
click node_api_client "https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/api.js"
click node_server "https://github.com/khushbu677/disaster_management/blob/main/backend/server.js"
click node_victim_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/victims.js"
click node_volunteer_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/volunteers.js"
click node_ngo_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/ngos.js"
click node_incident_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/incidents.js"
click node_dashboard_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/dashboardIncidents.js"
click node_admin_routes "https://github.com/khushbu677/disaster_management/blob/main/backend/routes/admin.js"
click node_auth "https://github.com/khushbu677/disaster_management/blob/main/backend/middleware/auth.js"
click node_priority_backend "https://github.com/khushbu677/disaster_management/blob/main/backend/middleware/priority.js"
click node_victim_model "https://github.com/khushbu677/disaster_management/blob/main/backend/models/Victim.js"
click node_volunteer_model "https://github.com/khushbu677/disaster_management/blob/main/backend/models/Volunteer.js"
click node_ngo_model "https://github.com/khushbu677/disaster_management/blob/main/backend/models/NGO.js"
click node_incident_model "https://github.com/khushbu677/disaster_management/blob/main/backend/models/Incident.js"
click node_db_config "https://github.com/khushbu677/disaster_management/blob/main/backend/config/db.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_routes,node_victim_portal,node_status_page,node_volunteer_page,node_ngo_page,node_admin_page,node_dashboard_page,node_reports_page,node_map_view,node_report_form,node_priority_ui toneBlue
class node_victim_service,node_volunteer_service,node_ngo_service,node_admin_service,node_dashboard_service,node_api_client,node_mongo toneAmber
class node_server,node_victim_routes,node_volunteer_routes,node_ngo_routes,node_incident_routes,node_dashboard_routes,node_admin_routes,node_auth,node_priority_backend,node_db_config toneMint
class node_victim_model,node_volunteer_model,node_ngo_model,node_incident_model toneRose
class node_user toneIndigo
```

## Components

### React application

- [App routes](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/App.js): `Disaster/src/App.js`
- [Victim registration and status](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/SOS.jsx): `Disaster/src/pages/SOS.jsx`
- [Status tracker](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/VictimStatus.jsx): `Disaster/src/pages/VictimStatus.jsx`
- [Volunteer portal](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Volunteer.jsx): `Disaster/src/pages/Volunteer.jsx`
- [NGO portal](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/NGO.jsx): `Disaster/src/pages/NGO.jsx`
- [Admin operations](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Admin.jsx): `Disaster/src/pages/Admin.jsx`
- [Incident dashboard](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Dashboard.jsx): `Disaster/src/pages/Dashboard.jsx`
- [Incident reports](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/pages/Reports.jsx): `Disaster/src/pages/Reports.jsx`
- [Incident map](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/components/MapView.jsx): `Disaster/src/components/MapView.jsx`
- [Incident report form](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/components/ReportForm.jsx): `Disaster/src/components/ReportForm.jsx`
- [Priority scoring](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/utils/priority.js): `Disaster/src/utils/priority.js`

### API client

- [Victim API service](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/victimService.js): `Disaster/src/api/victimService.js`
- [Volunteer API service](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/volunteerService.js): `Disaster/src/api/volunteerService.js`
- [NGO API service](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/ngoService.js): `Disaster/src/api/ngoService.js`
- [Admin API service](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/adminService.js): `Disaster/src/api/adminService.js`
- [Dashboard API service](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/dashboardService.js): `Disaster/src/api/dashboardService.js`
- [Axios API client](https://github.com/khushbu677/disaster_management/blob/main/Disaster/src/api/api.js): `Disaster/src/api/api.js`

### Backend services

- [Express and Socket server](https://github.com/khushbu677/disaster_management/blob/main/backend/server.js): `backend/server.js`
- [Victim routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/victims.js): `backend/routes/victims.js`
- [Volunteer routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/volunteers.js): `backend/routes/volunteers.js`
- [NGO routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/ngos.js): `backend/routes/ngos.js`
- [Incident routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/incidents.js): `backend/routes/incidents.js`
- [Dashboard incident routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/dashboardIncidents.js): `backend/routes/dashboardIncidents.js`
- [Admin routes](https://github.com/khushbu677/disaster_management/blob/main/backend/routes/admin.js): `backend/routes/admin.js`
- [JWT and role checks](https://github.com/khushbu677/disaster_management/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Priority calculations](https://github.com/khushbu677/disaster_management/blob/main/backend/middleware/priority.js): `backend/middleware/priority.js`
- [Database connection](https://github.com/khushbu677/disaster_management/blob/main/backend/config/db.js): `backend/config/db.js`

### Rescue domain and data

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

### Other components

- **Victim, responders, admin**
- **MongoDB**

## Connections

- Victim, responders, admin → App routes: uses (evidence: `Disaster/src/App.js`)
- App routes → Incident dashboard: routes to (evidence: `Disaster/src/App.js`)
- App routes → Victim registration and status: routes to (evidence: `Disaster/src/App.js`)
- App routes → Status tracker: routes to (evidence: `Disaster/src/App.js`)
- App routes → Volunteer portal: routes to (evidence: `Disaster/src/App.js`)
- App routes → NGO portal: routes to (evidence: `Disaster/src/App.js`)
- App routes → Admin operations: routes to (evidence: `Disaster/src/App.js`)
- App routes → Incident reports: routes to (evidence: `Disaster/src/App.js`)
- Victim registration and status → Victim API service: submits registration (evidence: `Disaster/src/api/victimService.js`)
- Status tracker → Victim API service: checks status (evidence: `Disaster/src/api/victimService.js`)
- Volunteer portal → Volunteer API service: requests tasks (evidence: `Disaster/src/api/volunteerService.js`)
- NGO portal → NGO API service: uses (evidence: `Disaster/src/pages/NGO.jsx`)
- Admin operations → Admin API service: uses (evidence: `Disaster/src/pages/Admin.jsx`)
- Admin operations → Victim API service: assigns responders (evidence: `Disaster/src/pages/Admin.jsx`)
- Admin operations → Dashboard API service: loads dashboard (evidence: `Disaster/src/pages/Admin.jsx`)
- Incident dashboard → Dashboard API service: loads incidents (evidence: `Disaster/src/pages/Dashboard.jsx`)
- Incident reports → Dashboard API service: loads incidents (evidence: `Disaster/src/pages/Reports.jsx`)
- Incident dashboard → Incident map: renders
- Incident dashboard → Incident report form: offers reporting
- Victim API service → Axios API client: sends requests (evidence: `Disaster/src/api/victimService.js`)
- Volunteer API service → Axios API client: sends requests (evidence: `Disaster/src/api/volunteerService.js`)
- NGO API service → Axios API client: sends requests (evidence: `Disaster/src/api/ngoService.js`)
- Admin API service → Axios API client: sends requests (evidence: `Disaster/src/api/adminService.js`)
- Dashboard API service → Axios API client: sends requests (evidence: `Disaster/src/api/dashboardService.js`)
- Axios API client → Express and Socket server: calls REST API
- Express and Socket server → Database connection: connects through (evidence: `backend/server.js`)
- Database connection → MongoDB: connects (evidence: `backend/config/db.js`)
- Express and Socket server → Victim routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → Volunteer routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → NGO routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → Incident routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → Dashboard incident routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → Admin routes: mounts (evidence: `backend/server.js`)
- Express and Socket server → Incident records: queries reports (evidence: `backend/server.js`)
- Victim routes → Victim records: reads and writes (evidence: `backend/routes/victims.js`)
- Victim routes → Priority calculations: calculates score (evidence: `backend/routes/victims.js`)
- Victim routes → JWT and role checks: protects routes (evidence: `backend/routes/victims.js`)
- Volunteer routes → Volunteer records: uses records (evidence: `backend/routes/volunteers.js`)
- Volunteer routes → Victim records: uses records (evidence: `backend/routes/volunteers.js`)
- Volunteer routes → JWT and role checks: protects routes (evidence: `backend/routes/volunteers.js`)
- NGO routes → NGO records: uses records (evidence: `backend/routes/ngos.js`)
- NGO routes → JWT and role checks: protects routes (evidence: `backend/routes/ngos.js`)
- Incident routes → Incident records: uses records (evidence: `backend/routes/incidents.js`)
- Incident routes → Priority calculations: calculates score (evidence: `backend/routes/incidents.js`)
- Incident routes → JWT and role checks: protects routes (evidence: `backend/routes/incidents.js`)
- Dashboard incident routes → Incident records: queries incidents (evidence: `backend/routes/dashboardIncidents.js`)
- Dashboard incident routes → Priority calculations: uses scoring (evidence: `backend/routes/dashboardIncidents.js`)
- Admin routes → Victim records: uses records (evidence: `backend/routes/admin.js`)
