Example application for displaying registered offices using data from the 5Series APIs
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client
resources
server
.gitignore
Dockerfile
Jenkinsfile
LICENSE
README.md
Registered Office - An example app using Microgen 5Series API (Developer version).pdf
api-gateway.crt
config.yml

README.md

Registered Office v1.0.0

This is an example application for displaying registered offices using data from the 5Series APIs. It's built using Angular and Spring Boot. Use the steps below to build from GitHub.

Before you start

1. You need to have installed the Microgen 5Series API.

2. Download and install Node.js.

After installing node.js, run the command below

npm install -g @angular/cli

Installation steps

Step 1: Clone this repository and navigate to the registered-office folder.

Step 2: Build the Angular application. From the command line do the following:

cd client                        // Navigates to the client directory
npm install                      // Installs Node Package Manager
ng test --watch=false            // Runs tests
ng build --prod                  // Builds the files to be ready for distribution
cd ..                            // Navigates back to the registered-office folder

Step 3: Copy the Angular distribution files into the Spring Boot application. To do this:

Windows

xcopy "client\dist\registered-office-client" "server\src\main\resources\static" /I

Linux

cp -r client/dist/registered-office-client/. server/src/main/resources/static

Step 4: Build the Spring Boot application. To do this:

Windows

cd server                        // Navigates to the server directory
mvnw clean install               // Builds the application and generates a JAR file
cd ..                            // Navigates back to the registered-office directory

Linux

cd server                        // Navigates to the server directory
./mvnw clean install             // Builds the application and generates a JAR file
cd ..                            // Navigates back to the registered-office directory

Step 5: Copy the JAR file placing it next to the Dockerfile and rename it to registered-office. To do this:

Windows

echo F|xcopy "server\target\registered-office*.jar" "registered-office.jar" 

Linux

cp server/target/registered-office*.jar ./registered-office.jar

Step 6: Navigate to the registered-office folder. Open config.yml and add your configurations using values

applicable for your installation:

registered-office.managingEntityKey: <MANAGING_ENTITY_KEY>               

where <MANAGING_ENTITY_KEY> = Entity Key of the Managing Entity

registered-office.managingEntityAddressId: <MANAGING_ENTITY_ADDRESS_ID>  

where <MANAGING_ENTITY_ADDRESS_ID> = Address ID of the Managing Entity

api-gateway.url: <API_GATEWAY_URL>

where <API_GATEWAY_URL> = URL of the API Gateway. For example, https://5seriesAPI:8443

api-gateway.username: <API_GATEWAY_USERNAME>                             

where <API_GATEWAY_USERNAME> = the username of a valid Microgen 5Series service user in the Active directory domain. The 5Series user needs to be authorised to use the API Gateway

api-gateway.password: <API_GATEWAY_PASSWORD>                                    

where <API_GATEWAY_PASSWORD> = the password of the Microgen 5Series service user.

Note: In this example application we've used a plain text password for simplicity. We strongly recommend that you store credentials, including API_GATEWAY_PASSWORD, with a secrets management system.

api-gateway.clientId: <API_GATEWAY_CLIENTID>                             

where <API_GATEWAY_CLIENTID> = the OAuth2 clientId supported by the API Client. Only 'entity-service' is currently supported

api-gateway.clientSecretHash: <API_GATEWAY_CLIENTSECRETHASH>             

where <API_GATEWAY_CLIENTSECRETHASH> = the SHA-256 hash of the OAuth2 clientSecret corresponding to the clientId. You can use an online SHA256 hash generator to hash the secret

api-gateway.verifyHostName: <API_GATEWAY_VERIFYHOSTNAME>                 

where <API_GATEWAY_VERIFYHOSTNAME> = true or false. Set to true if you're using your own certificate and the API Gateway host machine is protected by this certificate.

Note: We recommend that you provide your own Certificate Authority (CA) signed certificate and the API Gateway host machine is protected by this certificate. You should have configured the API Gateway with this certificate already as part of the API installation.

Step 7: Navigate to the resources folder and open resources/theme.css and add your own logo and styling

Step 8: Build the Docker image with a self-signed or own certificate.

Self-signed certificate

From the command line:

docker build -t registered-office .

Own certificate

Place the certificate file in the same folder as Dockerfile.
Note: The certificate file needs to have a '.crt' file extension.

From the command line:

docker build --build-arg CERTIFICATE_FILE="<certificate file>" -t registered-office .

Step 9: Start the Docker container. From the command line:

docker run -p 8080:8080 --name registered-office --detach registered-office 

Note: If you already have something running on port 8080, you can change the host port as the example port 8085 below

docker run -p 8085:8080 --name registered-office --detach registered-office

Step 10: Open a browser and navigate to http://<HOSTNAME_OR_IP>:8080