tbbc / symfony-cqrs-edition
The Big Brains Company "Symfony CQRS Edition"
Installs: 94
Dependents: 0
Suggesters: 0
Security: 0
Stars: 106
Watchers: 22
Forks: 20
Open Issues: 4
Type:project
Requires
- php: >=5.3.3
- beberlei/lite-cqrs: 1.1.x-dev
- doctrine/doctrine-bundle: 1.2.*
- doctrine/orm: >=2.2.3,<2.4-dev
- incenteev/composer-parameter-handler: ~2.0
- rhumsaa/uuid: ~2
- sensio/distribution-bundle: 2.3.*
- sensio/framework-extra-bundle: 2.3.*
- sensio/generator-bundle: 2.3.*
- symfony/monolog-bundle: 2.3.*
- symfony/swiftmailer-bundle: 2.3.*
- symfony/symfony: 2.3.*
- tbbc/composer-javascript: dev-master
- twig/extensions: 1.0.*
Requires (Dev)
- doctrine/data-fixtures: dev-master
- doctrine/doctrine-fixtures-bundle: dev-master
- fzaninotto/faker: ~1.2
Replaces
- tbbc/symfony-standard-cqrs: dev-master
This package is not auto-updated.
Last update: 2024-12-21 16:51:37 UTC
README
A default structure for CQRS oriented project and Symfony.
What's inside?
TODO
Requirements
- PHP >= 5.3.3
1. Quick start
1.1 Install composer if it is not installed yet
Composer installation instructions
1.2 Create a new project with composer
$ php composer.phar create-project -s dev tbbc/symfony-cqrs-edition path/to/install dev-master
Composer will install the project and all its dependencies under the path/to/install
directory.
Note 1: Because it is not stable yet, you have to explicity set the dev-master
version.
1.3 Visit the project URL
After composer installation is complete, visit the url to the project in your brower for further instructions!
2. Overview
2.1 The project structure
DDD (Domain Driven Development) and CQRS (Command/Query Responsability Segregation) aims to focus on the domain (ie: your business).
This project structure tries to properly separate the technical aspects and the actual business logic.
Based on previous experiments, POO paradigms, DDD best practices, we have defined three main "layers" for an application.
2.1.1 The Domain
It gathers the actual business logic, business rules, free of any framework implementations
This layers is splitted in two parts, as defined by the CQRS abbreviation.
The Command layer is somewhat the write layer, in charge of updating the state of your domain, while the Query is in charge of Reporting.
2.1.2 The Infrastructure
Infrastructure relates to any components that are not part of your domain and which interchangeables. This can be a Doctrine/DBAL repository, a Mailer service, or any third parties adapter. This is also here that we do the glue between the domain and any MVC framework.
2.1.3 The UI
CQRS/DDD mainly focus on a "Task Based UI", this means tasks are often mapped to actual command of your domain. UI, User Interface, is usually a website with HTML views, but it is also any CLI commands or even a REST API.
2.1.4 Default structure
src
└── Acme
└── Task
├── Command
├── Domain
│ ├── Event
│ ├── Handler
│ ├── Model
│ └── Repository
├── Infrastructure
│ ├── InfrastructureBundle
│ └── Persistence
├── Query
│ ├── EventHandler
│ ├── Repository
│ └── ViewModel
└── Ui
├── CliBundle
├── SharedBundle
└── WebBundle
In the Symfony CQRS Edition, the InfrastructureBundle is the heart of the application. It is the glue between your domain and the actual Symfony framework.
The UI layer contains all the Controllers, as well as views, themes, or any configuration which will be passed through container parameters to your Domain.
Note: the term Command may apply to both CLI Command and Command in CQRS, it should not be confused as it refers to two different concepts
3. Getting started with CQRS
TODO
4. Contributing
- Take a look at the list of issues.
- Fork
- Write a test (for either new feature or bug)
- Make a PR
5. Authors
- Boris Guéry - guery.b@gmail.com - @borisguery - http://borisguery.com
- Benjamin Dulau - benjamin.dulau@gmail.com - @delendial - http://benjamindulau.com
6. License
The Big Brains Company - Symfony CQRS Edition
is licensed under the MIT License - see the LICENSE file for details