# thefdaapproved/memoriasys architecture

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

- Interactive diagram: https://gitdiagram.com/thefdaapproved/memoriasys
- Repository: https://github.com/thefdaapproved/memoriasys

## Overview

Memoria is a cemetery-management web application for staff and public visitors. Its principal workflow spans grave discovery and allocation, burial/reservation records, lease monitoring, payments, and operational reporting; role-based portals expose these tasks, while the public locator presents cemetery plots and search. The graph also captures CMS/theme, SMS, and security/audit capabilities documented in the README. Source excerpts establish only selected backend dependencies, so UI-to-endpoint wiring is not inferred; README-backed capability edges are cited to README.md.

Main entry points: [`api/textbee.php`](https://github.com/thefdaapproved/memoriasys/blob/main/api/textbee.php) (TextBee gateway), [`api/reusable_functions.php`](https://github.com/thefdaapproved/memoriasys/blob/main/api/reusable_functions.php) (Domain helpers), [`admin.html`](https://github.com/thefdaapproved/memoriasys/blob/main/admin.html) (Admin portal), [`api/database.php`](https://github.com/thefdaapproved/memoriasys/blob/main/api/database.php) (Database connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Portals and mapping"]
  node_public_site["Public locator<br/>[index.html]"]
  node_admin_portal["Admin portal<br/>[admin.html]"]
  node_office_portal["Office portal<br/>[office.html]"]
  node_grounds_portal["Grounds portal<br/>[grounds.html]"]
  node_map["Interactive map<br/>[map.js]"]
end

subgraph group_cemetery["Cemetery operations"]
  node_search["Grave search<br/>[search.php]"]
  node_blocks["Block management<br/>[blocks.php]"]
  node_graves["Plot management<br/>[graves.php]"]
  node_records["Burial records<br/>[records.php]"]
  node_reservations["Reservations<br/>[reserve.php]"]
  node_lease_monitor["Lease monitoring<br/>[monitor.php]"]
end

subgraph group_finance["Finance and oversight"]
  node_payments["Payments<br/>[payments.php]"]
  node_reports["Reports and exports<br/>[reports.php]"]
  node_dashboard["Dashboard metrics<br/>[dashboard.php]"]
end

subgraph group_platform["Shared platform"]
  node_accounts["Accounts and roles<br/>[users.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_session_check["Session validation<br/>[checkuser.php]"]
  node_jwt["JWT library"]
  node_database[("Database connection<br/>[database.php]")]
  node_audit[("Encrypted audit logs<br/>[logger.php]")]
  node_rate_limit["Request throttling<br/>[ratelimit.php]"]
  node_shared_helpers["Domain helpers"]
end

subgraph group_communications["CMS and messaging"]
  node_cms["Site content CMS<br/>[imagemanager.php]"]
  node_themes["Dynamic theming<br/>[rootcolors.php]"]
  node_sms_alerts["SMS alerts<br/>[sms_alerts.php]"]
  node_textbee["TextBee gateway<br/>[textbee.php]"]
end

node_visitor(("Public visitor"))
node_staff(("Cemetery staff"))
node_sms_service{{"TextBee service"}}

node_visitor -->|"opens"| node_public_site
node_public_site -->|"shows plots"| node_map
node_public_site -->|"searches graves"| node_search
node_staff -->|"uses"| node_admin_portal
node_staff -->|"uses"| node_office_portal
node_staff -->|"uses"| node_grounds_portal
node_admin_portal -->|"allocates plots"| node_map
node_office_portal -->|"supports reservations"| node_reservations
node_grounds_portal -->|"supports reservations"| node_reservations
node_records -->|"assigns plots"| node_graves
node_lease_monitor -->|"triggers reminders"| node_sms_alerts
node_sms_alerts -->|"dispatches alerts"| node_textbee
node_textbee -->|"sends SMS"| node_sms_service
node_payments -->|"feeds financial reports"| node_reports
node_admin_portal -->|"customizes content"| node_cms
node_admin_portal -->|"customizes colors"| node_themes
node_auth -->|"validates sessions"| node_session_check
node_session_check -->|"queries users"| node_database
node_session_check -->|"verifies tokens"| node_jwt
node_database -->|"logs failures"| node_audit
node_database -->|"loads middleware"| node_rate_limit
node_textbee -->|"reads credentials"| node_database
node_textbee -->|"uses helpers"| node_shared_helpers
node_sms_alerts -->|"uses gateway"| node_textbee
node_accounts -->|"uses gateway"| node_textbee
node_payments -->|"uses helpers"| node_shared_helpers
node_records -->|"uses helpers"| node_shared_helpers
node_reservations -->|"uses helpers"| node_shared_helpers
node_lease_monitor -->|"uses helpers"| node_shared_helpers
node_reports -->|"uses audit"| node_audit

click node_public_site "https://github.com/thefdaapproved/memoriasys/blob/main/index.html"
click node_admin_portal "https://github.com/thefdaapproved/memoriasys/blob/main/admin.html"
click node_office_portal "https://github.com/thefdaapproved/memoriasys/blob/main/office.html"
click node_grounds_portal "https://github.com/thefdaapproved/memoriasys/blob/main/grounds.html"
click node_map "https://github.com/thefdaapproved/memoriasys/blob/main/assets/js/map.js"
click node_search "https://github.com/thefdaapproved/memoriasys/blob/main/api/search.php"
click node_blocks "https://github.com/thefdaapproved/memoriasys/blob/main/api/blocks.php"
click node_graves "https://github.com/thefdaapproved/memoriasys/blob/main/api/graves.php"
click node_records "https://github.com/thefdaapproved/memoriasys/blob/main/api/records.php"
click node_reservations "https://github.com/thefdaapproved/memoriasys/blob/main/api/reserve.php"
click node_lease_monitor "https://github.com/thefdaapproved/memoriasys/blob/main/api/monitor.php"
click node_payments "https://github.com/thefdaapproved/memoriasys/blob/main/api/payments.php"
click node_reports "https://github.com/thefdaapproved/memoriasys/blob/main/api/reports.php"
click node_dashboard "https://github.com/thefdaapproved/memoriasys/blob/main/api/dashboard.php"
click node_accounts "https://github.com/thefdaapproved/memoriasys/blob/main/api/users.php"
click node_auth "https://github.com/thefdaapproved/memoriasys/blob/main/api/auth.php"
click node_session_check "https://github.com/thefdaapproved/memoriasys/blob/main/api/checkuser.php"
click node_jwt "https://github.com/thefdaapproved/memoriasys/tree/main/api/jwt"
click node_database "https://github.com/thefdaapproved/memoriasys/blob/main/api/database.php"
click node_audit "https://github.com/thefdaapproved/memoriasys/blob/main/api/logger.php"
click node_rate_limit "https://github.com/thefdaapproved/memoriasys/blob/main/api/ratelimit.php"
click node_shared_helpers "https://github.com/thefdaapproved/memoriasys/blob/main/api/reusable_functions.php"
click node_cms "https://github.com/thefdaapproved/memoriasys/blob/main/api/imagemanager.php"
click node_themes "https://github.com/thefdaapproved/memoriasys/blob/main/api/rootcolors.php"
click node_sms_alerts "https://github.com/thefdaapproved/memoriasys/blob/main/api/sms_alerts.php"
click node_textbee "https://github.com/thefdaapproved/memoriasys/blob/main/api/textbee.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_public_site,node_admin_portal,node_office_portal,node_grounds_portal,node_map toneBlue
class node_search,node_blocks,node_graves,node_records,node_reservations,node_lease_monitor toneAmber
class node_payments,node_reports,node_dashboard toneMint
class node_accounts,node_auth,node_session_check,node_jwt,node_database,node_audit,node_rate_limit,node_shared_helpers toneRose
class node_cms,node_themes,node_sms_alerts,node_textbee,node_visitor,node_staff,node_sms_service toneIndigo
```

## Components

### Portals and mapping

- [Public locator](https://github.com/thefdaapproved/memoriasys/blob/main/index.html): `index.html`
- [Admin portal](https://github.com/thefdaapproved/memoriasys/blob/main/admin.html): `admin.html`
- [Office portal](https://github.com/thefdaapproved/memoriasys/blob/main/office.html): `office.html`
- [Grounds portal](https://github.com/thefdaapproved/memoriasys/blob/main/grounds.html): `grounds.html`
- [Interactive map](https://github.com/thefdaapproved/memoriasys/blob/main/assets/js/map.js): `assets/js/map.js`

### Cemetery operations

- [Grave search](https://github.com/thefdaapproved/memoriasys/blob/main/api/search.php): `api/search.php`
- [Block management](https://github.com/thefdaapproved/memoriasys/blob/main/api/blocks.php): `api/blocks.php`
- [Plot management](https://github.com/thefdaapproved/memoriasys/blob/main/api/graves.php): `api/graves.php`
- [Burial records](https://github.com/thefdaapproved/memoriasys/blob/main/api/records.php): `api/records.php`
- [Reservations](https://github.com/thefdaapproved/memoriasys/blob/main/api/reserve.php): `api/reserve.php`
- [Lease monitoring](https://github.com/thefdaapproved/memoriasys/blob/main/api/monitor.php): `api/monitor.php`

### Finance and oversight

- [Payments](https://github.com/thefdaapproved/memoriasys/blob/main/api/payments.php): `api/payments.php`
- [Reports and exports](https://github.com/thefdaapproved/memoriasys/blob/main/api/reports.php): `api/reports.php`
- [Dashboard metrics](https://github.com/thefdaapproved/memoriasys/blob/main/api/dashboard.php): `api/dashboard.php`

### Shared platform

- [Accounts and roles](https://github.com/thefdaapproved/memoriasys/blob/main/api/users.php): `api/users.php`
- [Authentication](https://github.com/thefdaapproved/memoriasys/blob/main/api/auth.php): `api/auth.php`
- [Session validation](https://github.com/thefdaapproved/memoriasys/blob/main/api/checkuser.php): `api/checkuser.php`
- [JWT library](https://github.com/thefdaapproved/memoriasys/tree/main/api/jwt): `api/jwt`
- [Database connection](https://github.com/thefdaapproved/memoriasys/blob/main/api/database.php): `api/database.php`
- [Encrypted audit logs](https://github.com/thefdaapproved/memoriasys/blob/main/api/logger.php): `api/logger.php`
- [Request throttling](https://github.com/thefdaapproved/memoriasys/blob/main/api/ratelimit.php): `api/ratelimit.php`
- [Domain helpers](https://github.com/thefdaapproved/memoriasys/blob/main/api/reusable_functions.php): `api/reusable_functions.php`

### CMS and messaging

- [Site content CMS](https://github.com/thefdaapproved/memoriasys/blob/main/api/imagemanager.php): `api/imagemanager.php`
- [Dynamic theming](https://github.com/thefdaapproved/memoriasys/blob/main/api/rootcolors.php): `api/rootcolors.php`
- [SMS alerts](https://github.com/thefdaapproved/memoriasys/blob/main/api/sms_alerts.php): `api/sms_alerts.php`
- [TextBee gateway](https://github.com/thefdaapproved/memoriasys/blob/main/api/textbee.php): `api/textbee.php`

### Other components

- **Public visitor**
- **Cemetery staff**
- **TextBee service**

## Connections

- Public visitor → Public locator: opens (evidence: `README.md`)
- Public locator → Interactive map: shows plots (evidence: `README.md`)
- Public locator → Grave search: searches graves (evidence: `README.md`)
- Cemetery staff → Admin portal: uses (evidence: `README.md`)
- Cemetery staff → Office portal: uses (evidence: `README.md`)
- Cemetery staff → Grounds portal: uses (evidence: `README.md`)
- Admin portal → Interactive map: allocates plots (evidence: `README.md`)
- Office portal → Reservations: supports reservations (evidence: `README.md`)
- Grounds portal → Reservations: supports reservations (evidence: `README.md`)
- Burial records → Plot management: assigns plots (evidence: `README.md`)
- Lease monitoring → SMS alerts: triggers reminders (evidence: `README.md`)
- SMS alerts → TextBee gateway: dispatches alerts (evidence: `api/sms_alerts.php`)
- TextBee gateway → TextBee service: sends SMS (evidence: `api/textbee.php`)
- Payments → Reports and exports: feeds financial reports (evidence: `README.md`)
- Admin portal → Site content CMS: customizes content (evidence: `README.md`)
- Admin portal → Dynamic theming: customizes colors (evidence: `README.md`)
- Authentication → Session validation: validates sessions (evidence: `api/auth.php`)
- Session validation → Database connection: queries users (evidence: `api/checkuser.php`)
- Session validation → JWT library: verifies tokens (evidence: `api/checkuser.php`)
- Database connection → Encrypted audit logs: logs failures (evidence: `api/database.php`)
- Database connection → Request throttling: loads middleware (evidence: `api/database.php`)
- TextBee gateway → Database connection: reads credentials (evidence: `api/textbee.php`)
- TextBee gateway → Domain helpers: uses helpers (evidence: `api/textbee.php`)
- SMS alerts → TextBee gateway: uses gateway (evidence: `api/sms_alerts.php`)
- Accounts and roles → TextBee gateway: uses gateway (evidence: `api/users.php`)
- Payments → Domain helpers: uses helpers (evidence: `api/payments.php`)
- Burial records → Domain helpers: uses helpers (evidence: `api/records.php`)
- Reservations → Domain helpers: uses helpers (evidence: `api/reserve.php`)
- Lease monitoring → Domain helpers: uses helpers (evidence: `api/monitor.php`)
- Reports and exports → Encrypted audit logs: uses audit (evidence: `api/reports.php`)
