An interactive visual tool built with React Flow and a python (Flask) backend for system modelling using PathSim.
Make sure the following are installed on your system:
- Node.js + npm
- Python 3.8+
- pip for Python package management
pathview/
├── package.json # Frontend (React) dependencies
├── requirements.txt # Backend dependencies
├── src/
│ ├── backend.py # Python backend API
│ ├── components/ # JSx components
│ ├── python/ # python package source
│ ├── main.jsx
│ ├── App.jsx # main App
│ ├── nodeConfig.js # file to configure all the nodes
Once in the directory, install frontend and backend dependencies:
Front end
npm installBack end
Recommend setting up a virtual environment. Proceed as follows:
cd src
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt # install the web app requirements (eg. Flask)
pip install -e .[dev] # install the python module containing pathsim utilsYou can run both frontend and backend at once
npm run start:both
This will:
- Start the React frontend at http://localhost:5173
- Start the Flask backend at http://localhost:8000
If you are working on one side, you can also run the following commands for front end and back end respectively:
npm run dev
npm run start:backend
The project uses Sphinx to generate documentation from the reStructuredText files in the docs/ directory.
Make sure you have Sphinx installed:
pip install sphinx sphinx-book-themeTo build the HTML documentation:
cd docs
make htmlThe generated documentation will be available in docs/_build/html/index.html.
After building, you can view the documentation by opening docs/_build/html/index.html in your web browser, or serve it locally:
# From the docs/_build/html directory
python -m http.server 8080Then visit http://localhost:8080 in your browser.