Giter Site home page Giter Site logo

dsohk / susecap-demostore Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 4.0 1.58 MB

SUSE Store sample application shows some powerful features and simple use of SUSE Cloud Application Plaform (SUSE CAP)

Ruby 5.36% CoffeeScript 11.47% JavaScript 31.57% CSS 18.47% HTML 11.41% Dockerfile 1.09% Shell 3.77% TypeScript 16.42% Python 0.44%
suse-cap suse suse-caas-platform cloud-foundry cloud-native-platform kubernetes

susecap-demostore's Introduction

SUSE Shop Demo for SUSE Cloud Application Platform

SUSE Shop Demo

Watch the demo video

This is a fictitious case study demonstrating how a company can leverage SUSE Cloud Application Platform (SUSE CAP) to provide agility infrastructure to scale their business as demands suddenly surge.

There are 2 parts in this demo.

Demo 1

A QR code is provided to attendees, which is the URL for the shopping cart application. As of this writing, SUSE CAP is deployed on AWS, and may be subjected to changes in the future. Attendees will use their mobile phones to browse to that page and start the ordering. This document provides additional information, so go through the powerpoint presentation first.

Demo 2

This demo will showcase how easy it is to update the software. This is where some requirements need to be met before you can present this demo. The code is modified locally to present the additional payment method (bitcoin), and will need to be compiled locally before uploading the new application to AWS.

To understand how the demo is supposed to execute by the presenters to a group of audience on the stage floor, please visit the demo guide (Access is limited to SUSE Employee only)

SUSE eShop Demo Environment

This eshop demo application is hosted on SUSE Cloud Application Platform on public cloud.

Login is required to access to the SUSE CAP and prometheus Query UI. Please visit to this link for the credentials (Access is limited to SUSE employee only)

SUSE eShop Architecture

The demo application is comprised of a simple micro-services based architecture:

Component Description URL
suse-expert-day QR Code For Access To order app QR code for display
order-app Mobile-friendly web-order application http://suse-order-app.open-cloud.net/
order-processor Shop API service
dashboard Store Shop Owner Business Dashboard http://suse-order-dashboard.open-cloud.net

SUSE Shop Demo Software Architecture

Presenter's Setup Guide

NOTE: This demo is hosted in public cloud which mean internet access is required for both the presenter and audience.

Setup OS

Assuming the presenter will be using OS openSUSE 15 installed with GNOME, the initial setup will be as follows.

sudo zypper -n in git-core vim nodejs8 nodejs10 cf-cli
cd ~
git clone https://github.com/dsohk/susecap-demostore
cd ~/susecap-demostore/order-app
npm install --save-dev
npm audit fix

Setup CF CLI

To access to the SUSE CAP via CLI, please follow the steps below.

  1. Set SUSE CAP API endpoint for cf-cli
cf login -a https://api.open-cloud.net --skip-ssl-validation -u admin
  1. Enter admin password to continue
  2. Select Organization: demo
  3. Select space: dev
  4. List all apps under demo/dev space with cf apps command like the example below.
$ cf apps
Getting apps in org demo / space dev as admin...
OK

name                   requested state   instances   memory   disk   urls
suse-order-dashboard   started           1/1         512M     1G     suse-order-dashboard.open-cloud.net
suse-order-app         started           1/1         64M      1G     suse-order-app.open-cloud.net
suse-order-processor   started           1/1         512M     1G     suse-order-processor.open-cloud.net
suse-expert-day        started           1/1         64M      1G     suse-expert-day.open-cloud.net

Demo 2 - Blue/green deployment and rollback

There are 2 versions of the order app:

  • v1 - order-app with cash and credit card payment options only
  • v2 - order-app with cash, credit card and bitcoin payment options.

1. Before demo, deploy the first version of order-app

Make sure the order-app-v1 has been deployed to SUSE CAP. If not, execute the following commands.

cd ~/susecap-demostore/order-app
./deploy-v1.sh

2. Demo code change (by adding bitcoin payment option in the order-app) and deploy v2

cd ~/susecap-demostore/order-app
vi src/app/paymethods.ts

Uncomment the 3rd payment option and ensure a comma has been added to the 2nd payment option like below.

import { Paymethod } from './paymethod'

export const PAYMETHODS: Paymethod[] =[
    {id: 1, name: 'Cash', image: 'fa fa-dollar-sign'},
    {id: 2, name: 'Credit Card', image: 'fa fa-credit-card'},
    {id: 3, name: 'SUSE Coin', image: 'fab fa-btc'}
]

Save the file and deploy the change to SUSE CAP

sh ./deploy.sh

The order-app should now be showing 3 payment options.

3. Rollback from v2 to v1

./switch-version.sh v2 v1

Ask the audience to check if their mobile phone is showing 2 payment options (no bitcoin).

Reset the demo environment

After the demo has been completed, please reset the demo environment with the steps below.

  1. To clear all the data in dashboard, execute the following command line in your linux host.
curl http://suse-order-processor.open-cloud.net/api/reset
  1. To reset payment to 2 options only
cd ~/susecap-demostore/order-app
vi src/app/paymethods.ts
  1. Comment out the 3rd payment options as shown below and save the file. Please ensure no comma at the end of the 2nd payment option.
import { Paymethod } from './paymethod'

export const PAYMETHODS: Paymethod[] =[
    {id: 1, name: 'Cash', image: 'fa fa-dollar-sign'},
    {id: 2, name: 'Credit Card', image: 'fa fa-credit-card'}
    // {id: 3, name: 'SUSE Coin', image: 'fab fa-btc'}
]
  1. Redeploy the order-app to SUSE CAP on AWS
cf login
cd ~/susecap-demostore/order-app
sh ./deploy-v1.sh

Feedback

Please submit an issue ticket to help us improve the demo application.

Credits

Special thanks to @byuenhb for their contribution.

susecap-demostore's People

Contributors

byuenhb avatar derekso avatar dsohk avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.