Skip to content

AdemCatamak/ReadingIsGood

Repository files navigation

Reading Is Good .github/workflows/github.yml

This project contains Account, Product, Stock and Order domains which are important for e-commerce.

RUN

The project could be executed via docker-compose.

If you want to debug this code, you can use docker-compose -f docker-compose-test.yml up command. By doing so, Sql Server and RabbitMq components will be up and running. DotNet 5 is required to compile the project.

Note: If the docker-compose up command cannot be executed due to the port conflict, you should change the port information both from docker-compose.yml and appsettings.json file.

General Info

Admin Username: admin
Admin Password: 123456Ac

The above information exists in the system. This information will be used for operations that can be carried out by account in the admin role.

This project is built using Event Driven Programming technique.

Outbox Design Pattern is used during sending/publishing integration commands/events. With this pattern multiple processes merge into one transaction scope.

The responsibilities of the layers of the project were decided according to the DDD concept. Layers in DDD blog post contains information about these responsibilities.

Account

This module gives services for creating user, listing users and generating access token. This web api is coded in accordance with the REST architecture.

You can click on 5 Rules of REST Architecture for details for the 5 rules that are aimed to be followed.

Product

POST Book, DELETE Book, and GET Books service points for creation, deletion and listing of book information are available under the product domain. Book information can be created and deleted in the system by the admin.

When fetching book information, specifications are created according to the criteria entered. There is much more information about Specification Design Pattern in this blog post.

Stock

Stock domain stores the number of products in the stock. All changes made on stock stored under StockActions resource. All changes made on stock to the product through the domain event affects StockSnapshot with transactional integrity.

Changes on StockSnapshot affect Stock read model. Relation between StockSnapshot and Stock is eventually consistent.

Optimistic lock is used while updating the StockSnapshot data.

CQRS pattern is used in this module. You can check Stock Management with CQRS blog post for more information.

Order

Users can create an order with the product id and information of the quantity they want. If the stock control is made and sufficient stock cannot be found, the order status set as NotFulfilled. On the other hand, if there is sufficient stock, the order set as Fulfilled. After Fulfilled status, the order can be set as Shipped status by admin.

In this project Orchestrator based Saga technique is used for Distributed Transaction .

Next Step

Integration Test with Docker will be implemented. After that, tests will be executed in pipeline via Cake Build files.