weiliang1216 / xc-demo-spa

Single-page application demo leveraging Vue.js, Node.js and MongoDB for F5 XC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single-Page Application Demo

This application demos a modern single-page application built on:

  • Vue.js (front-end)
  • Node.js (back-end)
  • MongoDB (database)

This application was created to help train people on the F5 Distributed Cloud Services capabilities.

Brewz Site

Components

Frontend

Vue.JS application that simulates a shopping cart application.

  • Environment: Internet facing

API

Node.JS application running on Express.JS that provides the primary API and access to the database.

  • Environment: Internet facing

Database

MongoDB database that stores information about the user and the products. This database is seeded with user and product data on launch.

  • Environment: Internal

Recommendations

Node.JS microservice that will recommend products.

  • Environment: Internet facing

Inventory

Node.JS microservice that will tell the local store inventory. Note, this microservice is accessed through the API and simulates the API server talking to an internal service.

  • Environment: Internal, accessibly by the API server

Features

Stats Page

The stats page provides information for the various components that make up this application:

  • service URL
  • Latency
  • Historic latency graph

Stats Page

NOTE: If a component is offline, a component card such as in the image above will turn red.

Product Detail

The Product detail page contains the recommendations and inventory microservices.

Product Detail

Setup Env

>>> Download kubeconfig file from XC to your workspace <<<

Brewz Site

export KUBECONFIG=$(pwd)/vk8s-manifest.yaml

Deploy

kubectl apply -f api.yaml
kubectl apply -f inventory.yaml
kubectl apply -f mongodb.yaml
kubectl apply -f recommendations.yaml
kubectl apply -f spa.yaml

>>> Check the components status <<<

Brewz Site

Config Load Balance & Ingress

>>> Add Source pool for Frontend <<<

Brewz Site

Brewz Site

Brewz Site

>>> Same way to add Source pool for Backend <<<

Brewz Site

>>> Load Balance Setup <<<

Brewz Site

>>> Add Routes: <<<

Brewz Site

>>> There are 3 path for this website <<<

Brewz Site

Check your application via DNS name from "DNS Info"

Brewz Site

Attribution

This code is based on the work of Shaun Wassell and his Creating and Hosting a Full-Stack Site LinkedIn Learning course.

I have extended his demo to:

  • run components in F5 Disctribute Cloud
  • abstract API and image URLs
  • seed MongoDB
  • recommendations microservice
  • store inventory simulation
  • stats page for all services

About

Single-page application demo leveraging Vue.js, Node.js and MongoDB for F5 XC

License:Apache License 2.0


Languages

Language:Vue 61.0%Language:JavaScript 33.0%Language:Dockerfile 5.3%Language:Shell 0.7%