# SUSE Shop Demo for SUSE Cloud Application Platform
![SUSE Shop Demo](/docs/images/demo.png)
[![Watch the demo video](https://img.youtube.com/vi/Pz7Qno43FFk/maxresdefault.jpg)](https://youtu.be/Pz7Qno43FFk)
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](https://microfocusinternational-my.sharepoint.com/:p:/g/personal/derek_so_suse_com/EQlWW14TqphMqQ1a4zzRaM0BeJ3KR6XAJNwJ285Wtgy71A?e=eeysz2) (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.
* [SUSE Cloud Application Platform console](https://console.open-cloud.net)
* [Prometheus Metrics Query UI](http://metrics.open-cloud.net)
> Login is required to access to the SUSE CAP and prometheus Query UI. Please visit to this [link](https://microfocusinternational-my.sharepoint.com/:w:/g/personal/derek_so_suse_com/EcB6kMwMprBKlwnUgXuw89kBtldoCfFllPg2VfW_S0L2xw?e=Hya5Eo) 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](startpage/) | QR Code For Access To order app | [QR code for display](http://suse-expert-day.open-cloud.net/) |
| [order-app](order-app/) | Mobile-friendly web-order application | [http://suse-order-app.open-cloud.net/](http://suse-order-app.open-cloud.net/) |
| [order-processor](order-processor/) | Shop API service | |
| [dashboard](dashboard/) | Store Shop Owner Business Dashboard | [http://suse-order-dashboard.open-cloud.net](http://suse-order-dashboard.open-cloud.net) |
![SUSE Shop Demo Software Architecture](/docs/images/arch.png)
# 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
```
2. Enter admin password to continue
3. Select Organization: `demo`
4. Select space: `dev`
5. 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.
```ts
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.
```bash
curl http://suse-order-processor.open-cloud.net/api/reset
```
2. To reset payment to 2 options only
```bash
cd ~/susecap-demostore/order-app
vi src/app/paymethods.ts
```
3. 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.
```ts
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'}
]
```
4. Redeploy the `order-app` to SUSE CAP on AWS
```bash
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
共150个文件
ts:22个
sh:16个
html:15个
需积分: 0 0 下载量 129 浏览量
2024-05-08
21:28:24
上传
评论
收藏 1.49MB ZIP 举报
温馨提示
SUSE Store示例应用程序显示了SUSE云应用程序平台(SUSE CAP)的一些强大功能和简单使用
资源推荐
资源详情
资源评论
收起资源包目录
susecap-demostore (150个子文件)
browserslist 388B
chartjs.coffee 4KB
dashing.gridster.coffee 1KB
graph.coffee 1KB
application.coffee 869B
number.coffee 733B
comments.coffee 591B
clock.coffee 389B
meter.coffee 387B
iframe.coffee 320B
image.coffee 319B
list.coffee 158B
text.coffee 42B
nginx.conf 150B
font-awesome.css 32KB
jquery.gridster.min.css 3KB
Dockerfile 695B
Dockerfile 274B
.editorconfig 246B
fontawesome-webfont.eot 69KB
suse-order.erb 1KB
layout.erb 1KB
Gemfile 62B
.gitignore 1KB
.gitignore 629B
.gitignore 22B
.gitkeep 0B
order-form.component.html 3KB
index.html 960B
404.html 683B
index.html 502B
list.html 493B
meter.html 442B
number.html 343B
comments.html 289B
graph.html 183B
text.html 175B
chartjs.html 123B
image.html 73B
clock.html 53B
iframe.html 52B
app.component.html 33B
favicon.ico 5KB
favicon.ico 5KB
suse_geeko_resized.jpg 54KB
suse_cup_resized.jpg 36KB
suse_shirt_resized.jpg 20KB
d3-3.2.8.js 140KB
jquery.min.js 91KB
rickshaw-1.4.3.min.js 60KB
jquery.gridster.min.js 42KB
jquery.knob.js 20KB
qrcode.min.js 19KB
server.js 6KB
karma.conf.js 1KB
jquery.leanModal.min.js 1KB
protractor.conf.js 752B
package-lock.json 384KB
package-lock.json 103KB
angular.json 4KB
tslint.json 2KB
package.json 1KB
package.json 558B
tsconfig.json 470B
tsconfig.spec.json 256B
tslint.json 244B
tsconfig.e2e.json 213B
tsconfig.app.json 166B
Gemfile.lock 2KB
README.md 7KB
README.md 544B
README.md 535B
README.md 309B
README.md 165B
FontAwesome.otf 107KB
demo.png 258KB
arch.png 103KB
screenshot.png 99KB
order-app.png 78KB
logo.png 67KB
locustfile.py 395B
suse-order.rb 2KB
convergence.rb 281B
config.ru 542B
order-form.component.sass 5KB
styles.sass 189B
app.component.sass 0B
application.scss 5KB
graph.scss 1KB
list.scss 1KB
number.scss 846B
meter.scss 819B
comments.scss 750B
text.scss 732B
image.scss 453B
clock.scss 453B
iframe.scss 109B
rundemo.sh 851B
deploy.sh 413B
switch-version.sh 328B
共 150 条
- 1
- 2
资源评论
天`南
- 粉丝: 1283
- 资源: 226
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功