Local Development & Testing
Introduction
Section titled “Introduction”This page will guide you on how to test Selv in a local environment.
Prerequisites:
Section titled “Prerequisites:”In order to start the app, you need to have cloned it and set it up. If you haven’t already, follow:
How to start the app?
Section titled “How to start the app?”In development, you will need to start the local python backend and the tauri app separately.
Start the python backend:
Section titled “Start the python backend:”-
Get into the backend folder
From the route selv/ folder:cd .\backend -
Enter the venv
.\.venv\Scripts\Activate.ps1 -
Run the main.py file
python .\main.py
-
Get into the backend folder
From the route selv/ folder:cd backend -
Enter the venv
.venv/bin/activate -
Run the main.py file
python3 main.py
The python backend should have started, listening 127.0.0.1:8000
Start the Tauri app:
Section titled “Start the Tauri app:”-
Make sure to be at the root of the selv/ folder and not to be in a virtual env (“(venv)” at the start of the command line).
-
Start the app
npm run tauri dev
After dev building, the app should start as a desktop application.
Troubleshooting:
Section titled “Troubleshooting:”Frontend not having any information displayed
Section titled “Frontend not having any information displayed”This could be caused by the tauri app loading before the python backend : On start, the frontend expects the backend to be started (It is launched by Tauri before the app opens and FastApi starts a lot quicker than the app). Therefor, if the frontend can’t reach the backend, it will throw errors and not try to reconnect.
Fix: Simply reload the Tauri app (CTRL+R) to make the frontend fetch the datas again.
“Low-level” modifications not taking effect
Section titled ““Low-level” modifications not taking effect”By “Low-level”, I refer to the operations or the elements that are mainly managed by the OS (The taskbar icon, for example).
This could be caused by the OS or the Rust cargo caching some informations and not updating them.
Fix:
- Clean the cargo cache:
cargo clean