{"id":33164981,"url":"https://github.com/mohamed-taman/Springy-Store-Microservices","last_synced_at":"2025-11-16T12:01:01.316Z","repository":{"id":45588177,"uuid":"250922982","full_name":"mohamed-taman/Springy-Store-Microservices","owner":"mohamed-taman","description":"Springy Store is a conceptual simple μServices-based project using the latest cutting-edge technologies, to demonstrate how the Store services are created to be a cloud-native and 12-factor app agnostic. Those μServices are developed based on Spring Boot \u0026 Cloud framework that implements cloud-native intuitive, design patterns, and best practices.","archived":false,"fork":false,"pushed_at":"2024-03-08T13:01:31.000Z","size":1946,"stargazers_count":603,"open_issues_count":7,"forks_count":188,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-06-09T13:35:44.926Z","etag":null,"topics":["12-factor","auth0","cloud-native","databases","docker","docker-compose","docker-compose-template","elasticsearch","java","java15","junit5","kubernetes","microservices","mongodb","mysql-database","reactive-programming","spring-boot","spring-cloud","spring-cloud-netflix","test-microservices"],"latest_commit_sha":null,"homepage":"https://mohamed-taman.github.io/Springy-Store-Microservices/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohamed-taman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-29T00:34:49.000Z","updated_at":"2025-06-08T13:10:49.000Z","dependencies_parsed_at":"2024-12-25T08:06:23.212Z","dependency_job_id":"07c0bd16-5b6e-4ec6-b8bf-5d6aef44dffe","html_url":"https://github.com/mohamed-taman/Springy-Store-Microservices","commit_stats":{"total_commits":119,"total_committers":5,"mean_commits":23.8,"dds":0.07563025210084029,"last_synced_commit":"bb506d4c50ffd57e2d4df45737ca6fe5c29636b8"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/mohamed-taman/Springy-Store-Microservices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-taman%2FSpringy-Store-Microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-taman%2FSpringy-Store-Microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-taman%2FSpringy-Store-Microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-taman%2FSpringy-Store-Microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohamed-taman","download_url":"https://codeload.github.com/mohamed-taman/Springy-Store-Microservices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamed-taman%2FSpringy-Store-Microservices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284704131,"owners_count":27049848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12-factor","auth0","cloud-native","databases","docker","docker-compose","docker-compose-template","elasticsearch","java","java15","junit5","kubernetes","microservices","mongodb","mysql-database","reactive-programming","spring-boot","spring-cloud","spring-cloud-netflix","test-microservices"],"created_at":"2025-11-16T00:00:31.634Z","updated_at":"2025-11-16T12:01:01.307Z","avatar_url":"https://github.com/mohamed-taman.png","language":"Java","funding_links":[],"categories":["Educational GitHub Projects"],"sub_categories":[],"readme":"# Springy Store μServices ![GitHub release (latest by date)](https://img.shields.io/github/v/release/mohamed-taman/Springy-Store-Microservices) [![Release Codename](https://img.shields.io/badge/codename-Refresher_3-yellow.svg)](https://github.com/mohamed-taman/Springy-Store-Microservices/releases) | [![Twitter Follow](https://img.shields.io/twitter/follow/_tamanm?label=follow%20me\u0026style=social)](https://twitter.com/_tamanm)\n\n## Important Note: This project's new milestone is to move The whole system to work on Kubernetes, so stay tuned.\n\n## Introduction\n- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns, and coding best practices.\n- The project follows [**CloudNative**](https://www.cncf.io/) recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be developed and deployed.\n- This project uses cutting edge technologies like Docker, Kubernetes, Elasticsearch Stack for\n logging and monitoring, Java SE 15, MySQL, and MongoDB databases, all components developed with TDD in mind, covering integration \u0026 performance testing, and many more.\n - This project is going to be developed as stages, and all such stage steps are documented under\n  the project **Springy Store μServices** [wiki page](https://github.com/mohamed-taman/Springy-Store-Microservices/wiki).\n---\n## Getting started\n### System components Structure\nLet's explain first the system structure to understand its components:\n```\nSpringy Store μService --\u003e Parent folder. \n|- config --\u003e All system configuration files \n|- docs --\u003e All docs and diagrams. \n|- store-base \n  |- store-build-chassis --\u003e Super Parent POM, contains all build information \n  |- store-cloud-chassis --\u003e Cloud services Parent POM, inherit from build contains all cloud libraries \n  |- store-service-chassis --\u003e Parent POM, inherits from cloud contains all microservices common libraries \n|-store-cloud-infra \n  |- authorization-server --\u003e Authorization server\n  |- edge-server --\u003e API Gateway server\n  |- eureka-server --\u003e Service discovery server\n  |- config-server --\u003e Centralized Configuration server\n|-store-common \n  |- store-api --\u003e API Endpoint and services definitions for all microservices \n  |- store-utils --\u003e Common utilities shared between all components \n|-store-services \n  |- product-service --\u003e Product Microservice \n  |- recommendation-service --\u003e Recommendation Microservice \n  |- review-service --\u003e Review Microservice \n  |- store-service --\u003e Store Microservice \n|- docker-compose.yml --\u003e contains all services landscape with RabbitMQ \n|- docker-compose-kafka.yml --\u003e contains all services landscape with more instances working with Kafka with partitions \n|- docker-compose-partitions.yml --\u003e contains all services landscape with more instances working with RabbitMQ with partitions \n|- run-em-all.sh --\u003e Run all microservices in separate mode. \n|- setup.sh --\u003e Install all shared POMs and shared libraries. \n|- stop-em-all.sh --\u003e Stop all services runs in standalone mode. \n|- test-em-all.sh --\u003e This will start all docker compose landscape and test them, then shutdown docker compose containers with test finishes (use switch start stop)\n```\nNow, as we have learned about different system components, then let's start.\n\n### System Boundary - μServices Landscape\n\n![System Boundary](docs/diagram/app_ms_landscape.png)\n\n### Required software\n\nThe following are the initially required software pieces:\n\n1. **Maven**: Apache Maven is a software project management and comprehension tool, it can be downloaded from here https://maven.apache.org/download.cgi\n\n1. **Git**: it can be downloaded and installed from https://git-scm.com/downloads\n\n1. **Java 15 EA**: it can be downloaded and installed from https://jdk.java.net/15/\n\n1. **curl**: this command-line tool for testing HTTP-based APIs can be downloaded and installed from https://curl.haxx.se/download.html\n\n1. **jq**: This command-line JSON processor can be downloaded and installed from https://stedolan.github.io/jq/download/\n\n1. Spring Boot Initializer: This *Initializer* generates *spring* boot project with just what you need to start quickly! Start from here https://start.spring.io/\n\n6. **Docker Desktop**: The fastest way to containerize applications on your desktop, and you can download it from here [https://www.docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop)\n\n   \u003e For each future stage, I will list the newly required software. \n\nFollow the installation guide for each software website link and check your software versions from the command line to verify that they are all installed correctly.\n\n## Using an IDE\n\nI recommend that you work with your Java code using an IDE that supports the development of Spring Boot applications such as Spring Tool Suite or IntelliJ IDEA Ultimate Edition. So you can use the Spring Boot Dashboard to run the services, run each microservice test case, and many more.\n\nAll that you want to do is just fire up your IDE **-\u003e** open or import the parent folder `springy-store-microservices,` and everything will be ready for you.\n\n## Playing With Springy Store Project\n\n### Cloning It\n\nThe first thing to do is to open **git bash** command line, and then simply you can clone the project under any of your favorite places as the following:\n\n```bash\n\u003e git clone https://github.com/mohamed-taman/Springy-Store-Microservices.git\n```\n\n### Build \u0026 Test Them In Isolation\n\nTo build and run the test cases for each service \u0026 shared modules in the project, we need to do the following:\n\n#### First: Build \u0026 Install Shared Dependencies\n\n\u003e This done only for the first time or any new changes or versions of shared modules and POMs.\n\nTo build and install `store-build-chassis`, `store-utils`, `store-api`, `store-services-chassis`, and `store-cloud-chassis` libraries, from the root folder `springy-store-microservices` run the\n following commands:\n\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ ./setup.sh\n```\n\nNow you should expect output like this:\n\n```bash\nInstalling all Springy store core shared modules \u0026 Parent POMs\n...............................................................\n\n1- Installing [Parent Build Chassis] module...\nDone successfully.\n\n2- Installing [Parent Cloud Chassis] module...\nDone successfully.\n\n3- Installing shared [Services Utilities] module...\nDone successfully.\n\n4- Installing shared [Services APIs] module...\nDone successfully.\n\n5- Installing [Services Parent Chassis] module...\nDone successfully.\n\nWoohoo, building \u0026 installing all project modules are finished successfully.\nThe project is ready for the next step. :)\n```\n#### Second: Build \u0026 Test Microservices\nNow it is the time to build our **4 microservices** and run each service integration test in\n isolation by running the following commands:\n\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ ./mvnw clean verify -Ddockerfile.skip\n```\n\nAll build commands and test suite for each microservice should run successfully, and the final output should be like this:\n\n```bash\n---------------\u003c com.siriusxi.ms.store:store-aggregator \u003e---------------\n[INFO] Building Springy Store Aggregator 1.0-SNAPSHOT                   [13/13]\n[INFO] --------------------------------[ pom ]---------------------------------\n[INFO]\n[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ store-aggregator ---\n[INFO] ------------------------------------------------------------------------\n[INFO] Reactor Summary for Springy Store Aggregator 1.0-SNAPSHOT:\n[INFO]\n[INFO] Springy Store Build Chassis ........................ SUCCESS [  0.228 s]\n[INFO] Springy Store Cloud Chassis ........................ SUCCESS [  1.257 s]\n[INFO] Store APIs ......................................... SUCCESS [  4.279 s]\n[INFO] Store Utils ........................................ SUCCESS [  1.809 s]\n[INFO] Springy Store Chassis .............................. SUCCESS [  0.857 s]\n[INFO] Product Service .................................... SUCCESS [ 13.079 s]\n[INFO] Review Service ..................................... SUCCESS [  9.332 s]\n[INFO] Recommendation Service ............................. SUCCESS [  8.463 s]\n[INFO] Store Service ...................................... SUCCESS [  8.927 s]\n[INFO] Eureka Discovery Server ............................ SUCCESS [  6.536 s]\n[INFO] Edge Server ........................................ SUCCESS [ 32.108 s]\n[INFO] Authorization Server ............................... SUCCESS [  1.616 s]\n[INFO] Configuration Server ............................... SUCCESS [  1.216 s]\n[INFO] Springy Store Aggregator ........................... SUCCESS [  0.100 s]\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  57.663 s\n[INFO] Finished at: 2020-05-08T03:38:34+02:00\n[INFO] ------------------------------------------------------------------------\n```\n\n### Running Them All\n#### Using RabbitMQ without the use of partitions\nNow it's the time to run all of our reactive Microservices, and it's straightforward just run the following `docker-compose` commands:\n\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ docker-compose -p ssm up -d\n```\n\nAll the **services**, **databases**, and **messaging service** will run in parallel in detach mode (option `-d`), and command output will print to the console the following:\n\n```bash\nCreating network \"ssm_default\" with the default driver\nCreating ssm_eureka_1         ... done\nCreating ssm_config-server_1  ... done\nCreating ssm_gateway_1        ... done\nCreating ssm_auth-server_1    ... done\nCreating ssm_mysql_1          ... done\nCreating ssm_mongodb_1        ... done\nCreating ssm_rabbitmq_1       ... done\nCreating ssm_zipkin_1         ... done\nCreating ssm_store_1          ... done\nCreating ssm_review_1         ... done\nCreating ssm_product_1        ... done\nCreating ssm_recommendation_1 ... done\n```\n### Access Store APIs\nYou can manually test `Store Service` APIs throughout its **Swagger** interface at the following\n URL [https://localhost:8443/swagger-ui.html](https://localhost:8443/swagger-ui.html).\n### Access Service Discovery Server (Eureka)\nIf you would like to access the Eureka service discovery point to this URL [http://localhosts:8443/eureka/web](https://localhost:8443/eureka/web) to see all the services registered inside it. \n\nNote that it is accessed through API Gateway and is secured. Therefore the browser will ask you for `username:mt` and `password:p,` write them to the dialog, and you will access it. This type of security is a **basic form security**.\n\nThe **API Gateway** and **Store Service** both act as a *resource server*. To know more about calling Store API in a secure way you can check the `test-em-all.sh` script on how I have changed the calling of the services using **OAuth2** security.\n\n### Access RabbitMQ\nIn browser point to this URL [http://localhost:5672/](http://localhost:5672/) `username: guest` and `password: guest`, and you can see all **topics**, **DLQs**, **partitions**, and payload.\n\n1. For running two instances of each service and using _RabbitMQ with two partitions per topic_, use the following `docker-compose` command:\n     ```bash\n     mohamed.taman@DTLNV8 ~/springy-store-microservices \n     λ docker-compose -p ssm -f docker-compose-partitions.yml up -d \n     ```\n 1. To use _Kafka and Zookeeper with two partitions per topic_ run the following command:\n     ```bash\n      mohamed.taman@DTLNV8 ~/springy-store-microservices \n      λ docker-compose -p ssm -f docker-compose-kafka.yml up -d\n     ```\n#### Check All Services Health\nFrom Store front Service we can check all the core services health when you have all the\n microservices up and running using Docker Compose,\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ curl -k https://localhost:8443/actuator/health -s | jq .components.\"\\\"Core Microservices\\\"\"\n```\nThis will result in the following response:\n```json\n{\n  \"status\": \"UP\",\n  \"components\": {\n    \"Authorization Server\": {\n      \"status\": \"UP\"\n    },\n    \"Product Service\": {\n      \"status\": \"UP\"\n    },\n    \"Recommendation Service\": {\n      \"status\": \"UP\"\n    },\n    \"Review Service\": {\n      \"status\": \"UP\"\n    },\n    \"Store Service\": {\n      \"status\": \"UP\"\n    }\n  }\n}\n```\n### Testing Them All\nNow it's time to test all the application functionality as one part. To do so just run\n the following automation test script:\n\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ ./test-em-all.sh start\n```\n\u003e You can use `stop` switch with `start`, that will \n\u003e1. start docker, \n\u003e2. run the tests, \n\u003e3. stop the docker instances.\n\nThe result will look like this:\n\n```bash\nStarting 'Springy Store μServices' for [Blackbox] testing...\n\nStart Tests: Tue, May 31, 2020 2:09:36 AM\nHOST=localhost\nPORT=8443\nRestarting the test environment...\n$ docker-compose -p ssm down --remove-orphans\n$ docker-compose -p ssm up -d\nWait for: curl -k https://localhost:8443/actuator/health... , retry #1 , retry #2, {\"status\":\"UP\"} DONE, continues...\nTest OK (HTTP Code: 200)\n...\nTest OK (actual value: 1)\nTest OK (actual value: 3)\nTest OK (actual value: 3)\nTest OK (HTTP Code: 404, {\"httpStatus\":\"NOT_FOUND\",\"message\":\"No product found for productId: 13\",\"path\":\"/store/api/v1/products/13\",\"time\":\"2020-04-12@12:34:25.144+0000\"})\n...\nTest OK (actual value: 3)\nTest OK (actual value: 0)\nTest OK (HTTP Code: 422, {\"httpStatus\":\"UNPROCESSABLE_ENTITY\",\"message\":\"Invalid productId: -1\",\"path\":\"/store/api/v1/products/-1\",\"time\":\"2020-04-12@12:34:26.243+0000\"})\nTest OK (actual value: \"Invalid productId: -1\")\nTest OK (HTTP Code: 400, {\"timestamp\":\"2020-04-12T12:34:26.471+00:00\",\"path\":\"/store/api/v1/products/invalidProductId\",\"status\":400,\"error\":\"Bad Request\",\"message\":\"Type mismatch.\",\"requestId\":\"044dcdf2-13\"})\nTest OK (actual value: \"Type mismatch.\")\nTest OK (HTTP Code: 401, )\nTest OK (HTTP Code: 200)\nTest OK (HTTP Code: 403, )\nStart Circuit Breaker tests!\nTest OK (actual value: CLOSED)\nTest OK (HTTP Code: 500, {\"timestamp\":\"2020-05-26T00:09:48.784+00:00\",\"path\":\"/store/api/v1/products/2\",\"status\":500,\"error\":\"Internal Server Error\",\"message\":\"Did not observe any item or terminal signal within 2000ms in 'onErrorResume' (and no fallback has been configured)\",\"requestId\":\"4aa9f5e8-119\"})\n...\nTest OK (actual value: Did not observe any item or terminal signal within 2000ms)\nTest OK (HTTP Code: 200)\nTest OK (actual value: Fallback product2)\nTest OK (HTTP Code: 200)\nTest OK (actual value: Fallback product2)\nTest OK (HTTP Code: 404, {\"httpStatus\":\"NOT_FOUND\",\"message\":\"Product Id: 14 not found in fallback cache!\",\"path\":\"/store/api/v1/products/14\",\"timestamp\":\"2020-05-26@00:09:53.998+0000\"})\n...\nTest OK (actual value: product name C)\nTest OK (actual value: CLOSED)\nTest OK (actual value: CLOSED_TO_OPEN)\nTest OK (actual value: OPEN_TO_HALF_OPEN)\nTest OK (actual value: HALF_OPEN_TO_CLOSED)\nEnd, all tests OK: Tue, May 31, 2020 2:10:09 AM\n```\n### Tracking the services with Zipkin\nNow, you can now track Microservices interactions throughout Zipkin UI from the following link:\n[http://localhost:9411/zipkin/](http://localhost:9411/zipkin/)\n![Zipkin UI](docs/diagram/Zipkin.png)\n\n### Closing The Story\n\nFinally, to close the story, we need to shut down Microservices manually service by service, hahaha just kidding, run the following command to shut them all:\n\n```bash\nmohamed.taman@DTLNV8 ~/springy-store-microservices \nλ docker-compose -p ssm down --remove-orphans\n```\n And you should see output like the following:\n\n```bash\nStopping ssm_recommendation_1 ... done\nStopping ssm_product_1        ... done\nStopping ssm_review_1         ... done\nStopping ssm_mongodb_1        ... done\nStopping ssm_store_1          ... done\nStopping ssm_auth-server_1    ... done\nStopping ssm_mysql_1          ... done\nStopping ssm_rabbitmq_1       ... done\nStopping ssm_eureka_1         ... done\nStopping ssm_gateway_1        ... done\nStopping ssm_config-server_1  ... done\nStopping ssm_zipkin_1         ... done\nRemoving ssm_recommendation_1 ... done\nRemoving ssm_product_1        ... done\nRemoving ssm_review_1         ... done\nRemoving ssm_mongodb_1        ... done\nRemoving ssm_store_1          ... done\nRemoving ssm_auth-server_1    ... done\nRemoving ssm_mysql_1          ... done\nRemoving ssm_rabbitmq_1       ... done\nRemoving ssm_eureka_1         ... done\nRemoving ssm_gateway_1        ... done\nRemoving ssm_config-server_1  ... done\nRemoving ssm_zipkin_1         ... done\nRemoving network ssm_default\n```\n### The End\nIn the end, I hope you enjoyed the application and find it useful, as I did when I was developing it. \nIf you would like to enhance, please: \n- **Open PRs**, \n- Give **feedback**, \n- Add **new suggestions**, and\n- Finally, give it a 🌟.\n\n*Happy Coding ...* 🙂\n\n# License\nCopyright (C) 2017-2020 Mohamed Taman, Licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-taman%2FSpringy-Store-Microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamed-taman%2FSpringy-Store-Microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-taman%2FSpringy-Store-Microservices/lists"}