This sample has been tested on Cellery version 0.2.0
All details of the original Hipster Shop: Cloud-Native Microservices Demo Application can be found here.
Cellery is a code-first approach to building, integrating, running and managing composite microservice applications on Kubernetes. Read the Cellery documentation to learn how to set up Cellery and get started.
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.
Home Page | Checkout Screen |
---|---|
Checkout Cell | Frontend Cell |
---|---|
Hipster Shop is composed of many microservices written in different languages that talk to each other over gRPC.
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. |
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:
- ads-cell
- products-cell
- cart-cell
- checkout-cell
- front-end-cell
Clone the hipstershop-cellery repository and
navigate to the hipstershop-cellery sample.
cd hipstershop-cellery/
Run the following command (required for cellery version 0.2.0 and if the setup is local)
kubectl apply -f controller.yaml
cd hipstershop-cellery/ads-cell
cellery build ads-cell.bal wso2/ads-cell:1.0.0
cellery run wso2/ads-cell:1.0.0 -n ads-cell
cd hipstershop-cellery/products-cell
cellery build products-cell.bal wso2/products-cell:1.0.0
cellery run wso2/products-cell:1.0.0 -n products-cell
cd hipstershop-cellery/cart-cell
cellery build cart-cell.bal wso2/cart-cell:1.0.0
cellery run wso2/cart-cell:1.0.0 -n cart-cell
cd hipstershop-cellery/checkout-cell
cellery build checkout-cell.bal wso2/checkout-cell:1.0.0
cellery run wso2/checkout-cell:1.0.0 -n checkout-cell -l cartCellDep:cart-cell -l productsCellDep:products-cell -d
cd hipstershop-cellery/front-end-cell
cellery build front-end-cell.bal wso2/front-end-cell:1.0.0
cellery run wso2/front-end-cell:1.0.0 -n front-end-cell -l cartCellDep:cart-cell -l productsCellDep:products-cell -l adsCellDep:ads-cell -l checkoutCellDep:checkout-cell -d
Now all the application cells are deployed. Run the following command to see the status of the deployed cells.
cellery list instances
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 wso2/ads-cell:1.0.0
cellery view wso2/products-cell:1.0.0
cellery view wso2/cart-cell:1.0.0
cellery view wso2/checkout-cell:1.0.0
cellery view wso2/front-end-cell:1.0.0
Add the following line to /etc/hosts file: 127.0.0.1 my-hipstershop.com
Access url http://my-hipstershop.com/ from a browser.