Shopping-cart is a microservice project that I developed as a solution for the Trendyol case study. While developing the project, design patterns such as clean code, SOLID principles, DDD, TDD, and design patterns (Factory, Command, Strategy) were applied for testability and sustainability, and the current technologies were used.
mvn spring-boot:run
You can find the necessary Dockerfile
in the docker
folder to use Postgres and Redis
via Docker
. You can also access the DDL file required to create the database from there.
-
First of all, you need to make Redis and Postgresql working. Then, you need to add the Postgresql connection information to the relevant fields in the
command-runner-service.yml
andshopping-cart.yml
files under config-server. See -
Since it is a microservice project,
Spring Cloud Config
was used to manage the config files of the services more easily. Microservices need config files to run, so you need to runconfig-server
first. See -
Service Discovery
was used to enable microservices to communicate with each other more effectively, soEureka Server
, where microservices will register, is our second service that needs to be run. See -
Our last step is to run
shopping-cart-service
andcommand-runner-service
.
Note: Files are read from a folder path and run at regular intervals to produce results, so do not forget to configure this in the command-runner-service.yml file.
Spring: Spring framework, Spring Cloud, Spring Data
Unit Test: JUnit 5, Mockito, EasyRandom
Cache: Redis OM
Database: Postgresql
Your feedback is very important to me, thank you for reviewing.
Nice have a work day.