An exciting and minimalistic food diary and macro tracking app!
This app is an all-in-one solution for nutrition tracking including food logging and nutrients tracking.
Users can create their own account and profile. Once logged in with your account credentials, users can then search for food using natural language, and the app will return a list of items with the according quantity and nutrients information. Users will also be able to log the results into their diary.
All food diary can also be reviewed by selecting the date of entry.
Prerequisites
- Python 3.8
- Pip
- npm
- PostgreSQL
Installation
-
Obtain a free API key from CalorieNinjas API
-
Clone the repo
git clone https://github.com/triethuynh2301/macronizer-app
-
Create a virtual environment using venv
python3 -m venv venv
source venv/bin/activate
then install dependencies into the virtual environmentpip install -r requirements.txt
-
Create a .env file in root directory to specify environment variables, for example:
SECRET_KEY=<YOUR_SECRET_KEY> FLASK_APP=macronizer.py FLASK_ENV=development # API key CALORIES_NINJA_API_KEY=<YOUR_API_KEY_FROM_STEP_1> # db DEV_DB_URL=postgresql:///macronizer_db TEST_DB_URL=postgresql:///macronizer_test_db
-
In step 4, the DEV_DB_URL and TEST_DB_URL is not yet created. So, we need to create a development db and test db (for testing purposes only).
<!-- Connect to PostgresSQL under your username --> psql -U <YOUR_USERNAME> <!-- Create db for development --> user=# CREATE DATABASE macronizer_db; <!-- Create db to run unit and integration tests--> user=# CREATE DATABASE macronizer_test_db
-
Now that we have the databases, you can run the
seed.py
file to create the tables. -
In the root directory, type
flask run
to run the app in development mode then openlocalhost:5000
on browser to demo the app.
-
Users can pick a date then search for food using natural language and log the items in diary.
-
Users can drag and drop food items to update the diary or delete food from the diary.
Distributed under the MIT license. See LICENSE.txt
for more information.
⭐ Bootstrap 5
⭐ Bootstrap Themes and Templates
⭐ Font Awesome
⭐ Vanilla JS DatePicker Component
⭐ CalorieNinjas API
Triet Huynh - [email protected]