PHPackages                             viliam-husar/c4ml - 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. viliam-husar/c4ml

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

viliam-husar/c4ml
=================

C4 Architecture Diagram Generator

13121[1 issues](https://github.com/viliam-husar/c4ml/issues)PHP

Since Nov 12Pushed 10y ago2 watchersCompare

[ Source](https://github.com/viliam-husar/c4ml)[ Packagist](https://packagist.org/packages/viliam-husar/c4ml)[ RSS](/packages/viliam-husar-c4ml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

C4 Architecture Model Diagram Generator
=======================================

[](#c4-architecture-model-diagram-generator)

This application was inspired by C4 software architecture model, as [described by Simon Brown](https://www.voxxed.com/blog/2014/10/simple-sketches-for-diagramming-your-software-architecture/).

**Note: Still WIP.**

Requirements
------------

[](#requirements)

- PHP 5.5+
- Graphviz (dor)

Installation
------------

[](#installation)

Right now you can install C4ML by composer. More options to come in future.

```
$ composer require viliam-husar/c4ml
```

After installation you can run C4ML by:

```
$ bin/vendor/c4ml
```

Syntax
------

[](#syntax)

See example.c4ml for syntax. Some limitations:

- You need to use unique id for each part of model.
- When defining usages, you can refer only from/to: Container, External System, Internal User, External User.

Usage
-----

[](#usage)

There are several options for C4ML to process your model. To see them all just use the --help option:

### Specify output format

[](#specify-output-format)

Because C4ML is using Graphviz for rendering, you might render your model diagram in multiple formats (svg is default).

```
$ bin/vendor/c4ml example.c4ml example.svg -f svg
$ bin/vendor/c4ml example.c4ml example.png -f png
```

### Select internal systems with containers view

[](#select-internal-systems-with-containers-view)

By default all internal systems are displayed in container view and with all related elements. If you have large model with multiple internal systems, you might select which of them should be displayed in this way. All other internal systems will be displayed in system view and only if required by selected internal systems.

```
$ bin/vendor/c4ml example.c4ml example.svg -s site
$ bin/vendor/c4ml example.c4ml example.svg -s site -s orders
```

### Highlight elements (Containers, External Systems, Internal Users, External Users)

[](#highlight-elements-containers-external-systems-internal-users-external-users)

In some cases you may need to highlight one or more elements in you diagram. For this purpose use option `-l|--highligt`:

```
$ bin/vendor/c4ml example.c4ml example.svg -l site
$ bin/vendor/c4ml example.c4ml example.svg -l site -l orders
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e32da865350457454d3ea7106eb70b7ee5bdafa5c0d8d1d019f18a2674d4abb6?d=identicon)[viliam-husar](/maintainers/viliam-husar)

### Embed Badge

![Health badge](/badges/viliam-husar-c4ml/health.svg)

```
[![Health](https://phpackages.com/badges/viliam-husar-c4ml/health.svg)](https://phpackages.com/packages/viliam-husar-c4ml)
```

###  Alternatives

[laraveljutsu/zap

A flexible, performant, and developer-friendly schedule management system for Laravel

1.4k69.1k](/packages/laraveljutsu-zap)[jxlwqq/json-editor

JSON Editor for Laravel-admin

32101.8k](/packages/jxlwqq-json-editor)

PHPackages © 2026

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