We have 2 json API backends: one done with Flask and another with FastAPI. Both are Python frameworks.
In the future we want to have several backends running simultaneously. By default Flask runs on port 8000 and FastAPI on 5000.
We are managing Python versions and packages with virtualenv
at the moment but in the future we will also introduce poetry
.
Common stuff:
.venv
(if you have Python version 2. and 3., use command: python3 -m venv .venv
):
$ python -m venv .venv
$ .venv\Scripts\activate
$ source .venv/bin/activate
(.venv)$ pip install -r requirements.txt
At this moment you have both Flask and FastAPI installed in your virtualenv
.
To run Flask:
.env
file with the following environmental variables:
FLASK_APP=flask_main
FLASK_ENV=development
(.venv)$ flask run
To run FastAPI:
(.venv)$ uvicorn fastapi_main:app --reload