Application modernization with Node.js, the Source-to-Image toolkit, and OpenShift

Summary

This code pattern is a Node.js web application for a conceptual health records system designed to showcase how Kubernetes-based microservices modernize a traditional application using OpenShift’s Source-to-Image (S2I) toolkit. In addition, this code pattern explores open standards and demonstrates front-end technologies for custom charts and responsive design.

This sample code is part of a series of code patterns that focuses on a fictional health care company and demonstrates app modernization using the enterprise Kubernetes environment of Red Hat OpenShift on IBM Cloud™. You learn how to populate and access large amounts of data on a MySQL database using REST APIs from a Java EE application. In addition, you use OpenShift’s Source-to-Image toolkit by deploying both Node.js and PHP web applications that make RESTful calls to the APIs from the Java EE application and display the data from the MySQL database. To learn more about Source-to-Image, you can watch this video.

Description

“Example Health” is a conceptual healthcare or health insurance company. It has been around a long time and has hundreds of thousands of patient records. The company’s health records look very similar to the health records of most insurance companies.

Originally, Example Health used a monolithic application structure for the health records application. The application structure was a full stack Java application running on WebSphere Application Server, connected to a DB2 database on System z.

Recently, Example Health decided to modernize the health records application and break it up into microservices. The development team decided to move to a SQL database connected to a Java EE application running on Open Liberty for the business logic and a Node.js application for the patient application user interface (as shown in this code pattern). In addition, Example Health decided to deploy these applications on Red Hat OpenShift on IBM Cloud.

Since moving to OpenShift, Example Health has expanded to include new microservices that include a PHP application for health records administrators and a Node.js analytics application.

This sample project is a patient records user interface for a conceptual health records system. The application is programmed with open standards JavaScript and modern, universal CSS. It uses HTML5 Canvas for layout and is served by a simple Node.js Express Server. The business rules for the system are written in either COBOL or Java. It includes some entitlement rules, prescription rules, and coverage rules coded in that system.

Here’s a view clients might see when they log in to the patient records app: Screen capture of example health records app

In this code pattern, you learn the following skills:

  • A step-by-step guide for deploying the app on OpenShift Source to Image (S2I).
  • The versatility of Kubernetes-based microservices for modernizing traditional applications, for example, mainframe-based applications or classic Java app server applications.
  • Exploration of open standards front-end technologies for both rendering custom charts and using responsive design.

This project stands alone in test mode, or integrates with associated projects.

Flow

Health records application modernization with microservices and OpenShift S2I architecture flow diagram

  1. The get patient data action starts in the JavaScript Controller the REST endpoint.
  2. The REST endpoint retrieves data from one of three sources: test responses, the mainframe back end, or the Liberty back end.
  3. The application displays the patient data.

Instructions

Ready to get started? Find detailed technical steps for this code pattern in the README.md file in the GitHub repository.

  1. Create a Red Hat OpenShift on IBM Cloud cluster.
  2. Create a fork in the repository.
  3. Deploy your just-forked repository.
Anton McConville
Olaph Wagoner