Skip to content

Latest commit

 

History

History
162 lines (107 loc) · 12 KB

README.md

File metadata and controls

162 lines (107 loc) · 12 KB

Cell-based Hipster Shop Application

All details of the original Hipster Shop: Cloud-Native Microservices Demo Application can be found here.

The Hipster Shop project contains a 10-tier microservices application. The application is a web-based e-commerce app called “Hipster Shop” where users can browse items, add them to the cart, and purchase them.

Screenshots

Home Page Checkout Screen
Screenshot of store homepage Screenshot of checkout screen
Checkout Cell Frontend Cell
Screenshot of checkout cell Screenshot of front-end cell

Service Architecture

Hipster Shop is composed of many microservices written in different languages that talk to each other over gRPC.

Architecture of microservices

Service Language Description
frontend Go Exposes an HTTP server to serve the website. Does not require signup/login and generates session IDs for all users automatically.
cartservice C# Stores the items in the user's shipping cart in Redis and retrieves it.
productcatalogservice Go Provides the list of products from a JSON file and ability to search products and get individual products.
currencyservice Node.js Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service.
paymentservice Node.js Charges the given credit card info (mock) with the given amount and returns a transaction ID.
shippingservice Go Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock)
emailservice Python Sends users an order confirmation email (mock).
checkoutservice Go Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification.
recommendationservice Python Recommends other products based on what's given in the cart.
adservice Java Provides text ads based on given context words.
loadgenerator Python/Locust Continuously sends requests imitating realistic user shopping flows to the frontend.

Cell Architecture

Hipster Shop is composed of many microservices written in different languages that talk to each other over gRPC. This sample is structured into 5 cells:

Cell architecture of Hipstershop services

Quick deploy the Hipstershop Cells

  1. Execute below command to deploy the cells in one go. If you are interested on building and running the image, execute the steps explained here.
    cellery run wso2cellery/front-end-cell:latest -n front-end-cell -l cartCellDep:cart-cell -l productsCellDep:products-cell -l adsCellDep:ads-cell -l checkoutCellDep:checkout-cell -d -y
  1. Now view the application

Build and Deploy the Hipstershop Cells

Check Out Sample

Clone the hipstershop-cellery repository and navigate to the hipstershop-cellery sample.
cd hipstershop-cellery/

Build and Run ads-cell

cd hipstershop-cellery/ads-cell
cellery build ads-cell.bal wso2cellery/ads-cell:latest

Cell architecture of Hipstershop services

cellery run wso2cellery/ads-cell:latest -n ads-cell

Cell architecture of Hipstershop services

Build and Run products-cell

cd hipstershop-cellery/products-cell
cellery build products-cell.bal wso2cellery/products-cell:latest

Cell architecture of Hipstershop services

cellery run wso2cellery/products-cell:latest -n products-cell Cell architecture of Hipstershop services

Build and Run cart-cell

cd hipstershop-cellery/cart-cell
cellery build cart-cell.bal wso2cellery/cart-cell:latest

Cell architecture of Hipstershop services

cellery run wso2cellery/cart-cell:latest -n cart-cell Cell architecture of Hipstershop services

Build and Run checkout-cell

cd hipstershop-cellery/checkout-cell
cellery build checkout-cell.bal wso2cellery/checkout-cell:latest Cell architecture of Hipstershop services

cellery run wso2cellery/checkout-cell:latest -n checkout-cell -l cartCellDep:cart-cell -l productsCellDep:products-cell -d Cell architecture of Hipstershop services

Build and Run frontend-cell

cd hipstershop-cellery/front-end-cell
cellery build front-end-cell.bal wso2cellery/front-end-cell:latest Cell architecture of Hipstershop services

cellery run wso2cellery/front-end-cell:latest -n front-end-cell -l cartCellDep:cart-cell -l productsCellDep:products-cell -l adsCellDep:ads-cell -l checkoutCellDep:checkout-cell -d

Cell architecture of Hipstershop services

Viewing the Cells

Now all the application cells are deployed. Run the following command to see the status of the deployed cells.

cellery list instances

Cell architecture of Hipstershop services

Run cellery view command to see the components of your cell. This will open a HTML page in a browser and you can visualize the components and dependent cells of the cell image.

cellery view wso2cellery/ads-cell:latest

Cell architecture of Hipstershop services

cellery view wso2cellery/products-cell:latest

Cell architecture of Hipstershop services

cellery view wso2cellery/cart-cell:latest

Cell architecture of Hipstershop services

cellery view wso2cellery/checkout-cell:latest

Cell architecture of Hipstershop services

cellery view wso2cellery/front-end-cell:latest

Cell architecture of Hipstershop services

Viewing the Application

You would have already added the /etc/host entries during the cellery installation as mentioned in local, GCP and existing kubernetes cluster. You need to add the my-hipstershop.com also for /etc/host entry as shown below.

192.168.56.10 wso2-apim cellery-dashboard wso2sp-observability-api wso2-apim-gateway cellery-k8s-metrics idp.cellery-system pet-store.com hello-world.com my-hello-world.com my-hipstershop.com

Access url http://my-hipstershop.com/ from a browser.

Cell architecture of Hipstershop services

Cell architecture of Hipstershop services