# ci4-cms-erp/ci4ms architecture

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

- Interactive diagram: https://gitdiagram.com/ci4-cms-erp/ci4ms
- Repository: https://github.com/ci4-cms-erp/ci4ms

## Overview

CI4MS is a modular CodeIgniter CMS. A visitor enters through the home route and receives public content; authenticated administrators manage content and site modules through the backend. Separate capabilities include RBAC, media and themes, notifications, migrations, backups, and signed updates. The graph combines documented product stages with source-index-supported links; it does not infer controller-to-storage calls for unsampled modules.

Main entry points: [`app/Config/Events.php`](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Events.php) (Event Wiring), [`app/Config/DefaultRoutes.php`](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/DefaultRoutes.php) (Route Loader), [`modules/Settings/Controllers/Settings.php`](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Settings/Controllers/Settings.php) (Site Settings), [`modules/Pages/Controllers/Pages.php`](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Pages/Controllers/Pages.php) (Page Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public CMS"]
  node_home["Home Controller<br/>[Home.php]"]
  node_pages["Page Management<br/>[Pages.php]"]
  node_blog["Blog Management<br/>[Categories.php]"]
end

subgraph group_admin["Admin &amp; RBAC"]
  node_auth["Authentication"]
  node_sessions["User Sessions"]
  node_users["User Administration<br/>[UserController.php]"]
  node_backend["Backend Base<br/>[BaseController.php]"]
  node_media["Media Manager<br/>[Media.php]"]
  node_fileeditor["File Editor<br/>[Fileeditor.php]"]
  node_themes["Theme Manager<br/>[Theme.php]"]
  node_settings["Site Settings<br/>[Settings.php]"]
  node_language["Translation Manager<br/>[Translations.php]"]
  node_menu["Menu Management<br/>[Menu.php]"]
  node_logs["Log Viewer<br/>[Logs.php]"]
  node_dashboard["Dashboard Widgets<br/>[WidgetService.php]"]
end

subgraph group_platform["Platform Services"]
  node_routes["Route Loader<br/>[DefaultRoutes.php]"]
  node_commonlib["Common Utilities<br/>[CommonLibrary.php]"]
  node_notifications["Notification Composer"]
  node_notifier["Notification Dispatch<br/>[Notifier.php]"]
  node_realtime["Realtime Notifications"]
  node_notificationconfig["Notification Settings"]
  node_events["Event Wiring<br/>[Events.php]"]
  node_appconfig["Application Config<br/>[App.php]"]
  node_databaseconfig["Database Config<br/>[Database.php]"]
  node_emailconfig["Email Config<br/>[Email.php]"]
  node_moduleconfig["Module Discovery<br/>[Modules.php]"]
  node_exceptions["Exception Handling<br/>[Exceptions.php]"]
end

subgraph group_operations["Operations &amp; Extensions"]
  node_updates["Signed Updates<br/>[UpdateService.php]"]
  node_backup["Backup Manager<br/>[Backup.php]"]
  node_migration["Migration Runner"]
  node_runlock["Run Lock<br/>[RunLock.php]"]
  node_installer["Web Installer<br/>[Install.php]"]
  node_moduletools["Module Tools"]
end

node_visitor(("Visitor"))

node_visitor -.->|"requests site"| node_routes
node_routes -->|"routes home"| node_home
node_home -->|"uses utilities"| node_commonlib
node_visitor -.->|"reads pages"| node_pages
node_visitor -.->|"reads blog"| node_blog
node_backend -.->|"requires sign-in"| node_auth
node_users -->|"reads sessions"| node_sessions
node_settings -.->|"runs updates"| node_updates
node_settings -.->|"manages backups"| node_backup
node_migration -->|"acquires lock"| node_runlock
node_notifications -->|"dispatches"| node_notifier
node_realtime -->|"uses notifier"| node_notifier
node_events -->|"loads settings"| node_notificationconfig
node_events -->|"dispatches audit"| node_notifier
node_routes -->|"discovers routes"| node_moduleconfig
node_events -->|"configures events"| node_exceptions
node_appconfig -->|"references config"| node_databaseconfig
node_blog -.->|"manages content"| node_pages
node_themes -.->|"configures theme"| node_settings
node_media -.->|"supports file work"| node_fileeditor
node_language -.->|"localizes content"| node_pages
node_installer -.->|"supports setup"| node_moduletools

click node_routes "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/DefaultRoutes.php"
click node_home "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Controllers/Home.php"
click node_commonlib "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Libraries/CommonLibrary.php"
click node_pages "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Pages/Controllers/Pages.php"
click node_blog "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Blog/Controllers/Categories.php"
click node_auth "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Auth/Controllers/MagicLinkController.php"
click node_sessions "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Auth/Models/UserSessionModel.php"
click node_users "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Users/Controllers/UserController.php"
click node_backend "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backend/Controllers/BaseController.php"
click node_media "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Media/Controllers/Media.php"
click node_fileeditor "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Fileeditor/Controllers/Fileeditor.php"
click node_themes "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Theme/Controllers/Theme.php"
click node_settings "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Settings/Controllers/Settings.php"
click node_updates "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Settings/Libraries/UpdateService.php"
click node_backup "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backup/Controllers/Backup.php"
click node_migration "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/MigrationManager/Controllers/MigrationManager.php"
click node_runlock "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backend/Libraries/RunLock.php"
click node_notifications "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Controllers/ComposerController.php"
click node_notifier "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Libraries/Notifier.php"
click node_realtime "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Controllers/RealtimeController.php"
click node_notificationconfig "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Config/NotificationsConfig.php"
click node_events "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Events.php"
click node_appconfig "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/App.php"
click node_databaseconfig "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Database.php"
click node_emailconfig "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Email.php"
click node_moduleconfig "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Modules.php"
click node_exceptions "https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Exceptions.php"
click node_language "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/LanguageManager/Controllers/Translations.php"
click node_menu "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Menu/Controllers/Menu.php"
click node_logs "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Logs/Controllers/Logs.php"
click node_dashboard "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/DashboardWidgets/Libraries/WidgetService.php"
click node_installer "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Install/Controllers/Install.php"
click node_moduletools "https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Methods/Libraries/ModuleInstaller.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_home,node_pages,node_blog toneBlue
class node_auth,node_sessions,node_users,node_backend,node_media,node_fileeditor,node_themes,node_settings,node_language,node_menu,node_logs,node_dashboard toneAmber
class node_routes,node_commonlib,node_notifications,node_notifier,node_realtime,node_notificationconfig,node_events,node_appconfig,node_databaseconfig,node_emailconfig,node_moduleconfig,node_exceptions toneMint
class node_updates,node_backup,node_migration,node_runlock,node_installer,node_moduletools toneRose
class node_visitor toneIndigo
```

## Components

### Public CMS

- [Home Controller](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Controllers/Home.php): `app/Controllers/Home.php`
- [Page Management](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Pages/Controllers/Pages.php): `modules/Pages/Controllers/Pages.php`
- [Blog Management](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Blog/Controllers/Categories.php): `modules/Blog/Controllers/Categories.php`

### Admin & RBAC

- [Authentication](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Auth/Controllers/MagicLinkController.php): `modules/Auth/Controllers/MagicLinkController.php`
- [User Sessions](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Auth/Models/UserSessionModel.php): `modules/Auth/Models/UserSessionModel.php`
- [User Administration](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Users/Controllers/UserController.php): `modules/Users/Controllers/UserController.php`
- [Backend Base](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backend/Controllers/BaseController.php): `modules/Backend/Controllers/BaseController.php`
- [Media Manager](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Media/Controllers/Media.php): `modules/Media/Controllers/Media.php`
- [File Editor](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Fileeditor/Controllers/Fileeditor.php): `modules/Fileeditor/Controllers/Fileeditor.php`
- [Theme Manager](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Theme/Controllers/Theme.php): `modules/Theme/Controllers/Theme.php`
- [Site Settings](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Settings/Controllers/Settings.php): `modules/Settings/Controllers/Settings.php`
- [Translation Manager](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/LanguageManager/Controllers/Translations.php): `modules/LanguageManager/Controllers/Translations.php`
- [Menu Management](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Menu/Controllers/Menu.php): `modules/Menu/Controllers/Menu.php`
- [Log Viewer](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Logs/Controllers/Logs.php): `modules/Logs/Controllers/Logs.php`
- [Dashboard Widgets](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/DashboardWidgets/Libraries/WidgetService.php): `modules/DashboardWidgets/Libraries/WidgetService.php`

### Platform Services

- [Route Loader](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/DefaultRoutes.php): `app/Config/DefaultRoutes.php`
- [Common Utilities](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Libraries/CommonLibrary.php): `app/Libraries/CommonLibrary.php`
- [Notification Composer](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Controllers/ComposerController.php): `modules/Notifications/Controllers/ComposerController.php`
- [Notification Dispatch](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Libraries/Notifier.php): `modules/Notifications/Libraries/Notifier.php`
- [Realtime Notifications](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Controllers/RealtimeController.php): `modules/Notifications/Controllers/RealtimeController.php`
- [Notification Settings](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Notifications/Config/NotificationsConfig.php): `modules/Notifications/Config/NotificationsConfig.php`
- [Event Wiring](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Events.php): `app/Config/Events.php`
- [Application Config](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/App.php): `app/Config/App.php`
- [Database Config](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Database.php): `app/Config/Database.php`
- [Email Config](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Email.php): `app/Config/Email.php`
- [Module Discovery](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Modules.php): `app/Config/Modules.php`
- [Exception Handling](https://github.com/ci4-cms-erp/ci4ms/blob/master/app/Config/Exceptions.php): `app/Config/Exceptions.php`

### Operations & Extensions

- [Signed Updates](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Settings/Libraries/UpdateService.php): `modules/Settings/Libraries/UpdateService.php`
- [Backup Manager](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backup/Controllers/Backup.php): `modules/Backup/Controllers/Backup.php`
- [Migration Runner](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/MigrationManager/Controllers/MigrationManager.php): `modules/MigrationManager/Controllers/MigrationManager.php`
- [Run Lock](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Backend/Libraries/RunLock.php): `modules/Backend/Libraries/RunLock.php`
- [Web Installer](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Install/Controllers/Install.php): `modules/Install/Controllers/Install.php`
- [Module Tools](https://github.com/ci4-cms-erp/ci4ms/blob/master/modules/Methods/Libraries/ModuleInstaller.php): `modules/Methods/Libraries/ModuleInstaller.php`

### Other components

- **Visitor**

## Connections

- Visitor → Route Loader: requests site
- Route Loader → Home Controller: routes home (evidence: `app/Config/DefaultRoutes.php`)
- Home Controller → Common Utilities: uses utilities (evidence: `app/Controllers/Home.php`)
- Visitor → Page Management: reads pages (evidence: `README.md`)
- Visitor → Blog Management: reads blog (evidence: `README.md`)
- Backend Base → Authentication: requires sign-in (evidence: `README.md`)
- User Administration → User Sessions: reads sessions (evidence: `modules/Users/Controllers/UserController.php`)
- Site Settings → Signed Updates: runs updates (evidence: `README.md`)
- Site Settings → Backup Manager: manages backups (evidence: `README.md`)
- Migration Runner → Run Lock: acquires lock (evidence: `modules/MigrationManager/Controllers/MigrationManager.php`)
- Notification Composer → Notification Dispatch: dispatches (evidence: `modules/Notifications/Controllers/ComposerController.php`)
- Realtime Notifications → Notification Dispatch: uses notifier (evidence: `modules/Notifications/Controllers/RealtimeController.php`)
- Event Wiring → Notification Settings: loads settings (evidence: `app/Config/Events.php`)
- Event Wiring → Notification Dispatch: dispatches audit (evidence: `app/Config/Events.php`)
- Route Loader → Module Discovery: discovers routes (evidence: `app/Config/DefaultRoutes.php`)
- Event Wiring → Exception Handling: configures events (evidence: `app/Config/Events.php`)
- Application Config → Database Config: references config (evidence: `app/Config/App.php`)
- Blog Management → Page Management: manages content (evidence: `README.md`)
- Theme Manager → Site Settings: configures theme (evidence: `README.md`)
- Media Manager → File Editor: supports file work (evidence: `README.md`)
- Translation Manager → Page Management: localizes content (evidence: `README.md`)
- Web Installer → Module Tools: supports setup (evidence: `README.md`)
