A simple REST API for e-commerce made with Flask
This project uses as a base the project semver_ci for pipeline and versioning.
- Docker: ^19.03.12
- Docker compose: ^1.22.0
Run docker-compose up -d
to start all services.
To run tests, you have to access the flask service. This can be done using the following command:
docker-compose exec flask sh
/code# poetry install
/code# coverage run
/code# coverage report
- Python: 3.8.3
- pyenv: ^1.2.19-3
- Poetry: ^1.0.9
- PostgreSQL: 12.3
poetry
was used for package management andpyenv
was used for python versions management.
Change necessary variables in
.env
to connect with yourPostgreSQL
server
With poetry
and pyenv
installed, install python 3.8.3 with pyenv:
pyenv install 3.8.3
Then start the app with:
poetry install
flask run -h '0.0.0.0' -p 5000
https://flask-commerce.herokuapp.com/apidocs/
With application runing access http://localhost:5000/apidocs/
Heroku Config Vars
DATABASE_URL # Complete url from postgres Dyno
FLASK_APP # run.py
FLASK_CONFIG # development | testing | production
LOG_TO_STDOUT # 1