Simple backend system of a shipping service to check for rates of shipping some goods, built using python and FastAPI
Rates are automatically imported (from data/rates (1).json) into the database when the system is run.
You can see the import function under populate_db.py
.
run pip install requirements.txt
to install all required files to run locally.
check file database.py
and make sure that the DATABASE_URL
is set to the one for localhost.
check file database.py
and make sure that the DATABASE_URL
is set to the one for docker.
run uvicorn main:app
from root directory to run
run docker-compose up
for first time and if you need to rebuild run docker-compose up -d --build
Run pytest
from root directory to run the test
When you run the docker container, a test container will be created (test-1 in my case). check the terminal of that container to see if there are any errors.