Giter VIP home page Giter VIP logo

coherence-helidon-sockshop-sample's Introduction

Coherence Helidon Sock Shop

This project is an implementation of a stateful, microservices based application that uses Oracle Coherence CE as a scalable embedded data store, and Helidon MP as application framework.

The application is an online store that sells socks, and is based on the SockShop Microservices Demo originally written and published under Apache 2.0 license by Weaveworks.

You can see a working demo of the original application here.

This demo still uses the original front end implementation provided by Weaveworks, but all back end services have been re-implemented from scratch using Helidon MP and Oracle Coherence, in order to showcase Coherence integration with Helidon, and Eclipse MicroProfile in general.

We also provide the implementations of the same application that use Spring Boot or Micronaut as the application framework, in case one of those is your framework of choice.

Table of Contents

Architecture

The application consists of 6 back end services (rewritten from the ground up on top of Helidon, implementing the API that the legacy front-end service expects).

Architecture Diagram

  • Product Catalog, which provides REST API that allows you to search product catalog and retrieve individual product details;

  • Shopping Cart, which provides REST API that allows you to manage customers' shopping carts;

  • Orders, which provides REST API that allows customers to place orders;

  • Payment, which provides REST API that allows you to process payments;

  • Shipping, which provides REST API that allows you to ship orders and track shipments;

  • Users, which provides REST API that allows you to manage customer information and provides registration and authentication functionality for the customers.

You can find more details for each service within documentation pages for individual services, which can be accessed using the links above.

Project Structure

Each back end service described above has its own Github repo, so it can be versioned and released independently from other services.

In addition to that, there is also a main Sock Shop repository (the one you are currently in), which contains Kubernetes deployment files for the whole application, top-level POM file which allows you to easily build the whole project and import it into your favorite IDE, and a bash script that makes it easy to checkout and update all project repositories at once.

Quick Start

Kubernetes scripts depend on Kustomize, so make sure that you have a newer version of kubectl that supports it (at least 1.16 or above).

The easiest way to try the demo is to use Kubernetes deployment scripts from this repo.

If you do, you can simply run the following command from the coherence-helidon-sockshop-sample directory.

  • Install the Coherence Operator

Install the Coherence Operator using the instructions in the Coherence Operator Quick Start documentation.

  • Installing a Back-end

Create a namespace in Kubernetes called sockshop.

```bash
$ kubectl create namespace sockshop
namespace/sockshop created
```

Install the back-end into the sockshop namespace.

```bash
$ kubectl apply -k k8s/coherence --namespace sockshop
```

TIP: You can see the state of the pods using:

kubectl --namespace sockshop get pods

(Optional) Install the Original WeaveSocks Front End

Warning: The original WeaveSocks Front End has a few bugs, as well as some security issues, and it hasn't been actively maintained for a few years. However, if you want to deploy it nevertheless to see how it interacts with our back-end services, please follow the steps below.

Install the front-end service by running the following command:

$ kubectl apply -f k8s/optional/original-front-end.yaml --namespace sockshop

Port-forward to the front-end UI using the following

$ kubectl port-forward --namespace sockshop service/front-end 8079:80

Note: If you have installed into a namespace then add the --namespace option to all kubectl commands in these instructions.

You should be able to access the home page for the application by pointing your browser to http://localhost:8079/.

You should then be able to browse product catalog, add products to shopping cart, register as a new user, place an order, browse order history, etc.

Once you are finished, you can clean up the environment by executing the following:

$ kubectl delete -f k8s/optional/original-front-end.yaml --namespace sockshop
$ kubectl delete -k k8s/coherence --namespace sockshop

Scale Back-End

If you wish to scale the back-end you can issue the following command

Scale only the orders microservice

$ kubectl --namespace sockshop scale coherence orders --replicas=3

Or alternatively scale all the microservices

$ for name in carts catalog orders payment shipping users
    do kubectl --namespace sockshop scale coherence $name --replicas=3
done

Complete Application Deployment

The Quick Start shows how you can run the application locally, but that may not be enough if you want to experiment by scaling individual services, look at tracing data in Jaeger, monitor services via Prometheus and Grafana, or make API calls directly via Swagger UI.

To do all of the above, you need to deploy the services into a managed Kubernetes cluster in the cloud, by following the same set of steps described above (except for port forwarding, which is not necessary), and performing a few additional steps.

Go to Complete Application Deployment section

Development

If you want to modify the demo, you will need to check out the code for the project, build it locally, and (optionally) push new container images to the repository of your choice.

Go to Development section

License

The Universal Permissive License (UPL), Version 1.0

coherence-helidon-sockshop-sample's People

Contributors

aseovic avatar dhirupandey avatar ghillert avatar rlubke avatar thegridman avatar tmiddlet2666 avatar vasac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.