# Product Installation and Maintenance Packages The PIMP describes all the information required by the client to use, maintain (and evolve) the product. Instructions to install, configure and maintain are described in the following sections. ## Install #### Services - Flowable Core Engine - Name: flowable - Description: This service contains the main engine, which is used by our application to manage the processes. - React Framework - Name: web-app - Description: This service contains our main end-user application, that monitors the processes, requesting the flowable service for data. - PostgreSQL - Name: postgres - Description: this service contains the PostgreSQL database. - PGAdmin - Name: pgadmin - Description: This service contains the database management tool. - Flowable IDM Engine: - Name: flowable-idm-app - Description: This service contains a standalone IDM Engine instance. It is used by the Flowable Modeler Application to authenticate the user trying to access it. This service is built by pulling the correspondent docker image, published by Flowable itself. - Flowable Modeler Application: - Name: flowable-modeler-app - Description: This service contains the Modeler application. It allows to model a process, export as an XML file and also edit a process after uploading a XMl file. It uses the flowable-idm-app to authenticate the user trying to access it. ## Configure ### Environment variables file - This file is called **.env** and can be found in the project Root folder ***lgp-3a*** - This file contains information about some credentials: - **SLACK_WEBHOOK_URL**: this environment variable saves the link that is used to send notifications through Slack. - **PGADMIN_EMAIL & PGADMIN_PW**: these are the credentials that can be used to access the PGAdmin webpage. This service is built by pulling the correspondent docker image, published by Flowable itself. ### Docker-services routes - End-User Application (React): **http://localhost:3000/** - Flowable API: **http://localhost:8080/** - Flowable Swagger API (API Documentation): **http://localhost:8080/swagger-ui.html** - Flowable IDM Engine: **http://localhost:8081/flowable-idm** - Flowable Modeler Application: **http://localhost:8888/flowable-modeler** - PGAdmin: **http://localhost:80/** Disclaimer: To access "Flowable IDM Engine" and "Flowable Modeler Application", there is authentication needed. The username and password are the default ones, "admin" and "admin". ### Specific to the first run 1. At the terminal, run `docker-compose build` on the project root. 2. Then run `docker-compose up pgadmin` also on the project root folder. This will launch the PGAdmin service, and this way the we can configure the databases. 3. Open your browser and head to the PGAdmin route. Login with the credentials presented at the **.env** file. 4. Create the database server. At the connection tab, **host name -> postgres** (same as container name) and **port -> 5432**. **User, Password** -> available at the **.env** file. 5. Then, add two databases: one with the name **flowable-engine** and other with the name **flowable-modeler**. 6. Then just run `docker-compose down`, followed by `docker-compose up`, and the application will launch with all its services. ### Subsequent runs 1. At the terminal, run `docker-compose up`. If the database has no tables, flowable will create them. 2. Access any of the routes listed above. ## Maintain * **Docker** * The application is running using docker containers. If the containers are brought-down with `docker-compose down`, they will also erase the database and all the data. * **Backend** * All of the maven dependencies are inside the file called **pom.xml**, which is located at ***lgp-3a/flowable*** * The workflow definition is saved into an xml file called **app-submission-process.bpmn20.xml** and can be found in ***lgp-3a/flowable/src/main/resources/processes*** * All of the REST API endpoints are inside the file called **MyRestController.kt** which is located at ***lgp-3a/flowable/src/main/kotlin/com/lgp/flowable*** * When adding, Modifying or deleting any endpoint and running the project again, all changes will be automatically documented and can be tested through Swagger itself. * The automatic documentation was achieved by adding two depenedencies called **springfox-swagger2** and **springfox-swagger-ui** to the **pom.xml** file * The **Configuration.kt** file located in ***lgp-3a/flowable/src/main/kotlin/com/lgp/flowable*** contains the code that enables swagger's automatic documentation and edits some information related to the API like the author name and the API license and many other details. ### Authentication For both Flowable Modeler and Flowable IDM, the way to change the credentials is described in the Flowable Documentation. The Authentication service is configured inside the Flowable IDM Engine, so by changing or adding users in that service, they will be used to verify authentication in the Flowable Modeler service. For the Web Application, we implemented a "fake authentication" system, that simulates the presence of authentication. The default values are defined in the file **src/helpers/fake-backend.js**, on the begining of the file, in the variable *user*. **Flowable Modeler** - Username: admin - Password: test **Flowable IDM** - Username: admin - Password: test **Web Application Administrator** - Username: admin - Password: admin **Web Application Regular User** - Username: user - Password: user