Skip to content

Website to track your daily calories (Currently developing this app)

Notifications You must be signed in to change notification settings

amssdias/calorie_counter

Repository files navigation

Python Badge Python Badge Workflow branch master Docker Code style: black

Calorie Counter

The calorie counter app is a great way to keep track of all the calories you are burning every day. The user can add all the food they are eating, and the app will count the calories. We can further add a function for users to add their daily workout sessions, running and jogging to calculate how many calories they have burned.

This project was made before by me, but I decided to do a better version of it, with clean code and better functionality. You can check it here: HealthGain.

Built with

Django Badge

🔨 Getting started

Pre requisites

Installation

Clone the project

git clone https://github.com/amssdias/calorie_counter
cd calorie_counter

Configure settings (email)

Fill up the ".env.example" file, so users can receive activation links and to reset passwords. Rename it as well to ".env".

Install dependencies & activate virtualenv

  1. Pipenv (make sure you have Python installed):

     pip install pipenv  # For Windows
     brew install pipenv # For MacOs
     sudo apt install pipenv # For Debian Buster+
     sudo dnf install pipenv # For Fedora
  2. Install packages:

    pipenv install # will create a virtual environment with all the modules needed
  3. Activate virtualenv and apply migrations:

    pipenv shell # To activate the virtual environment
    
    python manage.py makemigrations
    python manage.py migrate

If any doubts, here's a link to some more explanations: Pipenv

🔎 Usage

Docker

Install Docker here.

Once installed, all you have to do is open your terminal on the project folder and run

docker-compose up

This will run the project with a PostGres database already prefilled with some data. Paste this link on your browser: http://127.0.0.1:8000/accounts/login

Without docker

On a terminal window:

pipenv shell
python manage.py runserver

Paste this link on your browser: http://127.0.0.1:8000/accounts/login

If we want to use celery to run tasks asynchronously:

On a new terminal window run:

pipenv shell
celery -A calourie_counter.celery worker -l info
celery -A calorie_counter.celery worker --pool=solo -l info # For windows

Features

  • Create an account
    • Send email to activate account async
  • Log in
    • Via email and password
    • Resend activation link async
    • Reset password
  • Add foods
  • Register foods
  • Check details of registered foods (days, time, grams)
  • Delete foods
  • Check up table of nutrition value of the current day

Releases

No releases published

Packages

No packages published