PHPackages                             mufidjamaluddin/codeigniter4-hmvc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mufidjamaluddin/codeigniter4-hmvc

ActiveProject[Framework](/categories/framework)

mufidjamaluddin/codeigniter4-hmvc
=================================

CodeIgniter4 HMVC starter app

v0.2.3(2y ago)672.0k36[1 issues](https://github.com/MufidJamaluddin/Codeigniter4-HMVC/issues)MITPHPPHP &gt;=7.2CI failing

Since Apr 18Pushed 2y ago8 watchersCompare

[ Source](https://github.com/MufidJamaluddin/Codeigniter4-HMVC)[ Packagist](https://packagist.org/packages/mufidjamaluddin/codeigniter4-hmvc)[ Docs](https://codeigniter.com)[ RSS](/packages/mufidjamaluddin-codeigniter4-hmvc/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (3)Versions (11)Used By (0)

Codeigniter4-HMVC
=================

[](#codeigniter4-hmvc)

[![](https://camo.githubusercontent.com/94f765f8b15823bb73bf12c9aa52eb0bf89bbd9193677aa7c4fd2c7098869a61/68747470733a2f2f636972636c6563692e636f6d2f67682f4d756669644a616d616c756464696e2f436f646569676e69746572342d484d56432e7376673f7374796c653d737667)](https://circleci.com/gh/MufidJamaluddin/Codeigniter4-HMVC)

This is Hierarchical model–view–controller (HMVC) project starter using CodeIgniter4 framework. By HMVC architecture, I hope we could make scalable web application.

Prerequisites
-------------

[](#prerequisites)

1. PHP 7.2 or above
2. Composer version 1.10 or above
3. intl PHP extension (for formatting currency, number and date/time, see [CodeIgniter4 Docs](https://codeigniter4.github.io/userguide/intro/requirements.html) )
4. xdebug PHP extension (for testing purpose only, optional)
5. php\_sqlite3 PHP extension (for testing purpose only, very optional)

How to use
----------

[](#how-to-use)

1. Run `composer create-project mufidjamaluddin/codeigniter4-hmvc your_project`, to create your project based on this boilerplate.
2. Configure the app by change the `env` file.
3. Run `php spark serve` for run the app.

Make new module
---------------

[](#make-new-module)

### Tutorial

[](#tutorial)

1. Update the spark files

```
composer update
cp vendor/codeigniter4/framework/public/index.php public/index.php
cp vendor/codeigniter4/framework/spark .
```

2. Call the `php spark module` command, then input a module, controller, and model name (Automatically configure a routes modules).
3. Run `composer test` for run your test cases (optional, see [CodeIgniter4 Docs](https://codeigniter4.github.io/userguide/testing/index.html) or [PHPUnit Docs](https://phpunit.readthedocs.io/en/9.1/) )
4. Run in the browser by `php spark serve` command

### Screenshot Example

[](#screenshot-example)

[![Create New Module](screenshots/sc1.jpeg)](screenshots/sc1.jpeg)

[![Run Web 1](screenshots/sc2.jpeg)](screenshots/sc2.jpeg)

[![Run Web 2](screenshots/sc3.jpeg)](screenshots/sc3.jpeg)

Notes
-----

[](#notes)

Always run `php spark route:update` after create or change module, controller, or controller methods directly without `php spark module` command except if you want to configure module route manually.

Command Prompt
--------------

[](#command-prompt)

### Command module, controller, and model creation

[](#command-module-controller-and-model-creation)

The easiest way to create a controller (required) and a model inside a module. Create a module or a model if it doesn't exist.

Usage: Call the `php spark module` command, then input a module, controller, and model name.

### Command route:update parameter

[](#command-routeupdate-parameter)

Parameters: '-n' = Set module namespace (default App\\Modules) '-i' = Set route with /index path without parameter (true/false, default true) '-m' = Set route one module name to be create/update (app/Modules/YourModuleName) '-f' = Set module folder inside app path (default Modules)

Usage command `php spark route:update -i false -m YourModule`

### Command module:create parameter

[](#command-modulecreate-parameter)

Example `php spark module:create invoice`

First parameter (invoice) is your new module.

### PHPUnit

[](#phpunit)

You can run all of your test cases by run `composer test`

### Other Command

[](#other-command)

You can get all command prompt list by run `php spark list` and composer command in composer.json &gt; scripts.

HMVC Structure
--------------

[](#hmvc-structure)

### Default Structure

[](#default-structure)

By default, there is the structure of Codeigniter4-HMVC.

```
app
   \Modules
       \{YourModule}
            \Config
                Routes.php
            \Controllers
                BaseController.php
                {YourController}.php
            \Models
                {YourModel}.php
    \Views
        \template
            {YourTemplate}.php
        \{your view module folder}
            {Your View}.php
    ...

    \tests
        \unit
            ...
        \integration
            \Modules
                \{YourModule}
                    {YourController}.php
        ...

```

### Custom Structure

[](#custom-structure)

You can structuring your module freely, because CodeIgniter4 use PSR4. If you want to change the structure of Routes.php in Config Module folder or the structure of Module Controllers, you must change app/Config/Routes.php in HMVC Routing section and modify RouteUpdate.php &amp; Module.php in app/Commands folder.

Contribute
----------

[](#contribute)

You can contribute for extend CodeIgniter4 capabilities or add command prompt for development use by fork this repository. After that, you can make pull request.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~193 days

Recently: every ~181 days

Total

9

Last Release

766d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3cac87a0198de4b2063d44f81dc06cc361bec71a98940620cfd7d0f72e2a78?d=identicon)[MufidJamaluddin](/maintainers/MufidJamaluddin)

---

Top Contributors

[![MufidJamaluddin](https://avatars.githubusercontent.com/u/28973632?v=4)](https://github.com/MufidJamaluddin "MufidJamaluddin (23 commits)")[![cijagani](https://avatars.githubusercontent.com/u/3807730?v=4)](https://github.com/cijagani "cijagani (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mufidjamaluddin-codeigniter4-hmvc/health.svg)

```
[![Health](https://phpackages.com/badges/mufidjamaluddin-codeigniter4-hmvc/health.svg)](https://phpackages.com/packages/mufidjamaluddin-codeigniter4-hmvc)
```

###  Alternatives

[codeigniter4/appstarter

CodeIgniter4 starter app

1811.8M](/packages/codeigniter4-appstarter)[abydahana/aksara

Aksara is a modern, developer-friendly framework and CMS built on CodeIgniter 4, featuring rapid CRUD development, modular architecture, smart routing, flexible access control, API integration, and an AI assistant to make content management faster and smarter.

1141.2k](/packages/abydahana-aksara)[irsyadulibad/codeigniter4-datatables

Server side DataTables library for CodeIgniter4 framework

702.6k](/packages/irsyadulibad-codeigniter4-datatables)[maniaba/asset-connect

AssetConnect is a file management library for CodeIgniter 4 that allows you to associate files with any entity in your application

1016.0k](/packages/maniaba-asset-connect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
