CI4MS Architecture

System Blueprint

Understand the moving parts behind CI4MS—filters, routes, modules, caches, and tooling. Use this guide alongside the developer handbook when designing new features or debugging runtime behaviour.

Application Bootstrap & Request Lifecycle

CommonModel Abstraction

bertugfahriozer/ci4commonmodel powers the generic CRUD layer. Modules lean on helpers such as lists, selectOne, create, createMany, edit, remove, and isHave.

The backend BaseController instantiates CommonModel once, exposing it via $this->commonModel to child controllers.

Authentication & Authorization

Module Pattern

Each module under modules/<Name> typically includes:

Scaffold new modules with php spark make:module Foo (from ci4-cms-erp/ext_module_generator) and follow up with routes, implementation, and permissions.

Installation Flow

Web Installer

  • Module: Modules\Install.
  • Copies env to .env, sets base configuration, runs migrations, and seeds defaults via InstallService.
  • Regenerates app/Config/Routes.php from the command template.

CLI Seeder

  • Ci4msDefaultsSeeder prompts for admin credentials.
  • Calls InstallService::createDefaultData() to seed modules, permissions, admin account, sample content, and settings.

Caching & Configuration

Theme System

Content & SEO

Media, File Management & Logs

CLI & Automation

Development Tips

Common Data Tables

Frequent tables include users, auth_groups, auth_permissions_pages, auth_users_permissions, modules, pages, blog, blog_categories_pivot, tags, tags_pivot, menu, settings, login_rules, and others introduced by modules.

Consult module migrations for schema details.

Design with Insight

Use this architecture map to reason about dependencies and extension points. Pair it with the developer handbook and user guide for the full CI4MS story.