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.1+ | Enable intl, json, mbstring, gd, curl, openssl. Matches composer.json platform. |
| Composer | 2.5+ | Manage PHP dependencies. |
| Node.js | 18 LTS | Needed if you maintain public/be-assets. |
| npm | 8+ | Package manager for backend assets. |
| Database | MySQL/MariaDB | Any CodeIgniter-supported driver works. Configure via .env. |
| Web server | Apache/Nginx/CI4 spark | Point document root to public/. |
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)
uploads/ Media storage (ensure writable)
writable/ Cache, logs, temporary files (must be writable)
vendor/ Composer packages
Essential configuration files include composer.json, the contents of app/Config, and the environment overrides stored in .env.
git clone <repo-url> ci4ms
cd ci4ms
composer install
cp env .env
php spark env development
Set app.baseURL, database.default.*, mail credentials, and security options.
php spark migrate
php spark db:seed Ci4msDefaultsSeeder # prompts for admin account details
php spark key:generate
php spark create:route
php spark serve
Visit http://localhost:8080 for the front-end and /backend for the admin.
Tip: Re-running the seeder on a populated database can duplicate data. Truncate first if needed.
Core packages include ci4commonmodel, sql2migration, ext_module_generator (exposes php spark make:module), claviska/simpleimage, seunmatt/codeigniter-log-viewer, gregwar/captcha, melbahja/seo, phpmailer/phpmailer, and studio-42/elfinder.
composer install
composer update vendor/package
composer outdated
The admin panel pulls JS dependencies from public/be-assets (Tagify, Monaco editor, elFinder theme, etc.).
cd public/be-assets
npm install
# add build/watch scripts if you introduce a bundler
Document any new build tooling in this handbook when added.
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>.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.CommonLibrary::phpMailer() for retrieval.settings.maintenanceMode; triggers redirect in App\Filters\Ci4ms.Modules\Media\Controllers\Media::elfinderConnection().settings.allowedFiles.claviska/simpleimage.public/uploads/media/ (ensure writable, include .trash folder).realpath guards; limit use to trusted roles.public/templates/<theme>; uploads unzip to writable/tmp before install.info.xml, screenshot.png (checked by backend filter).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/uploads/ contains uploaded media (include in backups).public/templates/default/ is the bundled theme—use it as a blueprint for custom themes.tests/; namespace under Tests\Support is autoloaded.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.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).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.