# alphaqbit/ligtasalert_laravel- architecture

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

- Interactive diagram: https://gitdiagram.com/alphaqbit/ligtasalert_laravel-
- Repository: https://github.com/alphaqbit/ligtasalert_laravel-

## Overview

LigtasAlert is a Laravel emergency-alert application. Its primary workflow is that an operator or rescuee uses the web interface to submit an alert; the API controller validates and stores it, and operators can list, acknowledge, resolve, or add responders to alerts. The admin interface also requests alert statistics and facility data, while alert history supports review. The graph uses the sampled controllers, model, bootstrap, and admin view; route wiring and the other views are represented only where the tree supports their paths, so uncertain links are omitted.

Main entry points: [`routes/api.php`](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/api.php) (API routes), [`routes/web.php`](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/web.php) (Web routes), [`bootstrap/app.php`](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/bootstrap/app.php) (App bootstrap), [`public/index.php`](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/public/index.php) (HTTP entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_web_entry["HTTP entry<br/>[index.php]"]
  node_app_bootstrap["App bootstrap<br/>[app.php]"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_api["Alert API"]
  node_alert_controller["Alert operations"]
  node_stats_controller["Alert statistics"]
  node_facility_controller["Facility listing"]
  node_facility_config["Facility configuration<br/>[facilities.php]"]
end

subgraph group_domain["Alert domain"]
  node_alert_model["Alert model<br/>[Alert.php]"]
  node_alert_store[("Alert database")]
  node_database_config["Database settings<br/>[database.php]"]
end

subgraph group_views["User interfaces"]
  node_admin_view["Admin dashboard<br/>[admin.blade.php]"]
  node_rescuee_view["Rescuee interface<br/>[rescuee.blade.php]"]
  node_debug_view["Debug view<br/>[debug.blade.php]"]
end

node_operator(("Operator"))
node_rescuee(("Rescuee"))
node_database_service[("Database")]

node_operator -->|"uses"| node_web_entry
node_rescuee -->|"uses"| node_web_entry
node_web_entry -->|"boots"| node_app_bootstrap
node_app_bootstrap -->|"loads routes"| node_web_routes
node_app_bootstrap -->|"loads routes"| node_api_routes
node_web_routes -->|"serves"| node_admin_view
node_web_routes -->|"serves"| node_rescuee_view
node_web_routes -->|"serves"| node_debug_view
node_admin_view -->|"requests API"| node_api_routes
node_rescuee_view -->|"requests API"| node_api_routes
node_api_routes -->|"dispatches"| node_alert_controller
node_api_routes -->|"dispatches"| node_stats_controller
node_api_routes -->|"dispatches"| node_facility_controller
node_alert_controller -->|"queries and updates"| node_alert_model
node_stats_controller -->|"counts alerts"| node_alert_model
node_facility_controller -->|"reads"| node_facility_config
node_alert_model -->|"persists alerts"| node_alert_store
node_alert_store -->|"stored in"| node_database_service
node_database_config -->|"configures"| node_database_service

click node_web_entry "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/public/index.php"
click node_app_bootstrap "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/web.php"
click node_api_routes "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/api.php"
click node_admin_view "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/admin.blade.php"
click node_rescuee_view "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/rescuee.blade.php"
click node_debug_view "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/debug.blade.php"
click node_alert_controller "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/AlertController.php"
click node_stats_controller "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/StatsController.php"
click node_facility_controller "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/FacilityController.php"
click node_facility_config "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/config/facilities.php"
click node_alert_model "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Models/Alert.php"
click node_alert_store "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/database/migrations/2026_09_25_000000_create_alerts_table.php"
click node_database_config "https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/config/database.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_entry,node_app_bootstrap,node_web_routes,node_api_routes toneBlue
class node_alert_controller,node_stats_controller,node_facility_controller,node_facility_config,node_database_service toneAmber
class node_alert_model,node_alert_store,node_database_config toneMint
class node_admin_view,node_rescuee_view,node_debug_view toneRose
class node_operator,node_rescuee toneIndigo
```

## Components

### Web entry

- [HTTP entry](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/public/index.php): `public/index.php`
- [App bootstrap](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Web routes](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/web.php): `routes/web.php`
- [API routes](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/routes/api.php): `routes/api.php`

### Alert API

- [Alert operations](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/AlertController.php): `app/Http/Controllers/AlertController.php`
- [Alert statistics](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/StatsController.php): `app/Http/Controllers/StatsController.php`
- [Facility listing](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Http/Controllers/FacilityController.php): `app/Http/Controllers/FacilityController.php`
- [Facility configuration](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/config/facilities.php): `config/facilities.php`

### Alert domain

- [Alert model](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/app/Models/Alert.php): `app/Models/Alert.php`
- [Alert database](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/database/migrations/2026_09_25_000000_create_alerts_table.php): `database/migrations/2026_09_25_000000_create_alerts_table.php`
- [Database settings](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/config/database.php): `config/database.php`

### User interfaces

- [Admin dashboard](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/admin.blade.php): `resources/views/admin.blade.php`
- [Rescuee interface](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/rescuee.blade.php): `resources/views/rescuee.blade.php`
- [Debug view](https://github.com/alphaqbit/ligtasalert_laravel-/blob/main/resources/views/debug.blade.php): `resources/views/debug.blade.php`

### Other components

- **Operator**
- **Rescuee**
- **Database**

## Connections

- Operator → HTTP entry: uses
- Rescuee → HTTP entry: uses
- HTTP entry → App bootstrap: boots
- App bootstrap → Web routes: loads routes
- App bootstrap → API routes: loads routes
- Web routes → Admin dashboard: serves
- Web routes → Rescuee interface: serves
- Web routes → Debug view: serves
- Admin dashboard → API routes: requests API
- Rescuee interface → API routes: requests API
- API routes → Alert operations: dispatches
- API routes → Alert statistics: dispatches
- API routes → Facility listing: dispatches
- Alert operations → Alert model: queries and updates
- Alert statistics → Alert model: counts alerts
- Facility listing → Facility configuration: reads
- Alert model → Alert database: persists alerts
- Alert database → Database: stored in
- Database settings → Database: configures
