This documentation provides information on setting up, running, and understanding the backend of the Route Planner project. The service is implemented in Python using the FastAPI framework and is hosted on Azure.
- Python
- FastAPI
- MongoDB
- Firebase
- Google Maps API
- Navigate to the projects directory in Windows CMD
- Run
python -m venv env
- Enter the
./env
directory - Run
.\Scripts\activate
, you should see(env)
at the beggining of the current line in terminal. - Run
pip install -r requirements.txt
- Create a new
.env
file in the.\env
directory - Paste the required config values into the
.env
file - Navigate back to the projects main directory and run
uvicorn main:app --env-file ./env/.env
If you are running the UI Project locally using Expo Go or an Android Emulator, run the backend with uvicorn
using the following options: --host *your IPv4 address* --port *desired port*
. On windows your IPv4 address can be found using ipconfig /all
.
Access the API documentation locally at Docs on localhost.
In order to utilize the service, it is imperative to have multiple keys configured in the .env
file. To obtain these keys, please direct message the Product Owner. It is crucial to refrain from sharing these sensitive data to maintain the security and integrity of the service.
All required libraries and their versions are specified in the requirements.txt
file.
The project's architecture is organized with several folders, with two key directories playing pivotal roles in different functionalities:
routes
- handles all logic for route managementusers
- manages user-related functionalities
Tests are implemented using pytest. You can execute the unit tests for the app using pytest -s
.