Reference this guide whenever you onboard, ship features, or maintain CI4MS. It merges environment requirements, coding conventions, workflow tips, and deployment best practices into a single companion for the engineering team.
| Layer | Required | Notes |
|---|---|---|
| PHP | 8.2+ |
Enable intl, json,
mbstring, gd, curl,
openssl extensions. Matches
composer.json (8.2).
|
| Composer | 2.5+ | Used for all PHP dependencies. |
| Database | MySQL / MariaDB |
Any CodeIgniter-supported driver works. Configure via
.env.
|
| Web server | Apache / Nginx / php spark serve |
Production deploys should point to the public/ directory. |
| Docker | Docker Engine 24+ / Desktop | Optional but recommended for local development and CI. |
app/ Application code (controllers, config, libraries, filters)
modules/ Feature modules (Auth, Backend, Blog, etc.)
public/
index.php Front controller
be-assets/ Admin UI build artifacts (CSS/JS)
templates/ Front-end themes (default shipped)
media/ Media storage (ensure writable)
writable/ Cache, logs, temporary files (must be writable)
vendor/ Composer packages
.docker/ Dockerfile, Apache vhost, and php.ini
.github/workflows/ GitHub Actions CI pipeline
docs/ Developer documentation (this file and companions)
Key config files:
composer.json — PHP dependencies and scripts.app/Config/DefaultRoutes.php — Routes template; copy to
Routes.php on setup.
app/Config/Paths.php — Path constants including
$supportDirectory (required by CI4 4.4+).
app/Config/*.php — Framework configuration; many
classes consume cached settings populated at runtime.
.env — Environment overrides; generated from the
env template.
git clone <repo-url> ci4ms
cd ci4ms
composer install
cp env .env
Update: app.baseURL, database.default.*,
mail credentials, etc.
cp app/Config/DefaultRoutes.php app/Config/Routes.php
php spark ci4ms:setup
This single command runs all migrations, seeds default data (admin user, sample pages, settings), and prepares the application.
php spark serve
cp env .env
cp app/Config/DefaultRoutes.php app/Config/Routes.php
# Edit .env: set database.default.hostname=db
docker compose up -d --build
docker exec ci4ms_app composer install
docker exec ci4ms_app php spark ci4ms:setup
Refer to DOCKER_SETUP.md for full configuration details.
The project depends on CodeIgniter 4 and several packages:
codeigniter4/framework — Core framework.codeigniter4/shield — Auth and RBAC.ci4commonmodel — Database abstraction.ci4seopro — SEO, JSON-LD, feeds.sql2migration — CLI migration tooling.ext_module_generator — Module scaffolding.composer install
composer update vendor/package
composer outdated
The admin panel and templates use static JS/CSS packages (Tagify,
Monaco, etc.). To keep the repository small and performant, we do
not use npm or node_modules by default. Hosted
statically in plugins/ and vendor/.
If you introduce a bundler (like Vite) in the future, be sure to
compile assets and exclude node_modules from version
control.
Modules\<Name>, app code under App\.
Modules\Backend\Controllers\BaseController; frontend
extends App\Controllers\BaseController.
Modules\Blog\Views\list
etc.).
app/Config/Filters discovers them dynamically.
modules/<Module>/Config.
modules/<Module>/Language/<locale>. 11
languages are currently supported.
composer test; add
linting tooling if desired.
Permissions are stored in auth_permissions_pages (CRUD
JSON flags) and auth_users_permissions (overrides). The
Modules\Methods\Controllers\Methods::moduleScan() command
inspects routes and helps keep permissions in sync.
Workflow for a new module:
php spark make:module <Name> (provided by
ext_module_generator).
modules/<Name>/Config/Routes.php with
role metadata.
Clear cached permissions with php spark cache:clear or
cache()->delete("{userId}_permissions").
settings table
and cached for 24h. Clear via
cache()->delete('settings').
menus; automatically
refreshed when editing via the Menu module.
settings.maintenanceMode; triggers redirect in
App\Filters\Ci4ms.
Modules\Media\Controllers\Media::elfinderConnection().
settings.allowedFiles.
claviska/simpleimage.
public/media/ (ensure writable, include
.trash folder).
realpath guards;
limit use to trusted roles.
public/templates/<theme>; ZIP uploads extract
to writable/tmp.
Database/Migrations/; run on activation.
info.xml,
screenshot.png (checked by backend filter).
mysqldump or PHP fallback.
writable/uploads/backups. Restore directly from the
backend or download archives.
public/index.php bootstraps CodeIgniter; production
servers should expose only public/.
public/maintenance/ serves the maintenance splash when
enabled.
public/be-assets/ houses admin CSS/JS, images, plugins,
and package manifests.
public/media/ contains uploaded media (include in
backups).
public/templates/default/ is the bundled theme—use it
as a blueprint for custom themes.
tests/. Add module-specific tests
in tests/Modules/<Module>.
.github/workflows/docker-test.yaml) runs on every
push:
composer install.php spark ci4ms:setup.app/ and modules/.CI_ENVIRONMENT=development.
writable/logs/; ensure permissions allow
writing or inspect them via the backend viewer at
/backend/logs.
php spark cache:clear or delete
contents of writable/cache/.
ci_migrations table for batch sync.
docker compose logs app to inspect
container output.
CI_ENVIRONMENT=production.app.baseURL.public/; restrict other
directories.
php spark migrate --all, relevant
seeders).
.env before major
upgrades.
feature/blog-scheduling).
[Blog] Add scheduling support).
CHANGELOG.md updates.
CHANGELOG.md (Keep a Changelog format) before merging.Update this handbook whenever the stack or workflows evolve so the team always has a current source of truth.
CI4MS is engineered for extensibility. Keep this page bookmarked, share it with the team, and iterate responsibly.