# gabargers/disaster-management architecture

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

- Interactive diagram: https://gitdiagram.com/gabargers/disaster-management
- Repository: https://github.com/gabargers/disaster-management

## Overview

This Laravel application supports disaster response operations: staff manage disaster and evacuation-center records, register affected households, validate and track them through assistance and payout stages, and produce reports. A separate person-affected API accepts integration data, while account management, barangay administration, and activity auditing support the operational workflow. The status enum and workflow service provide an internal lifecycle layer. Evidence is limited to the supplied excerpts and source index; unsampled subsystems are represented only where the tree identifies them.

Main entry points: [`app/Http/Controllers/Disaster/EvacuationCenterController.php`](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/EvacuationCenterController.php) (Center Operations), [`app/Http/Controllers/Disaster/DisasterWorkflowController.php`](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/DisasterWorkflowController.php) (Workflow Operations), [`app/Http/Controllers/Api/PersonAffectedController.php`](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Api/PersonAffectedController.php) (Person-Affected API), [`app/Models/Disaster/AffectedFamily.php`](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/AffectedFamily.php) (Affected Families)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Disaster Operations"]
  node_workflow_controller["Workflow Operations"]
  node_center_controller["Center Operations"]
  node_center_data[("Center Records")]
  node_reports["Operational Reports"]
end

subgraph group_workflow["Household Workflow"]
  node_family_data[("Affected Families<br/>[AffectedFamily.php]")]
  node_family_status["Family Lifecycle<br/>[FamilyStatus.php]"]
  node_workflow_service["Workflow Service"]
  node_dafac_intake["DAFAC Intake"]
  node_evacuation_assignment[("Center Assignments")]
  node_payout_release[("Payout Releases<br/>[PayoutRelease.php]")]
end

subgraph group_integration["API Integration"]
  node_api_controller["Person-Affected API"]
  node_api_request["API Validation"]
  node_api_person[("Integrated Residents<br/>[PersonAffected.php]")]
  node_idempotency[("Request Idempotency")]
end

subgraph group_admin["Administration"]
  node_barangay_admin["Barangay Administration"]
  node_barangay_data[("Barangay Records<br/>[Barangay.php]")]
  node_account_admin["Account Management"]
  node_user_data[("User Accounts<br/>[User.php]")]
  node_activity_logs["Activity Auditing"]
  node_audit_data[("Audit Records<br/>[AuditLog.php]")]
  node_auth_service["Authentication Services<br/>[AuthServices.php]"]
  node_log_service["Logging Service<br/>[LogServices.php]"]
end

node_staff(("Operations Staff"))
node_api_actor(("TCISS/API Client"))

node_staff -->|"manages cases"| node_workflow_controller
node_staff -->|"manages centers"| node_center_controller
node_workflow_controller -->|"reads and updates"| node_family_data
node_workflow_controller -->|"delegates workflow"| node_workflow_service
node_workflow_controller -->|"checks statuses"| node_family_status
node_workflow_controller -->|"generates report"| node_reports
node_center_controller -->|"reads and updates"| node_center_data
node_center_controller -->|"loads households"| node_family_data
node_center_controller -->|"loads residents"| node_api_person
node_center_controller -->|"manages assignments"| node_evacuation_assignment
node_center_controller -->|"reads payout records"| node_payout_release
node_barangay_admin -->|"manages records"| node_barangay_data
node_barangay_admin -.->|"validates requests"| node_staff
node_api_actor -.->|"submits residents"| node_api_controller
node_api_controller -->|"validates input"| node_api_request
node_api_controller -->|"stores residents"| node_api_person
node_api_controller -->|"checks duplicate requests"| node_idempotency
node_dafac_intake -->|"creates intake records"| node_family_data
node_dafac_intake -->|"uses workflow"| node_workflow_service
node_account_admin -->|"manages accounts"| node_user_data
node_activity_logs -->|"reads audit records"| node_audit_data
node_auth_service -->|"manages authentication"| node_user_data
node_auth_service -->|"records activity"| node_log_service

click node_workflow_controller "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/DisasterWorkflowController.php"
click node_center_controller "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/EvacuationCenterController.php"
click node_center_data "https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/EvacuationCenter.php"
click node_barangay_admin "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Cms/BarangayController.php"
click node_barangay_data "https://github.com/gabargers/disaster-management/blob/main/app/Models/Cms/Barangay.php"
click node_family_data "https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/AffectedFamily.php"
click node_family_status "https://github.com/gabargers/disaster-management/blob/main/app/Enums/FamilyStatus.php"
click node_workflow_service "https://github.com/gabargers/disaster-management/blob/main/app/Services/Disaster/DisasterAssistanceWorkflowService.php"
click node_dafac_intake "https://github.com/gabargers/disaster-management/blob/main/app/Services/Disaster/DafacIntakeIntegrationService.php"
click node_evacuation_assignment "https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/EvacuationCenterAssignment.php"
click node_payout_release "https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/PayoutRelease.php"
click node_reports "https://github.com/gabargers/disaster-management/blob/main/app/Exports/EvacueeMonitoringReportExport.php"
click node_api_controller "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Api/PersonAffectedController.php"
click node_api_request "https://github.com/gabargers/disaster-management/blob/main/app/Http/Requests/Api/StorePersonAffectedRequest.php"
click node_api_person "https://github.com/gabargers/disaster-management/blob/main/app/Models/Integration/PersonAffected.php"
click node_idempotency "https://github.com/gabargers/disaster-management/blob/main/app/Models/Integration/ApiIdempotencyRecord.php"
click node_account_admin "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Auth/AccountManagementController.php"
click node_user_data "https://github.com/gabargers/disaster-management/blob/main/app/Models/Auth/User.php"
click node_activity_logs "https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Auth/ActivityLogController.php"
click node_audit_data "https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/AuditLog.php"
click node_auth_service "https://github.com/gabargers/disaster-management/blob/main/app/Services/Auth/AuthServices.php"
click node_log_service "https://github.com/gabargers/disaster-management/blob/main/app/Services/Log/LogServices.php"

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_workflow_controller,node_center_controller,node_center_data,node_reports,node_api_actor toneBlue
class node_family_data,node_family_status,node_workflow_service,node_dafac_intake,node_evacuation_assignment,node_payout_release toneAmber
class node_api_controller,node_api_request,node_api_person,node_idempotency toneMint
class node_barangay_admin,node_barangay_data,node_account_admin,node_user_data,node_activity_logs,node_audit_data,node_auth_service,node_log_service toneRose
class node_staff toneIndigo
```

## Components

### Disaster Operations

- [Workflow Operations](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/DisasterWorkflowController.php): `app/Http/Controllers/Disaster/DisasterWorkflowController.php`
- [Center Operations](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Disaster/EvacuationCenterController.php): `app/Http/Controllers/Disaster/EvacuationCenterController.php`
- [Center Records](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/EvacuationCenter.php): `app/Models/Disaster/EvacuationCenter.php`
- [Operational Reports](https://github.com/gabargers/disaster-management/blob/main/app/Exports/EvacueeMonitoringReportExport.php): `app/Exports/EvacueeMonitoringReportExport.php`

### Household Workflow

- [Affected Families](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/AffectedFamily.php): `app/Models/Disaster/AffectedFamily.php`
- [Family Lifecycle](https://github.com/gabargers/disaster-management/blob/main/app/Enums/FamilyStatus.php): `app/Enums/FamilyStatus.php`
- [Workflow Service](https://github.com/gabargers/disaster-management/blob/main/app/Services/Disaster/DisasterAssistanceWorkflowService.php): `app/Services/Disaster/DisasterAssistanceWorkflowService.php`
- [DAFAC Intake](https://github.com/gabargers/disaster-management/blob/main/app/Services/Disaster/DafacIntakeIntegrationService.php): `app/Services/Disaster/DafacIntakeIntegrationService.php`
- [Center Assignments](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/EvacuationCenterAssignment.php): `app/Models/Disaster/EvacuationCenterAssignment.php`
- [Payout Releases](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/PayoutRelease.php): `app/Models/Disaster/PayoutRelease.php`

### API Integration

- [Person-Affected API](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Api/PersonAffectedController.php): `app/Http/Controllers/Api/PersonAffectedController.php`
- [API Validation](https://github.com/gabargers/disaster-management/blob/main/app/Http/Requests/Api/StorePersonAffectedRequest.php): `app/Http/Requests/Api/StorePersonAffectedRequest.php`
- [Integrated Residents](https://github.com/gabargers/disaster-management/blob/main/app/Models/Integration/PersonAffected.php): `app/Models/Integration/PersonAffected.php`
- [Request Idempotency](https://github.com/gabargers/disaster-management/blob/main/app/Models/Integration/ApiIdempotencyRecord.php): `app/Models/Integration/ApiIdempotencyRecord.php`

### Administration

- [Barangay Administration](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Cms/BarangayController.php): `app/Http/Controllers/Cms/BarangayController.php`
- [Barangay Records](https://github.com/gabargers/disaster-management/blob/main/app/Models/Cms/Barangay.php): `app/Models/Cms/Barangay.php`
- [Account Management](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Auth/AccountManagementController.php): `app/Http/Controllers/Auth/AccountManagementController.php`
- [User Accounts](https://github.com/gabargers/disaster-management/blob/main/app/Models/Auth/User.php): `app/Models/Auth/User.php`
- [Activity Auditing](https://github.com/gabargers/disaster-management/blob/main/app/Http/Controllers/Auth/ActivityLogController.php): `app/Http/Controllers/Auth/ActivityLogController.php`
- [Audit Records](https://github.com/gabargers/disaster-management/blob/main/app/Models/Disaster/AuditLog.php): `app/Models/Disaster/AuditLog.php`
- [Authentication Services](https://github.com/gabargers/disaster-management/blob/main/app/Services/Auth/AuthServices.php): `app/Services/Auth/AuthServices.php`
- [Logging Service](https://github.com/gabargers/disaster-management/blob/main/app/Services/Log/LogServices.php): `app/Services/Log/LogServices.php`

### Other components

- **Operations Staff**
- **TCISS/API Client**

## Connections

- Operations Staff → Workflow Operations: manages cases (evidence: `app/Http/Controllers/Disaster/DisasterWorkflowController.php`)
- Operations Staff → Center Operations: manages centers (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Workflow Operations → Affected Families: reads and updates (evidence: `app/Http/Controllers/Disaster/DisasterWorkflowController.php`)
- Workflow Operations → Workflow Service: delegates workflow (evidence: `app/Http/Controllers/Disaster/DisasterWorkflowController.php`)
- Workflow Operations → Family Lifecycle: checks statuses (evidence: `app/Http/Controllers/Disaster/DisasterWorkflowController.php`)
- Workflow Operations → Operational Reports: generates report (evidence: `app/Http/Controllers/Disaster/DisasterWorkflowController.php`)
- Center Operations → Center Records: reads and updates (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Center Operations → Affected Families: loads households (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Center Operations → Integrated Residents: loads residents (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Center Operations → Center Assignments: manages assignments (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Center Operations → Payout Releases: reads payout records (evidence: `app/Http/Controllers/Disaster/EvacuationCenterController.php`)
- Barangay Administration → Barangay Records: manages records (evidence: `app/Http/Controllers/Cms/BarangayController.php`)
- Barangay Administration → Operations Staff: validates requests
- TCISS/API Client → Person-Affected API: submits residents
- Person-Affected API → API Validation: validates input (evidence: `app/Http/Controllers/Api/PersonAffectedController.php`)
- Person-Affected API → Integrated Residents: stores residents (evidence: `app/Http/Controllers/Api/PersonAffectedController.php`)
- Person-Affected API → Request Idempotency: checks duplicate requests (evidence: `app/Http/Controllers/Api/PersonAffectedController.php`)
- DAFAC Intake → Affected Families: creates intake records (evidence: `app/Services/Disaster/DafacIntakeIntegrationService.php`)
- DAFAC Intake → Workflow Service: uses workflow (evidence: `app/Services/Disaster/DafacIntakeIntegrationService.php`)
- Account Management → User Accounts: manages accounts (evidence: `app/Http/Controllers/Auth/AccountManagementController.php`)
- Activity Auditing → Audit Records: reads audit records (evidence: `app/Http/Controllers/Auth/ActivityLogController.php`)
- Authentication Services → User Accounts: manages authentication (evidence: `app/Services/Auth/AuthServices.php`)
- Authentication Services → Logging Service: records activity (evidence: `app/Services/Auth/AuthServices.php`)
