# talipanfranklawrenzeulogbcp-droid/ct48 architecture

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

- Interactive diagram: https://gitdiagram.com/talipanfranklawrenzeulogbcp-droid/ct48
- Repository: https://github.com/talipanfranklawrenzeulogbcp-droid/ct48

## Overview

Great Solomon CT4 is a PHP/MySQL workforce governance application. Users sign in with a password and emailed OTP, then use role-gated modules to manage health and safety, compliance documents, assets, feedback, tasks, and administration; dashboards and reports provide oversight. The tree and README establish the product branches, while excerpts show selected service calls and persistence behavior. Some routes and services were not sampled, so their internal connections are omitted rather than inferred.

Main entry points: [`dashboard.php`](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/dashboard.php) (Dashboard), [`includes/db.php`](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/db.php) (MySQL Connection), [`auth/login.php`](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/auth/login.php) (Password Login), [`services/HealthSafetyService.php`](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/HealthSafetyService.php) (Health Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; Runtime"]
  node_login["Password Login<br/>[login.php]"]
  node_otp["OTP Verification<br/>[verify_otp.php]"]
  node_auth["Session &amp; Access<br/>[auth.php]"]
end

subgraph group_operations["Operational Modules"]
  node_health["Health &amp; Safety<br/>[index.php]"]
  node_healthwrite["Health Record Entry"]
  node_legal["Legal Compliance<br/>[index.php]"]
  node_documents["Employee Documents"]
  node_assets["Asset Issuance<br/>[index.php]"]
  node_feedback["Feedback Cases<br/>[index.php]"]
  node_storageui["Data Storage<br/>[data_storage.php]"]
end

subgraph group_oversight["Oversight &amp; Workflow"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_admin["Admin Security<br/>[index.php]"]
  node_tasks["Tasks &amp; Approvals<br/>[tasks.php]"]
  node_archive["Archive Recovery<br/>[archive.php]"]
  node_assistant["AI Assistant API<br/>[gemini.php]"]
end

subgraph group_services["Service Layer"]
  node_api["Service API Gateway<br/>[index.php]"]
  node_assetservice["Asset Service"]
  node_healthservice["Health Service"]
  node_legalservice["Legal Service"]
  node_adminservice["Admin Service"]
  node_feedbackservice["Feedback Service"]
  node_reportservice["Reports Service<br/>[ReportsService.php]"]
  node_notificationservice["Notification Service"]
  node_storageservice["Storage Service"]
end

subgraph group_platform["Persistence &amp; Integrations"]
  node_mail["Gmail Mailer<br/>[mailer.php]"]
  node_db[("MySQL Connection<br/>[db.php]")]
  node_database[("CT4 Database")]
end

node_staff(("Staff / Admin"))
node_gemini["Gemini API"]

node_staff -->|"signs in"| node_login
node_login -->|"starts verification"| node_otp
node_login -->|"sends OTP"| node_mail
node_otp -->|"establishes session"| node_auth
node_staff -->|"opens workspace"| node_dashboard
node_health -->|"uses service"| node_healthservice
node_healthwrite -->|"uses service"| node_healthservice
node_legal -->|"uses service"| node_legalservice
node_documents -->|"uses service"| node_legalservice
node_assets -->|"dispatches actions"| node_assetservice
node_admin -->|"dispatches actions"| node_adminservice
node_feedback -.->|"uses service"| node_feedbackservice
node_dashboard -.->|"loads reports"| node_reportservice
node_dashboard -.->|"tracks records"| node_healthservice
node_dashboard -.->|"tracks obligations"| node_legalservice
node_tasks -->|"stores tasks"| node_db
node_archive -.->|"recovers records"| node_db
node_storageui -->|"saves files"| node_storageservice
node_storageservice -.->|"queries database"| node_db
node_db -->|"connects"| node_database
node_assistant -->|"sends context"| node_gemini
node_api -->|"routes requests"| node_assistant

click node_login "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/auth/login.php"
click node_otp "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/auth/verify_otp.php"
click node_auth "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/auth.php"
click node_mail "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/mailer.php"
click node_dashboard "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/dashboard.php"
click node_health "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/health_safety/index.php"
click node_healthwrite "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/health_safety/add_health_record.php"
click node_legal "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/legal_compliance/index.php"
click node_documents "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/legal_compliance/manage_employee_documents.php"
click node_assets "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/asset_equipment/index.php"
click node_feedback "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/feedback/index.php"
click node_admin "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/system_admin_security/index.php"
click node_tasks "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/tasks.php"
click node_archive "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/archive.php"
click node_assistant "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/api/gemini.php"
click node_api "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/api/index.php"
click node_assetservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/AssetEquipmentService.php"
click node_healthservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/HealthSafetyService.php"
click node_legalservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/LegalComplianceService.php"
click node_adminservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/AdminSecurityService.php"
click node_feedbackservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/FeedbackService.php"
click node_reportservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/ReportsService.php"
click node_notificationservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/NotificationService.php"
click node_storageui "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/data_storage.php"
click node_storageservice "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/DataStorageService.php"
click node_db "https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/db.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_login,node_otp,node_auth toneBlue
class node_health,node_healthwrite,node_legal,node_documents,node_assets,node_feedback,node_storageui toneAmber
class node_dashboard,node_admin,node_tasks,node_archive,node_assistant,node_gemini toneMint
class node_api,node_assetservice,node_healthservice,node_legalservice,node_adminservice,node_feedbackservice,node_reportservice,node_notificationservice,node_storageservice toneRose
class node_mail,node_db,node_database,node_staff toneIndigo
```

## Components

### Identity & Runtime

- [Password Login](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/auth/login.php): `auth/login.php`
- [OTP Verification](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/auth/verify_otp.php): `auth/verify_otp.php`
- [Session & Access](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/auth.php): `includes/auth.php`

### Operational Modules

- [Health & Safety](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/health_safety/index.php): `modules/health_safety/index.php`
- [Health Record Entry](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/health_safety/add_health_record.php): `modules/health_safety/add_health_record.php`
- [Legal Compliance](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/legal_compliance/index.php): `modules/legal_compliance/index.php`
- [Employee Documents](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/legal_compliance/manage_employee_documents.php): `modules/legal_compliance/manage_employee_documents.php`
- [Asset Issuance](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/asset_equipment/index.php): `modules/asset_equipment/index.php`
- [Feedback Cases](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/feedback/index.php): `modules/feedback/index.php`
- [Data Storage](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/data_storage.php): `data_storage.php`

### Oversight & Workflow

- [Dashboard](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/dashboard.php): `dashboard.php`
- [Admin Security](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/modules/system_admin_security/index.php): `modules/system_admin_security/index.php`
- [Tasks & Approvals](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/tasks.php): `tasks.php`
- [Archive Recovery](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/archive.php): `archive.php`
- [AI Assistant API](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/api/gemini.php): `services/api/gemini.php`

### Service Layer

- [Service API Gateway](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/api/index.php): `services/api/index.php`
- [Asset Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/AssetEquipmentService.php): `services/AssetEquipmentService.php`
- [Health Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/HealthSafetyService.php): `services/HealthSafetyService.php`
- [Legal Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/LegalComplianceService.php): `services/LegalComplianceService.php`
- [Admin Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/AdminSecurityService.php): `AdminSecurityService.php`
- [Feedback Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/FeedbackService.php): `services/FeedbackService.php`
- [Reports Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/services/ReportsService.php): `services/ReportsService.php`
- [Notification Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/NotificationService.php): `NotificationService.php`
- [Storage Service](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/DataStorageService.php): `DataStorageService.php`

### Persistence & Integrations

- [Gmail Mailer](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/mailer.php): `includes/mailer.php`
- [MySQL Connection](https://github.com/talipanfranklawrenzeulogbcp-droid/ct48/blob/main/includes/db.php): `includes/db.php`
- **CT4 Database**

### Other components

- **Staff / Admin**
- **Gemini API**

## Connections

- Staff / Admin → Password Login: signs in (evidence: `README.md`)
- Password Login → OTP Verification: starts verification (evidence: `README.md`)
- Password Login → Gmail Mailer: sends OTP (evidence: `auth/login.php`)
- OTP Verification → Session & Access: establishes session (evidence: `README.md`)
- Staff / Admin → Dashboard: opens workspace (evidence: `README.md`)
- Health & Safety → Health Service: uses service (evidence: `modules/health_safety/index.php`)
- Health Record Entry → Health Service: uses service (evidence: `modules/health_safety/add_health_record.php`)
- Legal Compliance → Legal Service: uses service (evidence: `modules/legal_compliance/index.php`)
- Employee Documents → Legal Service: uses service (evidence: `modules/legal_compliance/manage_employee_documents.php`)
- Asset Issuance → Asset Service: dispatches actions (evidence: `modules/asset_equipment/index.php`)
- Admin Security → Admin Service: dispatches actions (evidence: `modules/system_admin_security/index.php`)
- Feedback Cases → Feedback Service: uses service
- Dashboard → Reports Service: loads reports
- Dashboard → Health Service: tracks records (evidence: `README.md`)
- Dashboard → Legal Service: tracks obligations (evidence: `README.md`)
- Tasks & Approvals → MySQL Connection: stores tasks (evidence: `tasks.php`)
- Archive Recovery → MySQL Connection: recovers records (evidence: `README.md`)
- Data Storage → Storage Service: saves files (evidence: `data_storage.php`)
- Storage Service → MySQL Connection: queries database
- MySQL Connection → CT4 Database: connects (evidence: `README.md`)
- AI Assistant API → Gemini API: sends context (evidence: `README.md`)
- Service API Gateway → AI Assistant API: routes requests (evidence: `services/api/index.php`)
