Red Hat Airline is a fictional airline build to demonstrate cool technology for airlines and the transportation sector.
It is made up of microservices written in Typescript, containerized and deployed on Openshift. It also runs on OpenShift Serverless using knative, with these instructions
The front-end used Typescript and Vue.js, including components to visualize information in a meaningful way to airline management
It uses a suprisingly small amount of code to accomplish a lot, deployed on a platform that provides reliability and scalability
It was developed using VS Code, and is entirely open source
Search for Flights, Airports, Crewmembers:
npm run start
oc login -u <USERNAME> -p <PASSWORD> --server=https://CLUSTER_API_DNS:6443
oc new-project redhat-airline
oc new-app \
-n redhat-airline \
--name=redhat-airline-flight-api nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-flight-api.git \
-e PORT=8080 \
-l app=redhat-airline
oc new-app \
-n redhat-airline \
--name=redhat-airline-crewmember-api nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-crewmember-api.git \
-e PORT=8080 \
-l app=redhat-airline
oc new-app \
-n redhat-airline \
--name=redhat-airline-airport-api nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-airport-api.git \
-e PORT=8080 \
-l app=redhat-airline
oc new-app \
-n redhat-airline \
--name=redhat-airline-cargo-api nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-cargo-api.git \
-e PORT=8080 \
-l app=redhat-airline
oc expose service/redhat-airline-flight-api
oc expose service/redhat-airline-crewmember-api
oc expose service/redhat-airline-airport-api
oc expose service/redhat-airline-cargo-api
if the services are deployed as typical OpenShift pods:
oc new-app \
-n redhat-airline \
--name=redhat-airline-ui nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-ui.git \
-e VUE_APP_FLIGHT_API_URL=http://$(oc get route redhat-airline-flight-api -o json | jq -r '.spec.host') \
-e VUE_APP_CREWMEMBER_API_URL=http://$(oc get route redhat-airline-crewmember-api -o json | jq -r '.spec.host') \
-e VUE_APP_AIRPORT_API_URL=http://$(oc get route redhat-airline-airport-api -o json | jq -r '.spec.host') \
-e VUE_APP_CARGO_API_URL=http://$(oc get route redhat-airline-cargo-api -o json | jq -r '.spec.host') \
-l app=redhat-airline
oc expose service/redhat-airline-ui
oc label deployment -l app=redhat-airline app.kubernetes.io/name=nodejs
oc annotate deployment/redhat-airline-ui app.openshift.io/connects-to='[{"apiVersion":"apps/v1","kind":"Deployment","name":"redhat-airline-flight-api"},{"apiVersion":"apps/v1","kind":"Deployment","name":"redhat-airline-airport-api"},{"apiVersion":"apps/v1","kind":"Deployment","name":"redhat-airline-cargo-api"},{"apiVersion":"apps/v1","kind":"Deployment","name":"redhat-airline-crewmember-api"}]'
You can run these Node.js services locally without setting and environment variables. They default to ports 9001 and up when running on local host, as defined in the .end.development file. For production, we set a PORT environment variable
Deploying each service individually using the command:
npx nodeshift --knative
The command to get the URL endpoints is a bit different when deploying the redhat-airline-ui project:
oc new-app \
-n redhat-airline \
--name=redhat-airline-ui nodejs:latest~https://github.com/vincent-tsugranes/redhat-airline-ui.git \
-e VUE_APP_FLIGHT_API_URL=$(oc get ksvc redhat-airline-flight-api -o json | jq -r '.status.url') \
-e VUE_APP_CREWMEMBER_API_URL=$(oc get ksvc redhat-airline-crewmember-api -o json | jq -r '.status.url') \
-e VUE_APP_AIRPORT_API_URL=$(oc get ksvc redhat-airline-airport-api -o json | jq -r '.status.url') \
-e VUE_APP_CARGO_API_URL=$(oc get ksvc redhat-airline-cargo-api -o json | jq -r '.status.url') \
-l app=redhat-airline