Designer Setup guide
The FlowX Designer app is made up of a backend microservice and a frontend app. The backend microservice handles saving and editing process definitions. It provides the REST API used by the FlowX Designer. The processes defined here will be handled by the FlowX Engine.
Follow to next steps in order to set them up in your environment.

Prerequisites

The backend microservice uses most of the same resources as the FlowX Engine:

Database - Postgres / Oracle

The backend microservice connects to the same Postgres / Oracle database as the Engine.

Kafka cluster

The backend microservice needs to be able to connect to the Kafka cluster in case you want to use the audit functionality. If connected to Kafka, it will send details about all database transactions on a configured Kafka topic.

NGINX

It would be best if the FlowX Designer used a separate NGINX load balancer from the Engine. This is used in order to route API calls from the SPA (single page application) to the backend service, to the engine and to various plugins
This is used in order to route API calls from the SPA (single page application) to the backend service, to the engine, and to various plugins.
The FlowX Designer SPA will use the backend service to manage the platform via REST calls, will use API calls to manage specific content for the plugins and will use REST and WebSocket calls to connect to the engine.
Here's a suggested NGINX setup, the one used by us:

For routing calls to plugins:

1
metadata:
2
annotations:
3
kubernetes.io/ingress.class: nginx
4
nginx.ingress.kubernetes.io/enable-cors: "true"
5
nginx.ingress.kubernetes.io/cors-allow-methods: GET, PUT, POST, DELETE, PATCH
6
nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:4200,http://localhost:80,http://localhost:8080"
7
nginx.ingress.kubernetes.io/rewrite-target: /$2
8
name: flowx-admin-plugins-subpaths
9
spec:
10
rules:
11
- host: {{host}}
12
http:
13
paths:
14
- path: /notification(/|$)(.*)
15
backend:
16
serviceName: notification
17
servicePort: 80
18
- path: /document(/|$)(.*)
19
backend:
20
serviceName: document
21
servicePort: 80
22
tls:
23
- hosts:
24
- {{host}}
25
secretName: {{tls secret}}
Copied!

For routing calls to the engine

Three different configs are needed:
  1. 1.
    For viewing the current instances of processes running in the Engine:
1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
annotations:
5
kubernetes.io/ingress.class: nginx
6
nginx.ingress.kubernetes.io/rewrite-target: /api/instances/$2
7
nginx.ingress.kubernetes.io/enable-cors: "true"
8
nginx.ingress.kubernetes.io/cors-allow-methods: GET, PUT, POST, DELETE, PATCH
9
nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:4200,http://localhost:80,http://localhost:8080"
10
name: flowx-admin-engine-instances
11
spec:
12
rules:
13
- host: {{host}}
14
http:
15
paths:
16
- path: /api/instances(/|$)(.*)
17
backend:
18
serviceName: {{engine-service-name}}
19
servicePort: 80
Copied!
2. For testing process definitions from the FlowX Designer, we need to route API calls and WebSocket communication to the Engine backend.
setup for routing REST calls:
1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
annotations:
5
kubernetes.io/ingress.class: nginx
6
nginx.ingress.kubernetes.io/rewrite-target: /api/$2
7
nginx.ingress.kubernetes.io/enable-cors: "true"
8
nginx.ingress.kubernetes.io/cors-allow-methods: GET, PUT, POST, DELETE, PATCH
9
nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:4200,http://localhost:80,http://localhost:8080"
10
name: flowx-admin-engine-rest-api
11
spec:
12
rules:
13
- host: {{host}}
14
http:
15
paths:
16
- path: /{{PROCESS_API_PATH}}/api(/|$)(.*)
17
backend:
18
serviceName: {{engine-service-name}}
19
servicePort: 80
Copied!
setup for routing WS communication:
1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
annotations:
5
kubernetes.io/ingress.class: nginx
6
nginx.ingress.kubernetes.io/configuration-snippet: |
7
more_set_headers "Access-Control-Allow-Origin: $http_origin";
8
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
9
nginx.ingress.kubernetes.io/enable-cors: "true"
10
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
11
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
12
name: flowx-admin-engine-ws
13
spec:
14
rules:
15
- host: {{host}}
16
http:
17
paths:
18
- path: /ws
19
backend:
20
serviceName: {{engine-service-name-ws}}
21
servicePort: 80
Copied!
3. For accessing the REST API of the backend microservice
1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
annotations:
5
kubernetes.io/ingress.class: nginx
6
nginx.ingress.kubernetes.io/proxy-body-size: "4m"
7
nginx.ingress.kubernetes.io/enable-cors: "true"
8
nginx.ingress.kubernetes.io/cors-allow-methods: GET, PUT, POST, DELETE, PATCH
9
nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:4200,http://localhost:80,http://localhost:8080"
10
name: flowx-admin-api
11
spec:
12
rules:
13
- host: {{host}}
14
http:
15
paths:
16
- path: /
17
backend:
18
serviceName: {{flowx-admin-service-name}}
19
servicePort: 80
20
tls:
21
- hosts:
22
- {{host}}
23
secretName: {{tls secret}}
Copied!

For configuring the SPA:

1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
annotations:
5
certmanager.k8s.io/issuer: letsencrypt-prod
6
kubernetes.io/ingress.class: nginx
7
ingress.kubernetes.io/affinity: cookie
8
name: flowx-designer-spa
9
spec:
10
rules:
11
- host: {{host of web app}}
12
http:
13
paths:
14
- backend:
15
serviceName: {{flowx-designer-service-name}}
16
servicePort: 80
17
tls:
18
- hosts:
19
- {{host of web app}}
20
secretName: {{tls secret}}
Copied!

Configuration for the Backend Microservice

Datasource configuration

To store process definitions the Admin microservice connects to the same Postgres / Oracle database as the Engine. Make sure to set the needed database connection details.
The following configuration details need to be added using environment variables:
SPRING_DATASOURCE_URL
SPRING_DATASOURCE_USERNAME
SPRING_DATASOURCE_PASSWORD
You will need to make sure that the user, password, connection link and db name are configured correctly, otherwise you will receive errors at start time.
Database schema is managed by a liquibase script provided with the Engine.

Kafka configuration

Kafka is used only for saving audit logs. Only a producer needs is configured. The environment variables that need to be set are:
KAFKA_BOOTSTRAP_SERVERS - the Kafka boostrap servers url
KAFKA_TOPIC_AUDIT_OUT - the topic where audit logs will be sent

Logging

The following environment variables could be set in order to control log levels:
LOGGING_LEVEL_ROOT - root spring boot microservice logs
LOGGING_LEVEL_APP - app level logs

Authorization & access roles

The following variables need to be set in order to connect to the identity management platform:
SECURITY_OAUTH2_BASE_SERVER_URL
SECURITY_OAUTH2_CLIENT_CLIENT_ID
SECURITY_OAUTH2_REALM
A specific service account should be configured in the OpenID provider to allow the Admin microservice to access realm specific data. It can be configured using the following environment variables:
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_ID - the openid service account username
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_SECRET - the openid service account client secret

Steps to deploy Frontend app

The FlowX Designer is a SPA application that is packaged in a docker image with nginx:1.19.6. The web application allows an authenticated user to administrate the FlowX platform.
In order to configure the docker image you need to configure the next parameters:
1
flowx-process-renderer:
2
env:
3
BASE_API_URL: {{the one configured as host in the nginx}}
4
PROCESS_API_PATH: {{something like /engine}}
5
KEYCLOAK_ISSUER: {{openid provider - ex: https://something/auth/realms/realmName}}
6
KEYCLOAK_REDIRECT_URI: {{url of the SPA}}
7
KEYCLOAK_CLIENT_ID: {{client ID}}
Copied!