Skip to content

shaikrasheed99/kotlin-ecommerce-microservices

Repository files navigation

Ecommerce microservices application in Kotlin

Architecture Diagram

Architecture Diagram

Microservices Architecture Design Patterns

In this project, I have implemented several design patterns commonly used in microservices architecture

Design Pattern Tools
Service Discovery Spring Cloud Netflix
API Gateway Spring Cloud Gateway
Circuit Breaker Resilience4j
Distributed Messaging System Apache Kafka

How to set up the project?

  1. Clone the repository.

    • Run the below command to download the code from Github repository to your local machine.
      git clone https://github.com/shaikrasheed99/kotlin-ecommerce-microservices.git
    • Run the below command to move to the application directory.
      cd kotlin-ecommerce-microservices
  2. Make sure your machine has docker installed in it.

    • Make sure your terminal is in kotlin-ecommerce-microservices directory.
    • Run the below command to start the Zookeeper, Kafka broker & Kafdrop containers.
      docker compose up -d
  3. Build & Start each service.

    • Before starting any service, make sure your postgresql database in your local is started.
    • Open a new terminal and execute the below command to start all the services at once.
    • ./start-all-services.sh 
    • Execute the below command to stop all the services at once.
    •  ./stop-all-services.sh 
    Services Health API to validate Expected success response
    Order Service Postman - http://localhost:8081/actuator/health Status - 200 & Body - { "status": "UP" }
    Product Service Postman - http://localhost:8082/actuator/health Status - 200 & Body - { "status": "UP" }
    Inventory Service Postman - http://localhost:53391/actuator/health Status - 200 & Body - { "status": "UP" }
    Notification Service Postman - http://localhost:8083/actuator/health Status - 200 & Body - { "status": "UP" }
    API Gateway Postman - http://localhost:8080/actuator/health Status - 200 & Body - { "status": "UP" }
    Discovery Server Browser - http://localhost:8761/ You must see Spring Eureka default UI
    Kaf Drop Browser - http://localhost:9000/ You must see Kafdrap default UI