# princejabonero0/sagipalert architecture

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

- Interactive diagram: https://gitdiagram.com/princejabonero0/sagipalert
- Repository: https://github.com/princejabonero0/sagipalert

## Overview

SagipAlert is a PHP community emergency incident reporting and dispatch system. Residents submit incident details and optional evidence; dispatchers and administrators review and verify reports, assign responders, and coordinate status updates; responders accept assignments and document actions, while residents can follow progress. The application also provides dashboards, notifications, user administration, audit history, and date-range summaries with CSV export. PHP pages access MySQL directly, with shared authentication, role checks, incident helpers, and upload handling in bootstrap. Relationships shown are limited to the excerpts and SOURCE INDEX; unsampled page internals are not inferred.

Main entry points: [`sagipalert/inc/bootstrap.php`](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/bootstrap.php) (Shared runtime helpers), [`sagipalert/inc/header.php`](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/header.php) (Navigation and page shell), [`sagipalert/report.php`](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/report.php) (Incident submission), [`sagipalert/incident.php`](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/incident.php) (Incident coordination)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Shared Services"]
  node_config["Application configuration<br/>[config.php]"]
  node_bootstrap["Shared runtime helpers<br/>[bootstrap.php]"]
  node_login["Account sign-in<br/>[login.php]"]
  node_register["Resident registration<br/>[register.php]"]
  node_header["Navigation and page shell<br/>[header.php]"]
  node_footer["Page footer<br/>[footer.php]"]
end

subgraph group_operations["Incident Operations"]
  node_dashboard["Role dashboards<br/>[dashboard.php]"]
  node_report["Incident submission<br/>[report.php]"]
  node_incidents["Incident search<br/>[incidents.php]"]
  node_incident["Incident coordination<br/>[incident.php]"]
  node_evidence[("Evidence files")]
  node_file["Evidence retrieval<br/>[file.php]"]
  node_notifications["Notifications<br/>[notifications.php]"]
end

subgraph group_oversight["Administration and Reporting"]
  node_useradmin["User management<br/>[users.php]"]
  node_reports["Operational summaries<br/>[reports.php]"]
  node_audit["Audit trail<br/>[audit.php]"]
end

node_visitor(("Residents and staff"))
node_mysql[("MySQL database")]

node_visitor -->|"signs in"| node_login
node_visitor -->|"registers"| node_register
node_visitor -->|"submits report"| node_report
node_visitor -->|"views operations"| node_dashboard
node_bootstrap -->|"loads settings"| node_config
node_login -->|"uses helpers"| node_bootstrap
node_register -->|"uses helpers"| node_bootstrap
node_report -->|"uses helpers"| node_bootstrap
node_dashboard -->|"uses helpers"| node_bootstrap
node_incidents -->|"uses helpers"| node_bootstrap
node_incident -->|"uses helpers"| node_bootstrap
node_file -->|"uses helpers"| node_bootstrap
node_notifications -->|"uses helpers"| node_bootstrap
node_reports -->|"uses helpers"| node_bootstrap
node_audit -->|"uses helpers"| node_bootstrap
node_useradmin -->|"uses helpers"| node_bootstrap
node_login -->|"reads and updates"| node_mysql
node_register -->|"creates account"| node_mysql
node_report -->|"records incident"| node_mysql
node_incident -->|"reads and updates"| node_mysql
node_dashboard -->|"queries summaries"| node_mysql
node_incidents -->|"queries records"| node_mysql
node_reports -->|"queries and exports"| node_mysql
node_useradmin -->|"manages accounts"| node_mysql
node_bootstrap -->|"persists audit and notices"| node_mysql
node_report -->|"stores uploads"| node_evidence
node_file -->|"serves files"| node_evidence
node_incident -->|"updates statuses and notifies"| node_bootstrap
node_header -->|"loads user and notices"| node_bootstrap
node_login -->|"renders page"| node_header
node_register -->|"renders page"| node_header
node_report -->|"renders page"| node_header
node_incident -->|"renders page"| node_header
node_dashboard -->|"renders page"| node_header
node_reports -->|"renders page"| node_header
node_useradmin -->|"renders page"| node_header
node_incidents -->|"renders page"| node_header
node_header -.->|"precedes shell footer"| node_footer

click node_config "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/config.php"
click node_bootstrap "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/bootstrap.php"
click node_login "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/login.php"
click node_register "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/register.php"
click node_useradmin "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/users.php"
click node_dashboard "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/dashboard.php"
click node_report "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/report.php"
click node_incidents "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/incidents.php"
click node_incident "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/incident.php"
click node_evidence "https://github.com/princejabonero0/sagipalert/tree/master/sagipalert/storage/evidence"
click node_file "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/file.php"
click node_notifications "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/notifications.php"
click node_reports "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/reports.php"
click node_audit "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/audit.php"
click node_header "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/header.php"
click node_footer "https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/footer.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_config,node_bootstrap,node_login,node_register,node_header,node_footer toneBlue
class node_dashboard,node_report,node_incidents,node_incident,node_evidence,node_file,node_notifications,node_mysql toneAmber
class node_useradmin,node_reports,node_audit toneMint
class node_visitor toneIndigo
```

## Components

### Access and Shared Services

- [Application configuration](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/config.php): `sagipalert/config.php`
- [Shared runtime helpers](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/bootstrap.php): `sagipalert/inc/bootstrap.php`
- [Account sign-in](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/login.php): `sagipalert/login.php`
- [Resident registration](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/register.php): `sagipalert/register.php`
- [Navigation and page shell](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/header.php): `sagipalert/inc/header.php`
- [Page footer](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/inc/footer.php): `sagipalert/inc/footer.php`

### Incident Operations

- [Role dashboards](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/dashboard.php): `sagipalert/dashboard.php`
- [Incident submission](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/report.php): `sagipalert/report.php`
- [Incident search](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/incidents.php): `sagipalert/incidents.php`
- [Incident coordination](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/incident.php): `sagipalert/incident.php`
- [Evidence files](https://github.com/princejabonero0/sagipalert/tree/master/sagipalert/storage/evidence): `sagipalert/storage/evidence`
- [Evidence retrieval](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/file.php): `sagipalert/file.php`
- [Notifications](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/notifications.php): `sagipalert/notifications.php`

### Administration and Reporting

- [User management](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/users.php): `sagipalert/users.php`
- [Operational summaries](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/reports.php): `sagipalert/reports.php`
- [Audit trail](https://github.com/princejabonero0/sagipalert/blob/master/sagipalert/audit.php): `sagipalert/audit.php`

### Other components

- **Residents and staff**
- **MySQL database**

## Connections

- Residents and staff → Account sign-in: signs in (evidence: `sagipalert/login.php`)
- Residents and staff → Resident registration: registers (evidence: `sagipalert/register.php`)
- Residents and staff → Incident submission: submits report (evidence: `sagipalert/report.php`)
- Residents and staff → Role dashboards: views operations (evidence: `sagipalert/dashboard.php`)
- Shared runtime helpers → Application configuration: loads settings (evidence: `sagipalert/inc/bootstrap.php`)
- Account sign-in → Shared runtime helpers: uses helpers (evidence: `sagipalert/login.php`)
- Resident registration → Shared runtime helpers: uses helpers (evidence: `sagipalert/register.php`)
- Incident submission → Shared runtime helpers: uses helpers (evidence: `sagipalert/report.php`)
- Role dashboards → Shared runtime helpers: uses helpers (evidence: `sagipalert/dashboard.php`)
- Incident search → Shared runtime helpers: uses helpers (evidence: `sagipalert/incidents.php`)
- Incident coordination → Shared runtime helpers: uses helpers (evidence: `sagipalert/incident.php`)
- Evidence retrieval → Shared runtime helpers: uses helpers (evidence: `sagipalert/file.php`)
- Notifications → Shared runtime helpers: uses helpers (evidence: `sagipalert/notifications.php`)
- Operational summaries → Shared runtime helpers: uses helpers (evidence: `sagipalert/reports.php`)
- Audit trail → Shared runtime helpers: uses helpers (evidence: `sagipalert/audit.php`)
- User management → Shared runtime helpers: uses helpers (evidence: `sagipalert/users.php`)
- Account sign-in → MySQL database: reads and updates (evidence: `sagipalert/login.php`)
- Resident registration → MySQL database: creates account (evidence: `sagipalert/register.php`)
- Incident submission → MySQL database: records incident (evidence: `sagipalert/report.php`)
- Incident coordination → MySQL database: reads and updates (evidence: `sagipalert/incident.php`)
- Role dashboards → MySQL database: queries summaries (evidence: `sagipalert/dashboard.php`)
- Incident search → MySQL database: queries records (evidence: `sagipalert/incidents.php`)
- Operational summaries → MySQL database: queries and exports (evidence: `sagipalert/reports.php`)
- User management → MySQL database: manages accounts (evidence: `sagipalert/users.php`)
- Shared runtime helpers → MySQL database: persists audit and notices (evidence: `sagipalert/inc/bootstrap.php`)
- Incident submission → Evidence files: stores uploads (evidence: `sagipalert/report.php`)
- Evidence retrieval → Evidence files: serves files (evidence: `sagipalert/file.php`)
- Incident coordination → Shared runtime helpers: updates statuses and notifies (evidence: `sagipalert/incident.php`)
- Navigation and page shell → Shared runtime helpers: loads user and notices (evidence: `sagipalert/inc/header.php`)
- Account sign-in → Navigation and page shell: renders page (evidence: `sagipalert/login.php`)
- Resident registration → Navigation and page shell: renders page (evidence: `sagipalert/register.php`)
- Incident submission → Navigation and page shell: renders page (evidence: `sagipalert/report.php`)
- Incident coordination → Navigation and page shell: renders page (evidence: `sagipalert/incident.php`)
- Role dashboards → Navigation and page shell: renders page (evidence: `sagipalert/dashboard.php`)
- Operational summaries → Navigation and page shell: renders page (evidence: `sagipalert/reports.php`)
- User management → Navigation and page shell: renders page (evidence: `sagipalert/users.php`)
- Incident search → Navigation and page shell: renders page (evidence: `sagipalert/incidents.php`)
- Navigation and page shell → Page footer: precedes shell footer
