|
| 1 | +# Integration between `bpmn-visualization` and `pm4py` |
| 2 | +This is an example integration between [bpmn-visualization](https://github.com/process-analytics/bpmn-visualization-js/) and [PM4PY](https://github.com/pm4py). |
| 3 | + |
| 4 | +## Architecture |
| 5 | +The application consists of two main components: the frontend written in JavaScript and the backend written in Python. |
| 6 | +* The frontend uses **bpmn-visualization** to visualize the BPMN process model and the statistics data over it. |
| 7 | +* The backend is built using **pm4py** which processes data to perform process discovery and conformance checking. The results are then communicated to the frontend through [Flask](https://flask.palletsprojects.com/) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). |
| 8 | + |
| 9 | +In addition to bpmn-visualization and pm4py, the application also leverages two other libraries, [d3](https://d3js.org/) and [BPMN layout generators](https://github.com/process-analytics/bpmn-layout-generators). |
| 10 | +* **d3** is used to manipulate colors and add a legend to the visualized BPMN diagrams. |
| 11 | +* **BPMN layout generators** is used to generate the layout of the discovered BPMN process models produced by pm4py. ⚠️ Please note that BPMN layout generators is still in an **experimental version** and may not produce optimal or visually appealing layouts. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +You can skip this part if your system meets all the requirements listed below 👇 |
| 18 | + |
| 19 | +* [Backend requirements](./backend/README.md) |
| 20 | +* [Frontend requirements](./frontend/README.md) |
| 21 | + |
| 22 | + |
| 23 | +## Setup |
| 24 | +* Clone the project in your preferred IDE (e.g. VScode) |
| 25 | +* Prepare the backend environment: |
| 26 | + 1. Navigate to the `backend` folder: `cd backend` |
| 27 | + 2. Create a virtual environment for dependencies called `venv` using the following command: |
| 28 | + ```sh |
| 29 | + python -m venv venv |
| 30 | + ``` |
| 31 | + 3. Activate the created `venv` by running: |
| 32 | + * **Windows**: |
| 33 | + ```sh |
| 34 | + venv\Scripts\activate.bat |
| 35 | + ``` |
| 36 | + * **Unix/MacOS**: |
| 37 | + ```sh |
| 38 | + venv/bin/activate |
| 39 | + ``` |
| 40 | + 4. Install the required libraries listed in `requirements.txt` by running: |
| 41 | + ```sh |
| 42 | + pip install -r requirements.txt |
| 43 | + ``` |
| 44 | +* Prepare the frontend environment: |
| 45 | + 1. Navigate to the `frontend` folder: `cd ../frontend` |
| 46 | + 2. Install the required libraries listed in `package.json` by running: |
| 47 | + ```sh |
| 48 | + npm install |
| 49 | + ``` |
| 50 | +## Run |
| 51 | +1. Navigate to the `backend` folder: `cd backend` |
| 52 | +2. Run the application: |
| 53 | + ```sh |
| 54 | + python app.py |
| 55 | + ``` |
| 56 | +3. Open a new terminal and navigate to the `frontend`folder: `cd frontend` |
| 57 | +4. Run the development web server: |
| 58 | + ```sh |
| 59 | + npm run dev |
| 60 | + ``` |
| 61 | +5. Access the web application on the displayed localhost: http://localhost:5173/ |
0 commit comments