- clone this repo to your computer
- Install Python
- Update apt-get
sudo apt-get update
- Install venv:
sudo apt install python3-venv
- Navigate to
/api/
and enterpython3 -m venv venv
- Navigate to
/api/
and entersource venv/bin/activate
- type
export LC_ALL=C
- Run
pip install Flask
while in(venv)
mode - Run
pip install tinydb
while in(venv)
mode - Run
pip install flask_cors
while in(venv)
mode - Run
python api.py
which is in/api
directory to run the server - Test it is working by navigating to the localhost url as shown in termal. The window should display 'working'
- cd frontend
- npm install
- npm start
api/api.py
- This contains the routes exposing the api endpointshandleXXXXXX.py
- Files beginning withhandle
are api endpoint handlers
Some to test queries, navigate to the url as directed in your terminal (should be localhost:5000
)
- Entering
http://localhost:5000/donor/register?name=anto&bloodtype=0-
should displayTODO: HandleRegisterDonor
- Entering
http://localhost:5000/blood/request?amount=50&hospital=stmarys&bloodtype=a+
should displayTODO: HandleBloodRequest
- Entering
http://localhost:5000/blood/collect?bloodtype=A+&carid=batmobile
should displayTODO: HandleBloodRequest