Skip to content

skelter001/microservices-capstone

Repository files navigation

Microservices capstone

Table of content:

  1. Download
  2. Services
  3. Set up

Download

git clone https://github.com/xaghoul/microservices-capstone.git

Services

  • Catalog service:
    • Holds online store product data in-memory from the product data set above. The application exposes REST API for retrieving products by ‘uniq_id’ and list of products by ‘sku’.
  • Inventory service:
    • Holds online store product availability data. Generate random availability status for each product from the product data set above and keep it in an in-memory data structure. The application exposes REST API for retrieving product availability by a list of ‘uniq_id’.
  • Product service:
    • Returns product data to end-clients. The application exposes REST API for retrieving available products data by ‘uniq_id’ and by ‘sku’ (multiple products are returned). The REST service makes REST call to catalog application to get product data by ‘uniq_id’ or by ‘sku’, and make a call to the inventory application to get product availability and filter out only available product before returning.
  • Eureka service:
    • Registering applications and discovering them for inter-component REST calls.

Tech. stack:

  • Java 17
  • Spring 2.6
  • Spring Data JDBC
  • Spring Cloud Stack (Eureka, Openfeign, Resilience4j, Sleuth, Zipkin)
  • PostgreSQL
  • Docker
  • Mapstruct

Set up

Sample dataset

https://www.kaggle.com/PromptCloudHQ/all-jc-penny-products

Load data from dataset [Optional]:

Warning: you should use GNU awk to execute query above

docker cp <path-to-csv-file>/data.csv product_container:/data.csv
awk -vFPAT='([^,]*)|("[^"]+")' -vOFS=, '{print $1, $2}' /data.csv | head -10 | psql -U admin -d product_database -c "\COPY product(uniq_id, sku) FROM STDIN WITH (FORMAT CSV, HEADER"
  • Up docker container:
cd <path-to-project>/catalog-app
docker build -f Dockerfile
docker-compose up
  • To up zipkin server:

docker run -d -p 9411:9411 openzipkin/zipkin

Todo:

  • Set CI
  • Pull the data to container with its creation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published