https://github.com/jmrashed/php-domain-driven-design-ddd
PHP-Domain-Driven Design-DDD
https://github.com/jmrashed/php-domain-driven-design-ddd
ddd domain-driven-design php
Last synced: 10 months ago
JSON representation
PHP-Domain-Driven Design-DDD
- Host: GitHub
- URL: https://github.com/jmrashed/php-domain-driven-design-ddd
- Owner: jmrashed
- Created: 2023-10-09T21:49:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T21:50:22.000Z (about 2 years ago)
- Last Synced: 2025-01-07T20:14:34.823Z (11 months ago)
- Topics: ddd, domain-driven-design, php
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP following Domain-Driven Design (DDD) principles
```tree
app/
├── config/
│ ├── database.php
├── Domain/
│ ├── Todo/
│ │ ├── TodoItem.php
│ │ ├── TodoRepository.php
│ │ ├── TodoService.php
│ ├── User/
│ │ ├── User.php
│ │ ├── UserRepository.php
│ │ ├── UserService.php
├── Infrastructure/
│ ├── Persistence/
│ │ ├── Todo/
│ │ │ ├── MySQLTodoRepository.php
│ │ ├── User/
│ │ │ ├── MySQLUserRepository.php
├── Presentation/
│ ├── Controllers/
│ │ ├── TodoController.php
│ │ ├── UserController.php
│ ├── Views/
│ │ ├── todo/
│ │ │ ├── index.php
│ │ │ ├── create.php
│ │ ├── user/
│ │ │ ├── profile.php
│ │ ├── layouts/
│ │ │ ├── app.php
├── public/
│ ├── css/
│ ├── js/
├── routes/
│ ├── web.php
├── templates/
│ ├── base.html
│ ├── todo/
│ │ ├── index.html
│ │ ├── create.html
│ ├── user/
│ │ ├── profile.html
```
Here's a breakdown of the main directories and their purposes:
`config`: Configuration files for your application, including database configuration (database.php).
`Domain`: Organize your domain logic here. It includes Todo and User domains with entities, repositories, and services.
`Infrastructure`: This is where infrastructure-related code resides. It contains Persistence with repository implementations using MySQL (e.g., MySQLTodoRepository, MySQLUserRepository).
`Presentation`: Handle the user interface and HTTP interactions here. Controllers manage HTTP requests and communicate with domain services, while Views contain PHP templates for rendering the user interface.
`public`: Publicly accessible assets like CSS and JavaScript files.
`routes`: Define your application routes in web.php. This is where you handle routing for HTTP requests.
`templates`: This directory contains base templates (base.html) and templates for different views (e.g., todo, user) for rendering the user interface.