# pyunpyunn/g10-capstone architecture

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

- Interactive diagram: https://gitdiagram.com/pyunpyunn/g10-capstone
- Repository: https://github.com/pyunpyunn/g10-capstone

## Overview

RESQPERATION coordinates barangay disaster response through HQ/Admin web operations and household/rescuer mobile workflows, backed by a Laravel API and shared operational database. Residents report household status and location; HQ reviews the operational picture, coordinates dispatch and resources, and records situations; rescuers receive assignments and send field updates. The README also describes mapping, weather and hazard context, notifications, archives, and external partner handoffs. Source excerpts are selective, so unsampled subsystem links are omitted unless documented in the README.

Main entry points: [`backend-laravel/routes/api.php`](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/routes/api.php) (Laravel JSON API), [`frontend-mobile/app/index.tsx`](https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-mobile/app/index.tsx) (Mobile App), [`frontend-web/src/App.jsx`](https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-web/src/App.jsx) (HQ Web App), [`backend-laravel/app/Services/Mobile`](https://github.com/pyunpyunn/g10-capstone/tree/main/backend-laravel/app/Services/Mobile) (Household Workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Applications"]
  node_web["HQ Web App<br/>[App.jsx]"]
  node_mobile["Mobile App<br/>[index.tsx]"]
  node_household_routes["Evacuation Routes"]
end

subgraph group_api["Backend API"]
  node_api_entry["Laravel JSON API<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthService.php]"]
end

subgraph group_operations["Response Operations"]
  node_web_ops["HQ Operations"]
  node_household_workflows["Household Workflows"]
  node_dispatch["Rescue Dispatch"]
  node_resource_requests["Resource Requests"]
  node_situation_archive["Situation &amp; Archives"]
  node_navigation["Route Precompute"]
  node_weather_hazard["Weather &amp; Hazards<br/>[WeatherService.php]"]
  node_notifications["Notifications"]
end

subgraph group_data["Operational Data"]
  node_household_model["Household Records<br/>[Household.php]"]
  node_user_model["User Accounts<br/>[User.php]"]
  node_schema_support["Schema Capability<br/>[RequestSchema.php]"]
  node_database[("Shared Database")]
end

subgraph group_integrations["External Services"]
  node_weather_source["Open-Meteo"]
  node_advisory_sources["PAGASA / PHIVOLCS"]
  node_map_sources["OSM / Routing"]
  node_push_services["Push Services"]
  node_partners["External Partners"]
end

node_hq(("HQ / Admin"))
node_residents(("Residents"))
node_rescuers(("Rescuers"))

node_hq -->|"uses"| node_web
node_residents -->|"uses"| node_mobile
node_rescuers -->|"uses"| node_mobile
node_web -->|"calls API"| node_api_entry
node_mobile -->|"calls API"| node_api_entry
node_api_entry -->|"authenticates"| node_auth
node_api_entry -->|"routes operations"| node_web_ops
node_api_entry -->|"routes mobile work"| node_household_workflows
node_api_entry -->|"routes dispatch"| node_dispatch
node_api_entry -->|"routes requests"| node_resource_requests
node_api_entry -->|"routes reporting"| node_situation_archive
node_api_entry -.->|"routes navigation"| node_navigation
node_api_entry -->|"routes context"| node_weather_hazard
node_api_entry -->|"delivers notifications"| node_notifications
node_household_routes -->|"renders in"| node_mobile
node_mobile -->|"shows evacuation routes"| node_household_routes
node_household_workflows -.->|"reads household data"| node_household_model
node_web_ops -->|"reads and writes"| node_database
node_household_workflows -->|"reads and writes"| node_database
node_dispatch -->|"records assignments"| node_database
node_resource_requests -->|"records requests"| node_database
node_situation_archive -->|"stores records"| node_database
node_navigation -.->|"stores routes"| node_database
node_auth -->|"uses accounts"| node_user_model
node_schema_support -->|"checks schema"| node_database
node_weather_hazard -->|"fetches forecasts"| node_weather_source
node_weather_hazard -->|"presents advisories"| node_advisory_sources
node_web -->|"uses map and routes"| node_map_sources
node_notifications -->|"sends push"| node_push_services
node_resource_requests -->|"hands off requests"| node_partners
node_situation_archive -->|"exchanges reports"| node_partners

click node_web "https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-web/src/App.jsx"
click node_mobile "https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-mobile/app/index.tsx"
click node_household_routes "https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-mobile/components/household/HouseholdRouteScreen.native.tsx"
click node_api_entry "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/routes/api.php"
click node_auth "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/AuthService.php"
click node_web_ops "https://github.com/pyunpyunn/g10-capstone/tree/main/backend-laravel/app/Services/Web"
click node_household_workflows "https://github.com/pyunpyunn/g10-capstone/tree/main/backend-laravel/app/Services/Mobile"
click node_dispatch "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/RescueDispatchService.php"
click node_resource_requests "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/ResourceRequestService.php"
click node_situation_archive "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/SituationReportService.php"
click node_navigation "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Navigation/RoutePrecomputeService.php"
click node_weather_hazard "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/WeatherService.php"
click node_notifications "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/OneSignalNotificationService.php"
click node_household_model "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Models/Household.php"
click node_user_model "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Models/User.php"
click node_schema_support "https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Support/RequestSchema.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_web,node_mobile,node_household_routes toneBlue
class node_api_entry,node_auth toneAmber
class node_web_ops,node_household_workflows,node_dispatch,node_resource_requests,node_situation_archive,node_navigation,node_weather_hazard,node_notifications toneMint
class node_household_model,node_user_model,node_schema_support,node_database toneRose
class node_weather_source,node_advisory_sources,node_map_sources,node_push_services,node_partners,node_hq,node_residents,node_rescuers toneIndigo
```

## Components

### User Applications

- [HQ Web App](https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-web/src/App.jsx): `frontend-web/src/App.jsx`
- [Mobile App](https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-mobile/app/index.tsx): `frontend-mobile/app/index.tsx`
- [Evacuation Routes](https://github.com/pyunpyunn/g10-capstone/blob/main/frontend-mobile/components/household/HouseholdRouteScreen.native.tsx): `frontend-mobile/components/household/HouseholdRouteScreen.native.tsx`

### Backend API

- [Laravel JSON API](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/routes/api.php): `backend-laravel/routes/api.php`
- [Authentication](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/AuthService.php): `backend-laravel/app/Services/Shared/AuthService.php`

### Response Operations

- [HQ Operations](https://github.com/pyunpyunn/g10-capstone/tree/main/backend-laravel/app/Services/Web): `backend-laravel/app/Services/Web`
- [Household Workflows](https://github.com/pyunpyunn/g10-capstone/tree/main/backend-laravel/app/Services/Mobile): `backend-laravel/app/Services/Mobile`
- [Rescue Dispatch](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/RescueDispatchService.php): `backend-laravel/app/Services/Web/RescueDispatchService.php`
- [Resource Requests](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/ResourceRequestService.php): `backend-laravel/app/Services/Web/ResourceRequestService.php`
- [Situation & Archives](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Web/SituationReportService.php): `backend-laravel/app/Services/Web/SituationReportService.php`
- [Route Precompute](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Navigation/RoutePrecomputeService.php): `backend-laravel/app/Services/Navigation/RoutePrecomputeService.php`
- [Weather & Hazards](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/WeatherService.php): `backend-laravel/app/Services/Shared/WeatherService.php`
- [Notifications](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Services/Shared/OneSignalNotificationService.php): `backend-laravel/app/Services/Shared/OneSignalNotificationService.php`

### Operational Data

- [Household Records](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Models/Household.php): `backend-laravel/app/Models/Household.php`
- [User Accounts](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Models/User.php): `backend-laravel/app/Models/User.php`
- [Schema Capability](https://github.com/pyunpyunn/g10-capstone/blob/main/backend-laravel/app/Support/RequestSchema.php): `backend-laravel/app/Support/RequestSchema.php`
- **Shared Database**

### External Services

- **Open-Meteo**
- **PAGASA / PHIVOLCS**
- **OSM / Routing**
- **Push Services**
- **External Partners**

### Other components

- **HQ / Admin**
- **Residents**
- **Rescuers**

## Connections

- HQ / Admin → HQ Web App: uses
- Residents → Mobile App: uses
- Rescuers → Mobile App: uses
- HQ Web App → Laravel JSON API: calls API
- Mobile App → Laravel JSON API: calls API
- Laravel JSON API → Authentication: authenticates (evidence: `backend-laravel/app/Services/Shared/AuthService.php`)
- Laravel JSON API → HQ Operations: routes operations
- Laravel JSON API → Household Workflows: routes mobile work
- Laravel JSON API → Rescue Dispatch: routes dispatch
- Laravel JSON API → Resource Requests: routes requests
- Laravel JSON API → Situation & Archives: routes reporting
- Laravel JSON API → Route Precompute: routes navigation
- Laravel JSON API → Weather & Hazards: routes context
- Laravel JSON API → Notifications: delivers notifications
- Evacuation Routes → Mobile App: renders in (evidence: `frontend-mobile/components/household/HouseholdRouteScreen.native.tsx`)
- Mobile App → Evacuation Routes: shows evacuation routes
- Household Workflows → Household Records: reads household data
- HQ Operations → Shared Database: reads and writes
- Household Workflows → Shared Database: reads and writes
- Rescue Dispatch → Shared Database: records assignments
- Resource Requests → Shared Database: records requests
- Situation & Archives → Shared Database: stores records
- Route Precompute → Shared Database: stores routes
- Authentication → User Accounts: uses accounts (evidence: `backend-laravel/app/Services/Shared/AuthService.php`)
- Schema Capability → Shared Database: checks schema (evidence: `backend-laravel/app/Support/RequestSchema.php`)
- Weather & Hazards → Open-Meteo: fetches forecasts
- Weather & Hazards → PAGASA / PHIVOLCS: presents advisories
- HQ Web App → OSM / Routing: uses map and routes
- Notifications → Push Services: sends push
- Resource Requests → External Partners: hands off requests
- Situation & Archives → External Partners: exchanges reports
