Skip to content

benjamindulau/poc-cqrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CQRS POC

This is an attempt of CQRS implementation in a Symfony 2 application.

Quick start

Update the parameters file with your local system configuration

$ cd /path/to/project/root
$ cp app/config/parameters.dist.yml app/config/parameters.yml
$ vi app/config/parameters.yml

Create read/write databases

First make sure to have updated your parameters.yml with a correct path for db.write.path and db.read.path parameters.

Also make sure that the corresponding directory paths exist!

Then, ask doctrine to create the database and the schema:

$ app/console doctrine:database:create --connection=write
$ app/console doctrine:schema:create --em=write
$ app/console doctrine:database:create --connection=read
$ app/console doctrine:schema:create --em=read

Namespaces organization

Here are some information about namespaces organization within the CQRS architecture for helping newcomers to find their way through the code ;-)

Acme/
    UserBundle/
        Data/    <= Read model
        Domain/  <= guess? (domain layer, write model)
            Event/  <= Domain events
            Model/
                User/
                    User.php                    <=  User write model
                    UserRepositoryInterface.php <=  Repository interface is part of the domain layer!
                    UserService.php             <=  Command handler
        Persistence/  <= Implementation for write repositories
        Web/      <= UI
            Command/  <= Messages from UI (an user makes a change on the UI)
            Controller/

CQRS Workflow

General Workflow

Workflow

Registration Workflow

Workflow

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages