PHPackages                             clabonte/codeprimer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. clabonte/codeprimer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clabonte/codeprimer
===================

CodePrimer, customizable production-grade code generator for architects and team leads

0.2.1(5y ago)03[27 issues](https://github.com/clabonte/codeprimer/issues)[1 PRs](https://github.com/clabonte/codeprimer/pulls)MITPHPPHP ^7.3.4CI failing

Since Aug 28Pushed 3y ago2 watchersCompare

[ Source](https://github.com/clabonte/codeprimer)[ Packagist](https://packagist.org/packages/clabonte/codeprimer)[ Docs](https://github.com/clabonte/codeprimer)[ RSS](/packages/clabonte-codeprimer/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (6)Used By (0)

CodePrimer
==========

[](#codeprimer)

[![build-shield](https://camo.githubusercontent.com/c5d9e42284c899d15e4fac72693c02b3e7e2fc9056dd2dc832a08343ed8b733b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636c61626f6e74652f636f64657072696d65722f56616c69646174652532304d61737465722f6d6173746572)](https://camo.githubusercontent.com/c5d9e42284c899d15e4fac72693c02b3e7e2fc9056dd2dc832a08343ed8b733b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636c61626f6e74652f636f64657072696d65722f56616c69646174652532304d61737465722f6d6173746572)[![coverage-shield](https://camo.githubusercontent.com/73f830bb6996a80b76e96ed43fd1d4cbe1b08cff9b62e86e7163dc0f24c093d8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f636c61626f6e74652f636f64657072696d6572)](https://codecov.io/gh/clabonte/codeprimer)[![Issues](https://camo.githubusercontent.com/80375e68df181d35ecda4cb9b8670aa79b98e17b269981e442d61dcf0dcedc1a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f636c61626f6e74652f636f64657072696d6572)](https://github.com/clabonte/codeprimer/issues)[![MIT License](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/clabonte/codeprimer/blob/master/LICENSE)

**CodePrimer**’s primary objective is to **allow software architects and senior developers to define the data model and related processing from a business point of view** so that it can be easily understood and manipulated by entrepreneurs, business managers and business analysts before starting the software development process.

As such, it is meant to **prime** the software development process using simple, easy to use and effective representations that can be objectively interpreted by business and techies willing to cooperate to create digital businesses.

**CodePrimer** interprets this data model to **generate a set of artifacts (e.g. source code)** that are combined to **build a production-grade software solution following the architect's vision** to guide the development team to use his best practices.

The project offers an opinionated architecture, called [Business Bundle](doc/bundle/Overview.md) to get started. The resulting solution is meant to be highly scalable, yet requiring very low maintenance by leveraging the best DevOps practices with a minimal technical team.

It liberally borrows and integrates concepts and best practices that have been made available over the years by several movements in the software development space, such as UML, Domain-Driven Design (DDD), agile, micro services and DevOps.

The resulting architecture and implementation is not meant to please everyone but the underlying goal is to produce top quality software that is meeting the business objectives for what it is being built and be easily understood, maintained and evolved by a software development team at a fraction of the time usually required to achieve production-grade software..

Thanks to the **high flexibility** of its artifact generation engine, the project can be easily tailored to suit any programming language or any architecture/framework chosen by the architect.

Documentation
-------------

[](#documentation)

In order to fully understand and leverage the capabilities offered by **CodePrimer**, you should refer to the following documents:

- [Concepts](doc/Concepts.md)
- [Structure and Guidelines](doc/StructureAndGuidelines.md)
- [CodePrimer Data Modeling](doc/DataModel.md)
- [CodePrimer Process Modeling](doc/bundle/Overview.md)
- [Available Artifacts](doc/Artifacts.md)

Getting Started
---------------

[](#getting-started)

CodePrimer can be added as a library to an existing PHP project or used standalone to either generate artifacts or prime a new project.

### Prerequisites

[](#prerequisites)

No matter how you want to use it, the installation instructions assume you already have the following:

- [PHP 7.3](https://www.php.net/manual/en/install.php) or above
- [composer](https://getcomposer.org/)

### Installation

[](#installation)

#### Generating artifacts in an existing project

[](#generating-artifacts-in-an-existing-project)

If you already have an existing PHP project, and you want to use CodePrimer to generate artifacts (e.g. source code) in it, you can simply add CodePrimer via composer:

```
composer require clabonte/codeprimer
```

Then, you will need to generate the configuration files for your project by running the `init` command and answering the various questions asked:

```
vendor/bin/codeprimer init
```

This will generate a set of files under the `codeprimer` directory that will be used by the `prime` command to generate the various artifacts you need:

```
vendor/bin/codeprimer prime
```

#### Using CodePrimer in standalone mode

[](#using-codeprimer-in-standalone-mode)

If you don't have an existing project, or you are simply curious to see how it works, you can still clone the repository and installing its dependencies:

1. Clone the repo
2. Run composer install

```
git clone https://github.com/clabonte/codeprimer.git
cd codeprimer
composer install
```

Once you have cloned and installed the project, you can generate a set of [Artifacts](doc/Artifacts.md) based on the [Channel sample application](doc/sample/Index.md) by running the following command:

```
composer sample-app
```

Take a look at the `sample/output` folder to see the [Artifacts](doc/Artifacts.md) generated by CodePrimer.

Usage
-----

[](#usage)

In order to understand what CodePrimer can be used for, it is best to [look at a sample application](doc/sample/Index.md).

You can also consult the list of [Artifacts](doc/Artifacts.md) currently available and planned for CodePrimer.

Command Line
------------

[](#command-line)

CodePrimer offers a simple CLI to either **initializes a new CodePrimer-compatible project** via the `init` command:

```
[vendor/]bin/codeprimer init
```

This command will create, *at a minimum*, the following files in the selected destination:

```
codeprimer/codeprimer.yaml
codeprimer/bundle.php
codeprimer/DatasetFactory.php
codeprimer/BusinessModelFactory.php
codeprimer/BusinessProcessFactory.php
```

Once you have initialized your project, you can **prime artifacts** via the `prime` command:

```
[vendor/]bin/codeprimer prime [-c ] [-d ]
```

Configuration
-------------

[](#configuration)

The `prime` command currently uses the following files (generated by the `init` command) to configure its execution:

### `codeprimer/codeprimer.yaml`

[](#codeprimercodeprimeryaml)

This file defines the list of [Artifacts](doc/Artifacts.md) to generate for your project. Unless you want to change the list of artifacts to generate for your project, **you do not need to modify this file.**

### `codeprimer/bundle.php`

[](#codeprimerbundlephp)

This file coordinates the creation of your [Business Bundle](doc/bundle/Overview.md) through the invocation of your factories (*see below*). As such, **you should not modify this file.**

### `codeprimer/DatasetFactory.php`

[](#codeprimerdatasetfactoryphp)

This factory defines the list of `Dataset` instances that are part of your application.

**You need to modify this file to design your business/application model** as follow:

- Create a set of public methods starting with the `create` name **prefix with no parameters** (e.g. createUserRole())
- Each `create` method **must return** a `Dataset` instance describing a dataset used in your application.
- The `bundle.php` file (*see above*) will automatically invoke all the `create` methods to add all `Dataset` instances to your application business bundle.

### `codeprimer/BusinessModelFactory.php`

[](#codeprimerbusinessmodelfactoryphp)

This factory defines the list of `BusinessModel` instances that are part of your application.

**You need to modify this file to design your business/application model** as follow:

- Create a set of public methods starting with the `create` name **prefix with no parameters** (e.g. createUser())
- Each `create` method **must return** a `BusinessModel` instance describing a business model used in your application. Your business model may reference datasets and/or other business models defined in their respective factories.
- The `bundle.php` file (*see above*) will automatically invoke all the `create` methods to add all `BusinessModel` instances to your application business bundle.

### `codeprimer/BusinessProcessFactory.php`

[](#codeprimerbusinessprocessfactoryphp)

This factory defines the list of `BusinessProcess` instances that are part of your application.

**You need to modify this file to design your business/application model** as follow:

- Create a set of public methods starting with the `create` name **prefix with no parameters** (e.g. createRegister())
- Each `create` method **must return** a `BusinessProcess` instance describing a business process used in your application. Your business process must reference datasets and/or business models defined in their respective factories.
- The `bundle.php` file (*see above*) will automatically invoke all the `create` methods to add all `BusinessProcess` instances to your application business bundle.

Roadmap
-------

[](#roadmap)

The high level roadmap and progress is available [here](https://github.com/clabonte/codeprimer/milestones?with_issues=no)

To have a more detailed view on upcoming changes, please look at the [Product Roadmap](https://github.com/clabonte/codeprimer/projects/1) or [open issues](https://github.com/clabonte/codeprimer/issues) for a list of proposed features and known issues.

Contributing
------------

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md)

Contact
-------

[](#contact)

Christian Labonte [![LinkedIn](https://camo.githubusercontent.com/1db6f4145e2a684286370929bd4c2c0c6aa0ccfa132fa38e8d6aeee8af3e37ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f6c6f676f3d6c696e6b6564696e)](https://www.linkedin.com/in/christianlabonte/)

Project Link:

License
-------

[](#license)

This project uses the following license: [MIT](https://github.com/clabonte/codeprimer/blob/master/LICENSE)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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 ~61 days

Total

3

Last Release

2011d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3989686?v=4)[Christian Labonté](/maintainers/clabonte)[@clabonte](https://github.com/clabonte)

---

Top Contributors

[![clabonte](https://avatars.githubusercontent.com/u/3989686?v=4)](https://github.com/clabonte "clabonte (198 commits)")[![olibiaz](https://avatars.githubusercontent.com/u/13057911?v=4)](https://github.com/olibiaz "olibiaz (6 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/clabonte-codeprimer/health.svg)

```
[![Health](https://phpackages.com/badges/clabonte-codeprimer/health.svg)](https://phpackages.com/packages/clabonte-codeprimer)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M733](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M563](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M505](/packages/pimcore-pimcore)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M201](/packages/sulu-sulu)

PHPackages © 2026

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