PHP Application using DDD CQRS Event Sourcing with Hexagonal Architecture

Overview

PHP Application using DDD CQRS Event Sourcing with Hexagonal Architecture

alt text

Application built with Ecotone Framework and powered by integrations with Prooph Event Store, Symfony and JMS Serializer.

Application shows the how complex systems can be built with ease using PHP.
The main tenets of Ecotone is to allow developers focus on business problems not integrations and technical issues and this can be seen in the code.

Have fun :)

Possible Integrations with Laravel and Ecotone Lite

Application is written in Symfony, however Ecotone integrates with Laravel and can be run alone without any additional framework (Ecotone Lite).
All the code that is written in here, will work exactly the same way, when will be run with Laravel or Ecotone Lite.

Run

docker-compose up -d

And then application is available under localhost:3000

As read model is updated asynchronously, you may need to refresh after performing action to see the changes.

You might also like...
Reactive extensions for PHP.

This package is abandoned. Use https://github.com/ReactiveX/RxPHP instead Rx.PHP Reactive extensions for PHP. The reactive extensions for PHP are a se

Golang's defer statement for PHP

PHP Defer A defer statement originally comes from Golang. This library allows you to use defer functionality in PHP code. Usage ?php defer($context,

Reactive extensions for PHP

RxPHP Reactive extensions for PHP. The reactive extensions for PHP are a set of libraries to compose asynchronous and event-based programs using obser

🚀 Coroutine-based concurrency library for PHP

English | 中文 Swoole is an event-driven asynchronous & coroutine-based concurrency networking communication engine with high performance written in C++

Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda.
Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda.

Our Wedding Website Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda. ?

Ecotone Framework is Service Bus Implementation. It enables message driven architecture and DDD, CQRS, Event Sourcing PHP
Ecotone Framework is Service Bus Implementation. It enables message driven architecture and DDD, CQRS, Event Sourcing PHP

This is Read Only Repository To contribute make use of Ecotone-Dev repository. Ecotone is Service Bus Implementation, which enables message driven arc

 🐘 🎯 Hexagonal Architecture, DDD & CQRS in PHP
🐘 🎯 Hexagonal Architecture, DDD & CQRS in PHP

🐘 🎯 Hexagonal Architecture, DDD & CQRS in PHP Example of a PHP application using Domain-Driven Design (DDD) and Command Query Responsibility Segrega

A Symfony project made with DDD, CQRS and Hexagonal Architecture

Symfony Blog DDD + CQRS + Hexagonal Architecture A Symfony blog project made with CQRS, Hexagonal Architecture and DDD Docker integration This project

Dockerise Symfony Application (Symfony 6 + Clean Architecture+ DDD+ CQRS + Docker + Xdebug + PHPUnit + Doctrine ORM + JWT Auth + Static analysis)

Symfony Dockerise Symfony Application Install Docker Install Docker Compose Docker PHP & Nginx Create Symfony Application Debugging Install Xdebug Con

Clean Architecture, DDD and CQRS using Symfony 6

Task manager system using Clean Architecture, DDD and CQRS. Environment setup Install Docker Clone the project: git clone https://github.com/k0t9i/Tas

¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP
¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

Hexagonal architecture for Laravel

Laravel Hexagonal Laravel package that allows modifying the folder structure proposed by Laravel in its initial installation by a structure based on H

Enraged Xenomorph - DDD/CQRS Symfony Application Boilerplate
Enraged Xenomorph - DDD/CQRS Symfony Application Boilerplate

Enraged Xenomorph - DDD/CQRS Symfony Application Boilerplate This project is very opinionated attempt to compile a bit of experience, few good practic

Symfony 5 PHP 8 DDD CQRS Backend POC

Book Shop A POC for DDD and CQRS applications using Symfony as framework and running with php8 User Stories Come store manager voglio aggiungere/modif

A pragmatic event sourcing library for PHP with a focus on developer experience.

EventSaucePHP EventSauce is a somewhat opinionated, no-nonsense, and easy way to introduce event sourcing into PHP projects. It's designed so storage

A "from scratch" PHP-based implementation of Event-Sourcing

In here, you will find a "from scratch" PHP-based implementation of Event-Sourcing, kept to a minimum on purpose, to allow workshop attendees to explore and experiment with its concepts.

Orkestra is a library of infrastructure and architecture helpers for creating CQRS applications

Orkestra Orkestra is an opinionated framework with a plethora of recommendations on architectural design that we use internally at Morebec to develop

A UI for Spatie's Laravel Event Sourcing
A UI for Spatie's Laravel Event Sourcing

A UI for Spatie's Laravel Event Sourcing Journal makes a wonderful companion to your local Laravel Event Sourcing development environment. Journal pro

Psalm plugin for patchlevel/event-sourcing

event-sourcing-psalm-plugin psalm plugin for event-sourcing library. installation composer require --dev patchlevel/event-sourcing-psalm-plugin confi

Comments
  • Adding Cli commands for each domains commands tested by CI

    Adding Cli commands for each domains commands tested by CI

    This PR targets having an example of continuous integration with Ecotone and Symfony (Still looking for a professional smooth workflow :) ). So it ships:

    • One cli command per domain command
    • Integration tests for each
    • Github workflow to run it "as a developer would"

    I post it here in a wip state because I'm stuck: When I run my tests, events are correctly triggered but not async projections. This is not due to Phpunit itself but only to the APP_ENV as this issue occurs when I run a command on an event sourced aggregate only: https://github.com/jclaveau/php-ddd-cqrs-event-sourcing-symfony-ecotone/blob/testing_commands/src/UI/Cli/Ticket/PrepareTicketCliCommand.php

    APP_ENV=test console app:prepare-ticket lala lolo
    

    Event sourced Ticket prepare command generates a stream but, contrary to dev env, no asynchronous projection is added to the projections table (It's created but remains empty):

    ecotone=# SELECT * FROM projections;
     no |         name          |              position              | state | status | locked_until 
    ----+-----------------------+------------------------------------+-------+--------+--------------
      1 | last_prepared_tickets | {"App\\Domain\\Ticket\\Ticket": 1} | []    | idle   | 
      2 | unassigned_tickets    | {"App\\Domain\\Ticket\\Ticket": 1} | []    | idle   | 
    (2 rows)
    
    ecotone=# \c ecotone_test 
    You are now connected to database "ecotone_test" as user "ecotone".
    ecotone_test=# SELECT * FROM projections;
     no | name | position | state | status | locked_until 
    ----+------+----------+-------+--------+--------------
    (0 rows)
    

    I wondered if it was due to the fact there is no container running projections in test env but when I try

    APP_ENV=test /data/app/bin/console ecotone:es:reset-projection last_prepared_tickets
    

    I get

    In ProjectionNotFound.php line 20:
                                                                          
      A projection with name "last_prepared_tickets" could not be found.
    

    Digging in the docs I tried some options without success: https://github.com/jclaveau/php-ddd-cqrs-event-sourcing-symfony-ecotone/blob/testing_commands/src/Infrastructure/EcotoneConfiguration.php

    I'm not enough aware of Ecotone to know if this is a usage issue or a bug so let me know if a should open a bug on Ecotone's repo.

    Thanks in advance!

    opened by jclaveau 3
  • Adding makefile and composer/console autocompletion for a smooth discovering workflow

    Adding makefile and composer/console autocompletion for a smooth discovering workflow

    This PR provides

    • A makefile following the example of https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/blob/symfony-5/makefile to provide a smooth workflow while discovering Ecotone.
    • Adds /data/app/bin to $PATH so console is instantly available
    • Applies chown 1000:1000 to all the vendor directory to avoid blocking due to failing chown on unfound /vendor/composer
    • It also adds bash-completion and autocomplete for Symfony's console and composer to discover Ecotone available commands fastly
    • An updated README to get this workflow easily

    My main concern here is about dev vs production docker images and behavior in a Kubernetes environment (which I personally never used).

    Hoping you will find it interesting!

    Anyway, thank you for your inspiring work and open-sourcing it

    opened by jclaveau 1
Owner
EcotoneFramework
Ecotone is Service Bus Implementation which enables message driven architecture and DDD, CQRS, Event Sourcing in PHP
EcotoneFramework
Infrastructure and testing helpers for creating CQRS and event sourced applications.

Broadway Broadway is a project providing infrastructure and testing helpers for creating CQRS and event sourced applications. Broadway tries hard to n

null 1.5k Dec 27, 2022
An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols. PHP>=5.3.

Workerman What is it Workerman is an asynchronous event-driven PHP framework with high performance to build fast and scalable network applications. Wo

walkor 10.2k Jan 4, 2023
Event-driven, non-blocking I/O with PHP.

Event-driven, non-blocking I/O with PHP. ReactPHP is a low-level library for event-driven programming in PHP. At its core is an event loop, on top of

ReactPHP 8.5k Jan 8, 2023
Événement is a very simple event dispatching library for PHP.

Événement Événement is a very simple event dispatching library for PHP. It has the same design goals as Silex and Pimple, to empower the user while st

Igor 1.2k Jan 4, 2023
Revolt is a rock-solid event loop for concurrent PHP applications.

Revolt is a rock-solid event loop for concurrent PHP applications.

Revolt PHP 586 Jan 2, 2023
[READ-ONLY] The event dispatcher library for CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Event Library This library emulates several aspects of how events are triggered and managed in popular JavaScript libraries such as jQuery: An

CakePHP 21 Oct 6, 2022
Icicle is a PHP library for writing asynchronous code using synchronous coding techniques

Icicle is now deprecated in favor of Amp v2.0. This version is is currently under development, but close to release. The v2.0 branches are amp_v2 in a

icicle.io 1.1k Dec 21, 2022
A non-blocking concurrency framework for PHP applications. 🐘

Amp is a non-blocking concurrency framework for PHP. It provides an event loop, promises and streams as a base for asynchronous programming. Promises

Amp 3.8k Jan 6, 2023
Asynchronous coroutines for PHP 7.

Recoil An asynchronous coroutine kernel for PHP 7. composer require recoil/recoil The Recoil project comprises the following packages: recoil/api - T

Recoil 787 Dec 8, 2022
PHP 7.4 EventStore Implementation

Prooph Event Store Common classes and interface for Prooph Event Store implementations. Installation You can install prooph/event-store via composer b

null 532 Dec 9, 2022