Giter Site home page Giter Site logo

k0t9i / taskmanager-php-ddd Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 795 KB

Clean Architecture, DDD and CQRS using Symfony 6

License: GNU General Public License v3.0

Dockerfile 0.37% PHP 88.25% Makefile 0.17% Twig 0.06% HTML 0.04% Vue 5.98% JavaScript 5.00% SCSS 0.13%
clean-architecture cqrs cqrs-pattern ddd ddd-architecture ddd-example docker doctrine doctrine-orm doctrine2

taskmanager-php-ddd's Introduction

Task manager system using Clean Architecture, DDD and CQRS. CI

Environment setup

  1. Install Docker
  2. Clone the project: git clone https://github.com/k0t9i/TaskManager-php-ddd.git
  3. Run docker containers: docker-compose -f ./backend/symfony/docker-compose.yml up -d --build
  4. Setup application: make setup. This step installs the composer dependency, generates JWT keys, runs migrations, warms up the cache and reloads the supervisor.

Performing checks

  • make test - phpunit tests
  • make code-style - php-cs-fixer checks
  • make static-analysis - psalm checks
  • make check-all - all of the above

Api

Swagger api is available on http://127.0.0.1:8081/api/doc

Database

All data is stored on one server in one database, you can see the database structure via adminer http://127.0.0.1:9080/.

Frontend example

Simple vue3 application is available on http://127.0.0.1:7080/

Code structure

├── Projects  // Code related to a specific bounded context
│   ├── Application // Application layer depends only on Domain layer
│   │   ├── Command
│   │   ├── Handler // Command handlers
│   │   ├── Service // Application services
│   │   └── Subscriber // Domain event subscribers
│   ├── Domain // Domain logic layer does not depend on other layers
│   │   ├── Collection
│   │   ├── Entity // Entities and aggregate roots
│   │   ├── Event // Domain events
│   │   ├── Exception // Domain exceptions
│   │   ├── Repository // Repository interfaces
│   │   └── ValueObject
│   └── Infrastructure // Infrastructure layer depends on Domain and Application layers
│       ├── Persistence // Entity mapping in database
│       ├── Repository // Repository realizations
│       └── Service
└── Shared // Common code for all bounded contexts

Buses

Command and query buses are synchronous, implemented via the symfony messenger.

The application has two event buses: the domain event bus and the integration event bus.

The domain event bus is synchronous, implemented via the symfony messenger and used inside bounded contexts.

The integration event bus is asynchronous, implemented via the symfony messenger and RabbitMQ (http://127.0.0.1:15673/). Events are received from RabbitMQ through the Symfony Messenger, which is launched using the supervisor.

Projections

Projections are collected from domain events using the console command, which is launched using the supervisor.

You can always reload projections from scratch with make projections-reload

taskmanager-php-ddd's People

Contributors

k0t9i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kiazimkhutaba

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.