PHPackages                             phex/phex - 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. phex/phex

ActiveProyect[Framework](/categories/framework)

phex/phex
=========

A lightweight DDD &amp; ports-and-adapters foundation for PHP applications

v1.0.0(1y ago)15MITPHPPHP ^8.1

Since Apr 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MarioDevv/phex)[ Packagist](https://packagist.org/packages/phex/phex)[ RSS](/packages/phex-phex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Phex
====

[](#phex)

> ⚠️ **Phex is in an early stage of development.**
> Things might change — contributions and feedback are welcome!

**Phex** is a lightweight PHP starter structure focused on **Domain-Driven Design (DDD)** and **Hexagonal Architecture**.
It is not a full framework — instead, it's a minimal base structure that helps you **start real projects fast**
by avoiding unnecessary dependencies, configuration files, and excessive boilerplate code.

---

✨ Why Phex?
-----------

[](#-why-phex)

Frameworks like Laravel or Symfony are powerful, but they often come with:

- Heavy layers of infrastructure
- Complex bootstrapping
- Opinionated conventions that don't always match clean DDD

**Phex offers a clean foundation where you control the architecture from day one.**

---

🚀 Features
----------

[](#-features)

- ✅ PSR-4 compliant structure
- 🧩 Ready for DDD (`Application`, `Domain`, `Infrastructure`, `Shared`)
- 🛡️ Hexagonal design with clear separation of concerns
- 🧪 In-memory repositories for unit and acceptance testing
- 🧼 No database or HTTP layer by default
- 🧪 100% testable with PHPUnit
- 🔌 Easy integration with Slim, Laravel, Symfony Console, etc.

---

🧱 Structure
-----------

[](#-structure)

```
src/
├── Application        # Use cases / Application services
├── Domain
│   └── Model          # Entities, ValueObjects, Repositories, Exceptions
├── Infrastructure
│   ├── Delivery       # API, CLI, Web, etc.
│   ├── Persistence    # DB, Redis, Filesystem, etc.
│   └── Domain
│       └── Model      # Implementations of domain interfaces
└── Shared             # Cross-cutting concerns (UUIDs, errors, etc.)

```

---

🔮 Tests
-------

[](#-tests)

```
tests/
├── Unit               # Pure unit tests
├── Acceptance         # High-level use case tests
└── Shared             # Test data builders, mothers, fakes

```

---

💡 Usage
-------

[](#-usage)

Clone this repository to start your own DDD module or microservice:

```
git clone https://github.com/MarioDevv/phex.git
cd my-project
composer install
```

Start coding your first module in `src/` and implement your use cases inside `Application/`.

---

📦 Who is this for?
------------------

[](#-who-is-this-for)

- Developers who want full control over their app architecture
- People applying DDD and Hexagonal Architecture in real PHP projects
- Teams building microservices, APIs, or CLI tools without full frameworks
- Anyone tired of unnecessary boilerplate

---

🤝 Contributing
--------------

[](#-contributing)

Feel free to fork, improve and submit PRs.
**This is a starting point, not the final word.**

---

¿Quieres que te ayude a convertir esto en un `README.md` listo para el repo o agregar una sección como "Roadmap" o "Limitaciones actuales"?

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance47

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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

Unknown

Total

1

Last Release

392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3611df7570efc4549648931fe6bce5b73812a85ae5b349e250c54fcb08844eda?d=identicon)[MarioDevv](/maintainers/MarioDevv)

---

Top Contributors

[![MarioDevv](https://avatars.githubusercontent.com/u/90867187?v=4)](https://github.com/MarioDevv "MarioDevv (11 commits)")[![MatsysDev](https://avatars.githubusercontent.com/u/233718576?v=4)](https://github.com/MatsysDev "MatsysDev (4 commits)")

---

Tags

phpframework

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[luoxiaojun/sw-fw-less

Swoole Http Server without framework

165.3k](/packages/luoxiaojun-sw-fw-less)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)

PHPackages © 2026

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