Foodi allows users to track their eating habits and nutrition. Use the search bar to find calorie and nutrition information for any food. When logged in, you can enter the number of servings and save to your daily diary. Save time by selecting from your frequently eaten foods. Then head to the analytics page to see a nutritional breakdown. The deployed version can be found here.
- Clone this repository.
git clone [email protected]:lilwillifo/foodi.git
-
Change into the
foodi
directory -
Create a virtualenv
virtualenv -p python3 .venv
source .venv/bin/activate
- Updgrade pip and install dependencies
pip3 install --upgrade pip
pip3 install -r requirements/local.txt
- Set up the database in psql
CREATE DATABASE foodi;
CREATE DATABASE foodi_test;
- Migrate and Seed
python3 manage.py migrate
python3 manage.py populate_db
- Run test suite (unit and feature tests). You'll need the server running in a separate tab.
python3 manage.py runserver
python3 manage.py test
python3 manage.py behave
You'll need Django and Python3 installed
To see your code in action locally, you need to fire up a development server. Use the command:
python3 manage.py runserver
Once the server is running, create an account to start tracking your food.
http://localhost:8000/
to run the application.
Deployed project is here
Please follow the Getting Started guide to set up your local dev environment.
This guide assumes that the git remote name of the main repo is upstream
and that your fork is named origin
.
Create a new branch on your local machine to make your changes against (based on upstream/master
):
git checkout -b branch-name-here --no-track upstream/master
Make sure the tests pass on your new branch:
`python3 manage.py test`
`python3 manage.py behave`
Make your changes to the codebase. I recommend using TDD. Add a test, make changes and get the test suite back to green.
`python3 manage.py test`
Once the tests are passing you can commit your changes. See How to Write a Good Commit Message for more tips.
git add .
git commit -m "Add a concise commit message describing your change here"
Push your changes to a branch on your fork:
git push origin branch-name-here
Use the GitHub UI to submit a new pull request against upstream/master. To increase the chances that your pull request is swiftly accepted please have a look at this guide to making a great pull request
TL;DR:
- Write tests
- Make sure the whole test suite is passing
- Keep your PR small, with a single focus
- Maintain a clean commit history
- Use a style consistent with the rest of the codebase
- Before submitting, rebase on the current master branch
- Django - Web Framework
- Plotly - Building data visualization
- Django Rest Framework - Backend API to feed data to Plotly
- JQuery - Asynchronous loading of charts
- Bootstrap - Bootstrap for styling
- Behave-Django - Django package for BDD testing
- Margaret Williford
- A huge shoutout to Vitor Freitas. For nearly every Django issue I ran into, he had written a blog post to solve my problem.