# warkeys/guardian-app architecture

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

- Interactive diagram: https://gitdiagram.com/warkeys/guardian-app
- Repository: https://github.com/warkeys/guardian-app

## Overview

Guardian is a Laravel platform for managing emergency profiles and sharing selected information through a public QR-linked page. Owners and administrators create profiles and control public fields; visitors scan the QR to view permitted details and may send a location-bearing WhatsApp alert. Separate capabilities cover account activation and retention, user/role administration, personal preferences, and scan/dashboard reporting. Edges rely on the README, route declarations, and sampled source references; unsampled implementation details are not inferred.

Main entry points: [`routes/web.php`](https://github.com/warkeys/guardian-app/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/EmergencyProfilePublicController.php`](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfilePublicController.php) (Public profile and QR), [`app/Http/Controllers/EmergencyProfileController.php`](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfileController.php) (Profile management), [`app/Http/Controllers/UserController.php`](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/UserController.php) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profiles["Emergency profiles"]
  node_profile_mgmt["Profile management"]
  node_profile_model["Emergency profile"]
  node_device_code["Device code generator"]
end

subgraph group_public["Public access and alerts"]
  node_public_access["Public profile and QR"]
  node_scan_history[("Scan history")]
  node_alert_records[("Alert records")]
  node_whatsapp_service["WhatsApp sender"]
end

subgraph group_accounts["Accounts and administration"]
  node_users["User administration<br/>[UserController.php]"]
  node_user_model[("User accounts<br/>[User.php]")]
  node_activation["Account activation"]
  node_settings["Settings and preferences"]
end

subgraph group_insights["Dashboard and reporting"]
  node_dashboard["Dashboard reporting"]
  node_geoip["Local GeoIP lookup"]
end

subgraph group_foundation["Domain and integration services"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_database[("Application database<br/>[database.php]")]
  node_configuration["Permission configuration"]
  node_customize["Role customization<br/>[Customize.php]"]
  node_random["Random generator<br/>[GenerarRandom.php]"]
  node_role_permissions["Role permissions<br/>[RolePermission.php]"]
end

node_owner(("Profile owner"))
node_visitor(("QR visitor"))
node_whatsapp{{"WhatsApp Business"}}

node_owner -->|"opens account"| node_web_routes
node_web_routes -->|"routes profiles"| node_profile_mgmt
node_profile_mgmt -->|"manages records"| node_profile_model
node_profile_mgmt -->|"generates codes"| node_device_code
node_profile_mgmt -.->|"persists profiles"| node_database
node_owner -->|"manages users"| node_web_routes
node_web_routes -->|"routes accounts"| node_users
node_users -->|"manages accounts"| node_user_model
node_users -->|"updates permissions"| node_configuration
node_configuration -->|"checks role"| node_customize
node_configuration -->|"loads permissions"| node_role_permissions
node_web_routes -->|"routes activation"| node_activation
node_activation -->|"activates accounts"| node_user_model
node_owner -->|"sets preferences"| node_web_routes
node_web_routes -->|"routes settings"| node_settings
node_visitor -->|"opens QR page"| node_web_routes
node_web_routes -->|"routes public pages"| node_public_access
node_public_access -->|"reads profile"| node_profile_model
node_public_access -->|"records scans"| node_scan_history
node_public_access -->|"records alerts"| node_alert_records
node_public_access -->|"sends alert"| node_whatsapp_service
node_whatsapp_service -->|"sends template"| node_whatsapp
node_web_routes -->|"routes dashboard"| node_dashboard
node_dashboard -->|"summarizes profiles"| node_profile_model
node_dashboard -->|"summarizes scans"| node_scan_history
node_public_access -->|"resolves country"| node_geoip
node_dashboard -.->|"shows scan country"| node_geoip
node_profile_model -->|"uses owner defaults"| node_user_model
node_users -->|"imports users"| node_random

click node_web_routes "https://github.com/warkeys/guardian-app/blob/main/routes/web.php"
click node_profile_mgmt "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfileController.php"
click node_profile_model "https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfile.php"
click node_device_code "https://github.com/warkeys/guardian-app/blob/main/app/Services/EmergencyProfileDeviceCodeGenerator.php"
click node_public_access "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfilePublicController.php"
click node_scan_history "https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfileScan.php"
click node_alert_records "https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfileAlert.php"
click node_whatsapp_service "https://github.com/warkeys/guardian-app/blob/main/app/Http/Services/WhatsAppService.php"
click node_users "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/UserController.php"
click node_user_model "https://github.com/warkeys/guardian-app/blob/main/app/Models/User.php"
click node_activation "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/AccountActivationController.php"
click node_settings "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/SettingController.php"
click node_dashboard "https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/DashboardController.php"
click node_geoip "https://github.com/warkeys/guardian-app/blob/main/app/Services/GeoIpCountryResolver.php"
click node_database "https://github.com/warkeys/guardian-app/blob/main/config/database.php"
click node_configuration "https://github.com/warkeys/guardian-app/blob/main/app/Http/Traits/ConfigurationTrait.php"
click node_customize "https://github.com/warkeys/guardian-app/blob/main/app/Helpers/Customize.php"
click node_random "https://github.com/warkeys/guardian-app/blob/main/app/Helpers/GenerarRandom.php"
click node_role_permissions "https://github.com/warkeys/guardian-app/blob/main/app/Helpers/RolePermission.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_profile_mgmt,node_profile_model,node_device_code toneBlue
class node_public_access,node_scan_history,node_alert_records,node_whatsapp_service toneAmber
class node_users,node_user_model,node_activation,node_settings toneMint
class node_dashboard,node_geoip toneRose
class node_web_routes,node_database,node_configuration,node_customize,node_random,node_role_permissions,node_owner,node_visitor,node_whatsapp toneIndigo
```

## Components

### Emergency profiles

- [Profile management](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfileController.php): `app/Http/Controllers/EmergencyProfileController.php`
- [Emergency profile](https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfile.php): `app/Models/EmergencyProfile.php`
- [Device code generator](https://github.com/warkeys/guardian-app/blob/main/app/Services/EmergencyProfileDeviceCodeGenerator.php): `app/Services/EmergencyProfileDeviceCodeGenerator.php`

### Public access and alerts

- [Public profile and QR](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/EmergencyProfilePublicController.php): `app/Http/Controllers/EmergencyProfilePublicController.php`
- [Scan history](https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfileScan.php): `app/Models/EmergencyProfileScan.php`
- [Alert records](https://github.com/warkeys/guardian-app/blob/main/app/Models/EmergencyProfileAlert.php): `app/Models/EmergencyProfileAlert.php`
- [WhatsApp sender](https://github.com/warkeys/guardian-app/blob/main/app/Http/Services/WhatsAppService.php): `app/Http/Services/WhatsAppService.php`

### Accounts and administration

- [User administration](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`
- [User accounts](https://github.com/warkeys/guardian-app/blob/main/app/Models/User.php): `app/Models/User.php`
- [Account activation](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/AccountActivationController.php): `app/Http/Controllers/AccountActivationController.php`
- [Settings and preferences](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/SettingController.php): `app/Http/Controllers/SettingController.php`

### Dashboard and reporting

- [Dashboard reporting](https://github.com/warkeys/guardian-app/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Local GeoIP lookup](https://github.com/warkeys/guardian-app/blob/main/app/Services/GeoIpCountryResolver.php): `app/Services/GeoIpCountryResolver.php`

### Domain and integration services

- [Web routes](https://github.com/warkeys/guardian-app/blob/main/routes/web.php): `routes/web.php`
- [Application database](https://github.com/warkeys/guardian-app/blob/main/config/database.php): `config/database.php`
- [Permission configuration](https://github.com/warkeys/guardian-app/blob/main/app/Http/Traits/ConfigurationTrait.php): `app/Http/Traits/ConfigurationTrait.php`
- [Role customization](https://github.com/warkeys/guardian-app/blob/main/app/Helpers/Customize.php): `app/Helpers/Customize.php`
- [Random generator](https://github.com/warkeys/guardian-app/blob/main/app/Helpers/GenerarRandom.php): `app/Helpers/GenerarRandom.php`
- [Role permissions](https://github.com/warkeys/guardian-app/blob/main/app/Helpers/RolePermission.php): `app/Helpers/RolePermission.php`

### Other components

- **Profile owner**
- **QR visitor**
- **WhatsApp Business**

## Connections

- Profile owner → Web routes: opens account (evidence: `README.md`)
- Web routes → Profile management: routes profiles (evidence: `routes/web.php`)
- Profile management → Emergency profile: manages records (evidence: `app/Http/Controllers/EmergencyProfileController.php`)
- Profile management → Device code generator: generates codes (evidence: `app/Http/Controllers/EmergencyProfileController.php`)
- Profile management → Application database: persists profiles
- Profile owner → Web routes: manages users (evidence: `README.md`)
- Web routes → User administration: routes accounts (evidence: `routes/web.php`)
- User administration → User accounts: manages accounts (evidence: `app/Http/Controllers/UserController.php`)
- User administration → Permission configuration: updates permissions (evidence: `app/Http/Controllers/UserController.php`)
- Permission configuration → Role customization: checks role (evidence: `app/Http/Traits/ConfigurationTrait.php`)
- Permission configuration → Role permissions: loads permissions (evidence: `app/Http/Traits/ConfigurationTrait.php`)
- Web routes → Account activation: routes activation (evidence: `routes/web.php`)
- Account activation → User accounts: activates accounts (evidence: `app/Http/Controllers/AccountActivationController.php`)
- Profile owner → Web routes: sets preferences (evidence: `README.md`)
- Web routes → Settings and preferences: routes settings (evidence: `routes/web.php`)
- QR visitor → Web routes: opens QR page (evidence: `README.md`)
- Web routes → Public profile and QR: routes public pages (evidence: `routes/web.php`)
- Public profile and QR → Emergency profile: reads profile (evidence: `app/Http/Controllers/EmergencyProfilePublicController.php`)
- Public profile and QR → Scan history: records scans (evidence: `app/Http/Controllers/EmergencyProfilePublicController.php`)
- Public profile and QR → Alert records: records alerts (evidence: `app/Http/Controllers/EmergencyProfilePublicController.php`)
- Public profile and QR → WhatsApp sender: sends alert (evidence: `app/Http/Controllers/EmergencyProfilePublicController.php`)
- WhatsApp sender → WhatsApp Business: sends template (evidence: `app/Http/Services/WhatsAppService.php`)
- Web routes → Dashboard reporting: routes dashboard (evidence: `routes/web.php`)
- Dashboard reporting → Emergency profile: summarizes profiles (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard reporting → Scan history: summarizes scans (evidence: `app/Http/Controllers/DashboardController.php`)
- Public profile and QR → Local GeoIP lookup: resolves country (evidence: `app/Http/Controllers/EmergencyProfilePublicController.php`)
- Dashboard reporting → Local GeoIP lookup: shows scan country
- Emergency profile → User accounts: uses owner defaults (evidence: `app/Models/EmergencyProfile.php`)
- User administration → Random generator: imports users (evidence: `app/Http/Controllers/UserController.php`)
