https://github.com/yceruto/php-ddd-demo
Dependency-free demo project
https://github.com/yceruto/php-ddd-demo
cqs ddd hexagonal-architecture php
Last synced: 3 months ago
JSON representation
Dependency-free demo project
- Host: GitHub
- URL: https://github.com/yceruto/php-ddd-demo
- Owner: yceruto
- License: mit
- Created: 2024-04-05T04:07:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-20T14:57:49.000Z (4 months ago)
- Last Synced: 2025-03-18T18:43:34.210Z (3 months ago)
- Topics: cqs, ddd, hexagonal-architecture, php
- Language: PHP
- Homepage:
- Size: 84 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP DDD Demo
This project is a simple, framework-free introduction to Domain-Driven Design (DDD) and use cases. It's perfect
for anyone looking to dive into the core concepts of DDD in PHP.The demo is based on a simple task management system, where you can create tasks and log time spent on them.

tags: `domain-driven-design` `domain-event` `hexagonal-archetecture` `screaming-architecture` `clean-architecture`
`command-query-separation`## Features
- **Entities**: Task, TimeLog
- **Value Objects**: Uuid, Duration, NonEmptyString, etc.
- **Repositories**: TaskRepository, TimeLogRepository
- **Use Cases**: CreateTask, FindTask, AddTimeLog, etc.
- **Services**: TaskCreator, TaskFinder, TimeLogCreator, etc.
- **Domain Errors**: TaskNotFound, InvalidTaskStatus, DomainError, etc.
- **Domain Events**: TaskCreated, TaskTimeLogAdded, etc.## Setup
To run this project, you need to have PHP 8.3 or higher installed on your machine.
```bash
git clone [email protected]:yceruto/php-ddd-demo.git
cd php-ddd-demo
composer install
```## Testing
Unit tests are implemented using PHPUnit. To run the tests, execute the following command:
```bash
vendor/bin/phpunit
```## License
This software is published under the [MIT License](LICENSE)