This project shows DDD approach to build e-commerce application with the the layered architecture. Application is divided into three main bounded contexts, i.e.
- Sales,
- Shipping,
- CRM.
...
Each bounded context is divided into four layers which are shown on the picture above, i.e.
- Client,
- Application,
- Domain,
- Infrastructure.
Client layer allows to communicate with application in CQRS style. To change state of application Client must receive valid command object.
To read state of application Client must receive a valid query object.
Application layer orchestrate objects from different domains to accomplish certain user story.
Domain is the core of the application and manage business logic. Domain is fully independent of framework so it can be moved to another project without code refactor.
Infrastructure provide tools, repositories, queues etc. for other layers. This is achieved by port-adapter pattern where all other layers communicate with others by ports (interfaces) and infrastructure provide adapter (implementation) for each port. Ports can be divided into inner and outer ports, where former are implemented in domains an latter are implemented in infrastructure.
- JAVA 11
- SPRING BOOT 2.x
- RABBITMQ
- DOCKER
- DOCKER-COMPOSE
To build and run this application go to root folder and run in console
gradle build bootRun
To build this application to image with docker run in console
docker build -t ddd-layers .
and now you can run this image by
docker run -d -p 8067:8067 ddd-layers
To build this application to docker image and run it with docker-compose run in console
docker-compose up -d --build