This project represents a simple web app to calculate calories based on given food type.
- front-end
- html5
- css3
- javascript (vanilla)
- back-end
- python 3.6, 3.7, 3.8
- flask
Please check out app via:
- https://food-calories-counter.herokuapp.com (prod stage)
- http://178.62.222.165:5002 (test stage)
Please use the following command to run app via docker:
docker run -it -p 5001:5001 vyahello/calorie-counter:0.1.0 counter
Then please browse for http://0.0.0.0:5001 endpoint.
To be able to run source code please execute command below:
git clone [email protected]:vyahello/calorie-counter.git
cd calorie-counter
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
python -m counter --bind 0.0.0.0:5001 --debug
Also you can use flask built-in runner based on .flaskenv config file:
export FLASK_APP=counter
flask run
Then please open localhost:5003 endpoint in your browser.
Please run following script to obtain latest package from PYPI:
pip install calorie-counter
Then please execute instructions below to launch game from your environment:
>>> from counter import Bind, easyrun
>>>
>>> easyrun(Bind("0.0.0.0:5003"))
Then please open localhost:5003 endpoint in your browser.
Project has Travis CI integration using .travis.yml file thus code analysis (black
, mypy
) and unittests (pytest
) will be run automatically
after every made change to the repository.
To be able to run code analysis, please execute command below:
./analyse-code.sh
To build base image please run the following command:
docker build --no-cache -t vyahello/calorie-counter:0.1.0 -f docker/Dockerfile .
To build main image please run the following command:
docker build --no-cache -t vyahello/calorie-counter:test -f docker/Dockerfile --build-arg VERSION=0.1.0 .
Please use the following commands to push image:
docker push vyahello/calorie-counter:test
Please check changelog file to get more details about actual versions and it's release notes.
Author – Volodymyr Yahello
Distributed under the MIT
license. See license for more information.
You can reach out me at:
- [email protected]
- https://twitter.com/vyahello
- https://www.linkedin.com/in/volodymyr-yahello-821746127
I would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:
- Clone the repository
- Configure
git
for the first time after cloning with yourname
andemail
pip install -r requirements.txt
to install all project dependenciespip install -r requirements-dev.txt
to install all development project dependencies- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
All recent activities and ideas are described at project issues. If you have ideas you want to change/implement please do not hesitate and create an issue.