Final Thesis project by Andreu Gordillo Vázquez, Alba Soldevila González, and Arnau Ranchal Marín, with the help and supervision of doctors Alfonso Martínez and Josep Font-Segura.
This version is designed to be ran locally in a development environment.
Make sure you have the following installed on your system:
- Python 3.8 or higher
- pip3 (Python package manager)
- g++ (C++ compiler)
- make (build tool)
xcode-select --install # Installs g++ and make
brew install python3 # If Python 3 is not already installedsudo apt-get update
sudo apt-get install python3 python3-pip build-essential- Install Visual Studio Build Tools
- Install Python 3 from python.org
- (Recommended) Install WSL2 for better compatibility
-
Run the setup script:
chmod +x setup_local.sh ./setup_local.sh
This script will:
- Check if all prerequisites are installed
- Install Python dependencies
- Build the C++ library
-
Start the application:
python3 run_local.py
-
Access the application: Open your browser and go to: http://localhost:8000
-
(Optional) For the FastAPI Swagger docs, visit http://localhost:8000/docs
-
When finished, stop the server with
Ctrl+Cin the terminal
If you prefer to set up manually:
- Install Python dependencies:
pip3 install -r requirements.txt
- Build the C++ library:
make clean make
- Run the application:
python3 run_local.py
- Recompile the C++ library if you change the C++ code:
make clean && make - Install Python dependencies:
pip3 install -r requirements.txt
- Run the app (alternative):
uvicorn main:app --host 127.0.0.1 --port 8000 --reload
The application uses the following environment variables:
API_KEY: Your OpenRouter API key (required for chatbot functionality)
You can set this in your shell:
export API_KEY="your-api-key-here"Or create a .env file in the project root:
API_KEY=your-api-key-here
- Make sure you have g++ and make installed
- On macOS, run
xcode-select --installif you get build errors - On Linux, install build-essential:
sudo apt-get install build-essential
- Make sure you're using Python 3.8 or higher
- Try upgrading pip:
pip3 install --upgrade pip - If you get permission errors, use:
pip3 install --user -r requirements.txt
If port 8000 is already in use, you can modify run_local.py to use a different port:
uvicorn.run("main:app", host="127.0.0.1", port=8001, reload=True)The local development server includes:
- Auto-reload: Changes to Python files will automatically restart the server
- Debug logging: More detailed error messages
- Local access: Only accessible from localhost for security
Press Ctrl+C in the terminal where the server is running to stop it.