# ryanp4ul/mdrrmo_web architecture

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

- Interactive diagram: https://gitdiagram.com/ryanp4ul/mdrrmo_web
- Repository: https://github.com/ryanp4ul/mdrrmo_web

## Overview

This is a role-based emergency-response management application for an MDRRMO: residents submit incident reports, dispatchers review and coordinate response, drivers view assigned reports, and administrators manage operations and reporting. The tree shows dedicated interfaces for schedules, announcements, notifications, maps and vehicle tracking. The sampled resident-report component reads incident types and app state; report-generation routes build PDF reports from mock data and invoke a Python script. Most other component wiring and persistence behavior were not sampled, so their links are intentionally not inferred.

Main entry points: [`src/components/layout/app-shell.tsx`](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/layout/app-shell.tsx) (Role-based shell), [`src/components/resident/report.tsx`](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/report.tsx) (Emergency reporting), [`src/components/auth/login-page.tsx`](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/auth/login-page.tsx) (Login), [`src/lib/mock-data.ts`](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/mock-data.ts) (Mock operational data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and shell"]
  node_app_shell["Role-based shell<br/>[app-shell.tsx]"]
  node_login["Login<br/>[login-page.tsx]"]
  node_registration["Registration<br/>[register-page.tsx]"]
end

subgraph group_resident["Resident services"]
  node_resident_dashboard["Resident dashboard<br/>[dashboard.tsx]"]
  node_emergency_report["Emergency reporting<br/>[report.tsx]"]
  node_resident_history["Report history<br/>[history.tsx]"]
  node_resident_updates["Notifications and schedule<br/>[notifications.tsx]"]
end

subgraph group_operations["Response operations"]
  node_dispatcher_dashboard["Dispatch dashboard<br/>[dashboard.tsx]"]
  node_dispatcher_reports["Report coordination<br/>[reports.tsx]"]
  node_response_detail["Report detail<br/>[report-detail.tsx]"]
  node_teams["Response teams<br/>[responders.tsx]"]
  node_dispatch_schedule["Dispatch schedule<br/>[schedule.tsx]"]
  node_announcements["Announcements<br/>[announcements.tsx]"]
  node_vehicle_tracking["Vehicle tracking"]
  node_maps["Maps and heatmap<br/>[heatmap.tsx]"]
  node_driver_reports["Driver reports<br/>[reports.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[dashboard.tsx]"]
  node_user_admin["User management"]
  node_audit["Audit logs<br/>[audit-logs.tsx]"]
  node_admin_catalog["Incident types and teams<br/>[incident-types.tsx]"]
  node_admin_announcements["Announcement management<br/>[announcements.tsx]"]
  node_admin_reports["Report management<br/>[reports.tsx]"]
  node_monthly_api["Monthly PDF endpoint<br/>[route.ts]"]
  node_weekly_api["Weekly PDF endpoint<br/>[route.ts]"]
  node_pdf_script["PDF generation"]
end

subgraph group_internal["Application data"]
  node_store["App state<br/>[store.ts]"]
  node_mock_data[("Mock operational data<br/>[mock-data.ts]")]
  node_types["Domain types<br/>[types.ts]"]
end

node_residents(("Residents"))
node_staff(("Response staff"))

node_residents -->|"sign in"| node_login
node_residents -->|"register"| node_registration
node_staff -->|"sign in"| node_login
node_login -->|"enter app"| node_app_shell
node_registration -->|"continue"| node_app_shell
node_app_shell -->|"shows"| node_resident_dashboard
node_app_shell -->|"shows"| node_dispatcher_dashboard
node_app_shell -->|"shows"| node_admin_dashboard
node_residents -->|"submit incident"| node_emergency_report
node_emergency_report -->|"reads types"| node_mock_data
node_emergency_report -->|"reads app state"| node_store
node_residents -->|"review reports"| node_resident_history
node_residents -->|"view updates"| node_resident_updates
node_staff -->|"coordinate response"| node_dispatcher_dashboard
node_staff -->|"view assignments"| node_driver_reports
node_staff -->|"manage operations"| node_admin_dashboard
node_monthly_api -->|"reads reports and teams"| node_mock_data
node_weekly_api -->|"reads reports and teams"| node_mock_data
node_monthly_api -->|"invokes"| node_pdf_script
node_weekly_api -->|"invokes"| node_pdf_script

click node_app_shell "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/layout/app-shell.tsx"
click node_login "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/auth/login-page.tsx"
click node_registration "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/auth/register-page.tsx"
click node_resident_dashboard "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/dashboard.tsx"
click node_emergency_report "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/report.tsx"
click node_resident_history "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/history.tsx"
click node_resident_updates "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/notifications.tsx"
click node_dispatcher_dashboard "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/dashboard.tsx"
click node_dispatcher_reports "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/reports.tsx"
click node_response_detail "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/report-detail.tsx"
click node_teams "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/responders.tsx"
click node_dispatch_schedule "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/schedule.tsx"
click node_announcements "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/announcements.tsx"
click node_vehicle_tracking "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/shared/vehicle-tracking.tsx"
click node_maps "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/maps/heatmap.tsx"
click node_driver_reports "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/driver/reports.tsx"
click node_admin_dashboard "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/dashboard.tsx"
click node_user_admin "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/user-management.tsx"
click node_audit "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/audit-logs.tsx"
click node_admin_catalog "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/incident-types.tsx"
click node_admin_announcements "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/announcements.tsx"
click node_admin_reports "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/reports.tsx"
click node_monthly_api "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/app/api/admin/generate-monthly-report/route.ts"
click node_weekly_api "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/app/api/admin/generate-weekly-report/route.ts"
click node_pdf_script "https://github.com/ryanp4ul/mdrrmo_web/blob/main/scripts/generate_monthly_report.py"
click node_store "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/store.ts"
click node_mock_data "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/mock-data.ts"
click node_types "https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/types.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_shell,node_login,node_registration toneBlue
class node_resident_dashboard,node_emergency_report,node_resident_history,node_resident_updates toneAmber
class node_dispatcher_dashboard,node_dispatcher_reports,node_response_detail,node_teams,node_dispatch_schedule,node_announcements,node_vehicle_tracking,node_maps,node_driver_reports toneMint
class node_admin_dashboard,node_user_admin,node_audit,node_admin_catalog,node_admin_announcements,node_admin_reports,node_monthly_api,node_weekly_api,node_pdf_script toneRose
class node_store,node_mock_data,node_types,node_residents,node_staff toneIndigo
```

## Components

### Access and shell

- [Role-based shell](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/layout/app-shell.tsx): `src/components/layout/app-shell.tsx`
- [Login](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/auth/login-page.tsx): `src/components/auth/login-page.tsx`
- [Registration](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/auth/register-page.tsx): `src/components/auth/register-page.tsx`

### Resident services

- [Resident dashboard](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/dashboard.tsx): `src/components/resident/dashboard.tsx`
- [Emergency reporting](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/report.tsx): `src/components/resident/report.tsx`
- [Report history](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/history.tsx): `src/components/resident/history.tsx`
- [Notifications and schedule](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/resident/notifications.tsx): `src/components/resident/notifications.tsx`

### Response operations

- [Dispatch dashboard](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/dashboard.tsx): `src/components/dispatcher/dashboard.tsx`
- [Report coordination](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/reports.tsx): `src/components/dispatcher/reports.tsx`
- [Report detail](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/report-detail.tsx): `src/components/dispatcher/report-detail.tsx`
- [Response teams](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/responders.tsx): `src/components/dispatcher/responders.tsx`
- [Dispatch schedule](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/schedule.tsx): `src/components/dispatcher/schedule.tsx`
- [Announcements](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/dispatcher/announcements.tsx): `src/components/dispatcher/announcements.tsx`
- [Vehicle tracking](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/shared/vehicle-tracking.tsx): `src/components/shared/vehicle-tracking.tsx`
- [Maps and heatmap](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/maps/heatmap.tsx): `src/components/maps/heatmap.tsx`
- [Driver reports](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/driver/reports.tsx): `src/components/driver/reports.tsx`

### Administration

- [Admin dashboard](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/dashboard.tsx): `src/components/admin/dashboard.tsx`
- [User management](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/user-management.tsx): `src/components/admin/user-management.tsx`
- [Audit logs](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/audit-logs.tsx): `src/components/admin/audit-logs.tsx`
- [Incident types and teams](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/incident-types.tsx): `src/components/admin/incident-types.tsx`
- [Announcement management](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/announcements.tsx): `src/components/admin/announcements.tsx`
- [Report management](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/components/admin/reports.tsx): `src/components/admin/reports.tsx`
- [Monthly PDF endpoint](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/app/api/admin/generate-monthly-report/route.ts): `src/app/api/admin/generate-monthly-report/route.ts`
- [Weekly PDF endpoint](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/app/api/admin/generate-weekly-report/route.ts): `src/app/api/admin/generate-weekly-report/route.ts`
- [PDF generation](https://github.com/ryanp4ul/mdrrmo_web/blob/main/scripts/generate_monthly_report.py): `scripts/generate_monthly_report.py`

### Application data

- [App state](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/store.ts): `src/lib/store.ts`
- [Mock operational data](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/mock-data.ts): `src/lib/mock-data.ts`
- [Domain types](https://github.com/ryanp4ul/mdrrmo_web/blob/main/src/lib/types.ts): `src/lib/types.ts`

### Other components

- **Residents**
- **Response staff**

## Connections

- Residents → Login: sign in
- Residents → Registration: register
- Response staff → Login: sign in
- Login → Role-based shell: enter app
- Registration → Role-based shell: continue
- Role-based shell → Resident dashboard: shows
- Role-based shell → Dispatch dashboard: shows
- Role-based shell → Admin dashboard: shows
- Residents → Emergency reporting: submit incident
- Emergency reporting → Mock operational data: reads types
- Emergency reporting → App state: reads app state
- Residents → Report history: review reports
- Residents → Notifications and schedule: view updates
- Response staff → Dispatch dashboard: coordinate response
- Response staff → Driver reports: view assignments
- Response staff → Admin dashboard: manage operations
- Monthly PDF endpoint → Mock operational data: reads reports and teams
- Weekly PDF endpoint → Mock operational data: reads reports and teams
- Monthly PDF endpoint → PDF generation: invokes
- Weekly PDF endpoint → PDF generation: invokes
