Microservices Application Intro

In his article, Rinor describes a simple microservices architecture application consisting of three components:

Sentiment Analysis Frontend ( sa-frontend ) written in ReactJS served by Nginx webserver

( ) written in ReactJS served by Nginx webserver Sentiment Analysis WebApp ( sa-webapp ) written in Spring Boot, and

( ) written in Spring Boot, and Sentiment Analysis Logic ( sa-logic ) written in Python Flask.

See Rinor’s animated image for illustration of the application workflow:

Animated flow for the microservices application.

This would later translate into three microservices that would run in the Application Runtime (PCF PAS):

sentiment-analysis-frontend

sentiment-analysis-webapp

sentiment-analysis-logic

Once deployed, the application would present a form to input a sentence. Upon submitting a sentence into a form, the application would do a sentiment analysis and provide a polarity of the given sentence with sentiment color (see Rinor’s animated gif for illustration of a working app).

Sentiment Analysis microservices application example.

For the full source code, please refer to Rinor’s Github repo [3] or my forked Github repo [4] with code changes to make this application run in PCF PAS.

Create an Application Runtime account

First, we need an account on an Application Runtime somewhere. There is a number of choices [5] one could make. I’ve selected Pivotal Web Services (PWS) [6] as I am most familiar with this application platform flavour (and I do work for Pivotal — see disclaimer below). PWS offers a free trial, and anyone could try it out easily, no credit card needed. The developer experience is very similar on all Cloud Foundry Application Runtime flavours.

After confirming your account with Pivotal Web Services (PWS), you will need to login to PWS website [7] and download a CF CLI tool [8].

Pivotal Web Services :: Apps Manager :: Login Page

Pivotal Web Services :: Apps Manager :: Tools Page

Login to Application Runtime

Use CF CLI tool to login to an Application Runtime environment, e.g. Pivotal Web Services (PWS):



cf target

cf apps

cf services

cf buildpacks cf login -a https://api.run.pivotal.io cf targetcf appscf servicescf buildpacks

Note: If your PCF installation uses self-signed certificates, you need to skip SSL validation with the CF CLI tool, e.g.

cf login -a https://api.system.my.pcf.intranet --skip-ssl-validation

Using CF CLI to login to Pivotal Web Service (PWS)

Get the original source code from Github repo, e.g.