# jaba24827/st-dwp-mvp architecture

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

- Interactive diagram: https://gitdiagram.com/jaba24827/st-dwp-mvp
- Repository: https://github.com/jaba24827/st-dwp-mvp

## Overview

SL-DWP is a Laravel digital workplace with Blade screens and a parallel React presentation tier. The main workflow is sign-in, MFA verification, then permission-scoped access to dashboards, documents, directory, announcements, audit, and administration features. Controllers handle resource operations; shared services provide MFA, document handling, and auditing, while Eloquent models represent the domain and persist state. The React session hook obtains permissions from the API. Some branches are documented but their source was not sampled, so their links are limited to documented or indexed relationships.

Main entry points: [`routes/web.php`](https://github.com/jaba24827/st-dwp-mvp/blob/main/routes/web.php) (Web routes), [`app/Services/AuditLogger.php`](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/AuditLogger.php) (Audit logging), [`app/Http/Controllers/Auth/LoginController.php`](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/Auth/LoginController.php) (Password login), [`config/database.php`](https://github.com/jaba24827/st-dwp-mvp/blob/main/config/database.php) (MySQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_front["Laravel entry<br/>[index.php]"]
  node_bootstrap["Application setup<br/>[app.php]"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_identity["Identity and access"]
  node_login["Password login"]
  node_mfa_controller["MFA verification<br/>[MfaController.php]"]
  node_mfa_service["MFA service<br/>[MfaService.php]"]
  node_mfa_notification["MFA delivery"]
  node_permission_middleware["Permission checks"]
end

subgraph group_workplace["Workplace features"]
  node_dashboard["Dashboard"]
  node_directory["Staff directory"]
  node_documents["Document access"]
  node_document_service["Document handling"]
  node_announcements["Announcements"]
  node_audit_controller["Audit review"]
  node_roles_admin["Role administration<br/>[RoleController.php]"]
  node_users_admin["User administration<br/>[UserController.php]"]
end

subgraph group_domain["Domain and persistence"]
  node_user_model["Users and roles<br/>[User.php]"]
  node_role_model["Role permissions<br/>[Role.php]"]
  node_permission_model["Permission records<br/>[Permission.php]"]
  node_audit_service["Audit logging<br/>[AuditLogger.php]"]
  node_audit_model[("Audit records<br/>[AuditLog.php]")]
  node_document_model[("Document records<br/>[Document.php]")]
  node_sector_model[("Sector records<br/>[Sector.php]")]
  node_announcement_model[("Announcement records<br/>[Announcement.php]")]
  node_database[("MySQL database<br/>[database.php]")]
end

subgraph group_presentation["Presentation tiers"]
  node_react_entry["React application<br/>[app.jsx]"]
  node_session_hook["Session and permissions<br/>[useSession.jsx]"]
  node_react_shell["React shell<br/>[AppShell.jsx]"]
  node_blade_ui["Blade screens"]
end

node_user_actor(("Workplace user"))

node_user_actor -->|"requests"| node_front
node_front -->|"boots"| node_bootstrap
node_bootstrap -->|"registers"| node_web_routes
node_user_actor -->|"signs in"| node_login
node_web_routes -->|"routes to"| node_login
node_login -->|"loads user"| node_user_model
node_login -->|"issues challenge"| node_mfa_service
node_login -->|"records outcome"| node_audit_service
node_mfa_controller -->|"verifies code"| node_mfa_service
node_mfa_service -->|"sends code"| node_mfa_notification
node_permission_middleware -->|"logs denial"| node_audit_service
node_user_model -->|"checks permission"| node_role_model
node_role_model -->|"has permissions"| node_permission_model
node_web_routes -->|"routes to"| node_dashboard
node_web_routes -->|"routes to"| node_directory
node_web_routes -->|"routes to"| node_documents
node_web_routes -->|"routes to"| node_announcements
node_web_routes -->|"routes to"| node_audit_controller
node_web_routes -->|"routes to"| node_roles_admin
node_web_routes -->|"routes to"| node_users_admin
node_documents -->|"stores and streams"| node_document_service
node_documents -->|"queries records"| node_document_model
node_documents -->|"records actions"| node_audit_service
node_announcements -->|"queries records"| node_announcement_model
node_announcements -->|"records actions"| node_audit_service
node_audit_controller -->|"reads records"| node_audit_model
node_audit_service -->|"writes records"| node_audit_model
node_roles_admin -->|"updates roles"| node_role_model
node_roles_admin -->|"loads permissions"| node_permission_model
node_users_admin -->|"manages users"| node_user_model
node_users_admin -->|"records changes"| node_audit_service
node_react_entry -->|"provides session"| node_session_hook
node_react_entry -->|"renders routes"| node_react_shell
node_session_hook -->|"fetches session"| node_api_routes
node_react_entry -->|"calls API"| node_api_routes
node_user_actor -->|"uses screens"| node_blade_ui
node_document_model -.->|"persists"| node_database
node_user_model -.->|"persists"| node_database
node_sector_model -.->|"persists"| node_database
node_announcement_model -.->|"persists"| node_database
node_audit_model -.->|"persists"| node_database

click node_front "https://github.com/jaba24827/st-dwp-mvp/blob/main/public/index.php"
click node_bootstrap "https://github.com/jaba24827/st-dwp-mvp/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/jaba24827/st-dwp-mvp/blob/main/routes/web.php"
click node_api_routes "https://github.com/jaba24827/st-dwp-mvp/blob/main/routes/api.php"
click node_login "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_mfa_controller "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/Auth/MfaController.php"
click node_mfa_service "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/MfaService.php"
click node_mfa_notification "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Notifications/MfaCodeNotification.php"
click node_permission_middleware "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Middleware/EnsurePermission.php"
click node_user_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/User.php"
click node_role_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Role.php"
click node_permission_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Permission.php"
click node_dashboard "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DashboardController.php"
click node_directory "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DirectoryController.php"
click node_documents "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DocumentController.php"
click node_document_service "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/DocumentService.php"
click node_announcements "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/AnnouncementController.php"
click node_audit_controller "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/AuditController.php"
click node_roles_admin "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/RoleController.php"
click node_users_admin "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/UserController.php"
click node_audit_service "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/AuditLogger.php"
click node_audit_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/AuditLog.php"
click node_document_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Document.php"
click node_sector_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Sector.php"
click node_announcement_model "https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Announcement.php"
click node_react_entry "https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/app.jsx"
click node_session_hook "https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/hooks/useSession.jsx"
click node_react_shell "https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/components/AppShell.jsx"
click node_blade_ui "https://github.com/jaba24827/st-dwp-mvp/tree/main/resources/views"
click node_database "https://github.com/jaba24827/st-dwp-mvp/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_front,node_bootstrap,node_web_routes,node_api_routes,node_user_actor toneBlue
class node_login,node_mfa_controller,node_mfa_service,node_mfa_notification,node_permission_middleware toneAmber
class node_dashboard,node_directory,node_documents,node_document_service,node_announcements,node_audit_controller,node_roles_admin,node_users_admin toneMint
class node_user_model,node_role_model,node_permission_model,node_audit_service,node_audit_model,node_document_model,node_sector_model,node_announcement_model,node_database toneRose
class node_react_entry,node_session_hook,node_react_shell,node_blade_ui toneIndigo
```

## Components

### Application entry

- [Laravel entry](https://github.com/jaba24827/st-dwp-mvp/blob/main/public/index.php): `public/index.php`
- [Application setup](https://github.com/jaba24827/st-dwp-mvp/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Web routes](https://github.com/jaba24827/st-dwp-mvp/blob/main/routes/web.php): `routes/web.php`
- [API routes](https://github.com/jaba24827/st-dwp-mvp/blob/main/routes/api.php): `routes/api.php`

### Identity and access

- [Password login](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [MFA verification](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/Auth/MfaController.php): `app/Http/Controllers/Auth/MfaController.php`
- [MFA service](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/MfaService.php): `app/Services/MfaService.php`
- [MFA delivery](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Notifications/MfaCodeNotification.php): `app/Notifications/MfaCodeNotification.php`
- [Permission checks](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Middleware/EnsurePermission.php): `app/Http/Middleware/EnsurePermission.php`

### Workplace features

- [Dashboard](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Staff directory](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DirectoryController.php): `app/Http/Controllers/DirectoryController.php`
- [Document access](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/DocumentController.php): `app/Http/Controllers/DocumentController.php`
- [Document handling](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/DocumentService.php): `app/Services/DocumentService.php`
- [Announcements](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/AnnouncementController.php): `app/Http/Controllers/AnnouncementController.php`
- [Audit review](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/AuditController.php): `app/Http/Controllers/AuditController.php`
- [Role administration](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/RoleController.php): `app/Http/Controllers/RoleController.php`
- [User administration](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`

### Domain and persistence

- [Users and roles](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/User.php): `app/Models/User.php`
- [Role permissions](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Role.php): `app/Models/Role.php`
- [Permission records](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Permission.php): `app/Models/Permission.php`
- [Audit logging](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Services/AuditLogger.php): `app/Services/AuditLogger.php`
- [Audit records](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/AuditLog.php): `app/Models/AuditLog.php`
- [Document records](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Document.php): `app/Models/Document.php`
- [Sector records](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Sector.php): `app/Models/Sector.php`
- [Announcement records](https://github.com/jaba24827/st-dwp-mvp/blob/main/app/Models/Announcement.php): `app/Models/Announcement.php`
- [MySQL database](https://github.com/jaba24827/st-dwp-mvp/blob/main/config/database.php): `config/database.php`

### Presentation tiers

- [React application](https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/app.jsx): `resources/js/app.jsx`
- [Session and permissions](https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/hooks/useSession.jsx): `resources/js/hooks/useSession.jsx`
- [React shell](https://github.com/jaba24827/st-dwp-mvp/blob/main/resources/js/components/AppShell.jsx): `resources/js/components/AppShell.jsx`
- [Blade screens](https://github.com/jaba24827/st-dwp-mvp/tree/main/resources/views): `resources/views`

### Other components

- **Workplace user**

## Connections

- Workplace user → Laravel entry: requests (evidence: `README.md`)
- Laravel entry → Application setup: boots (evidence: `public/index.php`)
- Application setup → Web routes: registers (evidence: `bootstrap/app.php`)
- Workplace user → Password login: signs in (evidence: `README.md`)
- Web routes → Password login: routes to (evidence: `routes/web.php`)
- Password login → Users and roles: loads user (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Password login → MFA service: issues challenge (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Password login → Audit logging: records outcome (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- MFA verification → MFA service: verifies code (evidence: `app/Http/Controllers/Auth/MfaController.php`)
- MFA service → MFA delivery: sends code (evidence: `app/Services/MfaService.php`)
- Permission checks → Audit logging: logs denial (evidence: `app/Http/Middleware/EnsurePermission.php`)
- Users and roles → Role permissions: checks permission (evidence: `app/Models/User.php`)
- Role permissions → Permission records: has permissions (evidence: `app/Models/Role.php`)
- Web routes → Dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Staff directory: routes to (evidence: `routes/web.php`)
- Web routes → Document access: routes to (evidence: `routes/web.php`)
- Web routes → Announcements: routes to (evidence: `routes/web.php`)
- Web routes → Audit review: routes to (evidence: `routes/web.php`)
- Web routes → Role administration: routes to (evidence: `routes/web.php`)
- Web routes → User administration: routes to (evidence: `routes/web.php`)
- Document access → Document handling: stores and streams (evidence: `app/Http/Controllers/DocumentController.php`)
- Document access → Document records: queries records (evidence: `app/Http/Controllers/DocumentController.php`)
- Document access → Audit logging: records actions (evidence: `app/Http/Controllers/DocumentController.php`)
- Announcements → Announcement records: queries records (evidence: `app/Http/Controllers/AnnouncementController.php`)
- Announcements → Audit logging: records actions (evidence: `app/Http/Controllers/AnnouncementController.php`)
- Audit review → Audit records: reads records (evidence: `app/Http/Controllers/AuditController.php`)
- Audit logging → Audit records: writes records (evidence: `app/Services/AuditLogger.php`)
- Role administration → Role permissions: updates roles (evidence: `app/Http/Controllers/RoleController.php`)
- Role administration → Permission records: loads permissions (evidence: `app/Http/Controllers/RoleController.php`)
- User administration → Users and roles: manages users (evidence: `app/Http/Controllers/UserController.php`)
- User administration → Audit logging: records changes (evidence: `app/Http/Controllers/UserController.php`)
- React application → Session and permissions: provides session (evidence: `resources/js/app.jsx`)
- React application → React shell: renders routes (evidence: `resources/js/app.jsx`)
- Session and permissions → API routes: fetches session (evidence: `resources/js/hooks/useSession.jsx`)
- React application → API routes: calls API (evidence: `resources/js/app.jsx`)
- Workplace user → Blade screens: uses screens (evidence: `README.md`)
- Document records → MySQL database: persists
- Users and roles → MySQL database: persists
- Sector records → MySQL database: persists
- Announcement records → MySQL database: persists
- Audit records → MySQL database: persists
