SAP Cloud Platform deployable system with Vue.js, Express, SAP HANA and Keycloak

Cloud Platform - Return to Work Package

Documentation is WORK IN PROGRESS
SAP Cloud Platform deployable Keycloak secured system that deploys multiple microservices that takes advantage of the built in search index, geospatial and text analysis libraries in SAP HANA as well as manage SAP Cloud Platform Workflows for visitor management

Requirements

  • For deployment on SAP Cloud Platform, a configured CloudFoundry cli with access to a user or trial account
  • For deployment on SAP Cloud Plaform, Keycloak requires a hosted Postgresql backend. Project built with free tier instance from Amazon RDS
  • Registration email feature in Keycloak requires a sendmail server. Project built with Amazon SES

Development

  • nodejs environment
  • To take advantage of the simplified project deployment scripts you need the following environment variables set. Below are are example values only
export CP_USER=i999111
export CP_PASSWORD=MyAccountPassword55
export PG_ADDR=cp-rtwp.random-string-text.us-east-1.rds.amazonaws.com
export PG_PASSWORD=WholeBunchOfCharacters
export KEYCLOAK=false

architecture

Keycloak container

keycloak login

  • Deployed with cf-keycloak.sh

    • Default vendor, user and database are all postgres
    • PG_ADDR variable is just the hostname or ip address: sample-app.abcdefg.us-east-1.rds.amazonaws.com
  • Keycloak security is disabled by default. Changing the environment variable to true enables integration

Build

  • Requires a PostgreSQL backend.

    This project was developed with a free tier Amazon RDS instance.

  • Run the build script to copy over the custom CoreUI based theme

cd keycloak
./docker-build.sh

Run

  • Update keycloak/docker-run.sh to have the values for your PostgreSQL instance.

PG_ADDR and PG_PASSWORD are externalized to environment variables to avoid being checked into source control

cd keycloak
./docker-run.sh

Development

  • Make sure the keycloak container is running. Get the id of the running container from this command
docker ps -f ancestor=quay.io/mechevarria/keycloak-coreui | awk '{print $1}'
  • Copy the over the theme directory from the container by replacing $container with the value from the previous command. The system themes are automatically ignored by git
docker cp $container:/opt/jboss/keycloak/themes keycloak/
  • Build a development image (turns off caching of pages)
cd keycloak
./docker-build-dev.sh
  • Run the development image (mount the local themes directory)
cd keycloak
./docker-run-dev.sh
  • Changes made locally to keycloak/themes will be seen when you refresh server pages in your browser.

SAP HANA Container

  • Deployed with cf-db.sh
  • A container named hdi-hana-deployer will be created in SAP Cloud Platform to deploy the hana database, populate data and create tables, indexes, etc. The container will then be stopped once complete

Express Container

Requires the SAP HANA database container to be deployed. Local development requires the SAP HANA host to whitelist external addresses

Development

  • Inside the rtwp-api run the following to install all dependencies
npm install
  • Start a development server with changes hot deployed
cd rtw-api
npm install
./local-run.sh
  • Deployed with cf-express-api.sh
  • Change the KEYCLOAK environment variable to true to enable sso integration

Vue.js Container

Requires the Express container to be deployed

Development server with hotswap

cd rtwp-vue
npm install

./local-setup.sh

npm run serve

Compiles and minifies for production

npm run build

Deploy to SAP Cloud Platform

You can create an account for free at SAP Cloud Platform

./cf-login.sh
  • Push your code directly without the need of a container registry with the following commands (make sure you have done a build ahead of time)
./cf-rtwp-vue.sh
  • You will find a url to your deployed application in the SAP Cloud Foundry Cockpit.

Customize configuration

See Configuration Reference.

Integration and Links

Download Details:

Author: openNS2

Source Code: https://github.com/openNS2/cp-rtwp

#vuejs #vue #javascript

SAP Cloud Platform deployable system with Vue.js, Express, SAP HANA and Keycloak
5.90 GEEK