GithubHelp home page GithubHelp logo

plnech / menugen Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 6.0 29.37 MB

An intelligent generator of well-balanced meals.

License: GNU General Public License v3.0

Python 18.94% JavaScript 44.42% CSS 18.59% HTML 17.54% PHP 0.51%
genetic-algorithm meals generator nutritional balanced-meals taste morphology scraping food cooking

menugen's Introduction

MenuGen | An Intelligent Generator of Balanced meals

MenuGen is a school project that solves an eternal issue : What are we going to eat tonight?

To solve this issue, MenuGen asks you a few questions about your morphology, your food tastes and allergies or diets, before generating well-balanced meals for the next week!

How does it work?

First, we setup MenuGen:

  • Scrape recipes on the internet, storing the ingredients along with the steps to cook it
  • Match the ingredients to OpenFoodFacts to evaluate the nutritional value of each recipe
  • Store these in a PostGreSQL database and wait for users

Then, when you want to generate a meal:

  • Create an account, entering basic morphological informations that let us calculate your Basal Metabolic Rate
  • Match this calorie count to the WHO nutritional recommendations to derive your needs in proteins/carbs/fats
  • Run a Genetical Algorithm that will iterate on potential menus based on your tastes and diet to optimize the nutritional value of your meals
  • Display the result in a nice dashboard where you can remove dishes, reorder meals, print a shopping list, etc.

How do I use it?

For now there is no hosted instance of MenuGen. If you want to run it on your machine, follow these steps:

Configure the development environment

Python

Install the following packages: python3 python3-pip

Then run from the root of the project:

sudo pip install virtualenv
virtualenv -p python3 .venv
source .venv/bin/activate
pip install -r requirements.txt

To disable the python virtual environment, run deactivate

Front-end

cd application 

Install Bower + Grunt:

npm install -g grunt-cli bower

Install Assets:

npm install && bower install

Compile Assets:

grunt

Django

Initialize and configure the development database:

./manage.py makemigrations
./manage.py migrate

Create your super user:

./manage.py createsuperuser

Run the development server

First check if you're using the virtualenv. If not, run

source .venv/bin/activate

Then you can run the server with

./manage.py runserver

Migrate your local database

When models are edited, you must compute the necessary migrations from your database state, then migrate with

./manage.py makemigrations
./manage.py migrate

Manage data in the database

Load initial data (so far the ingredients):

./manage.py loaddata initial_data

Note: initial_data is reloaded every migration

Create a fixture (snapshot from the data currently in the database):

./manage.py dumpdata > menus/fixtures/myfixture.json

Load a fixture:

./manage.py loaddata myfixture

Fill ingredients directly from the csv:

./manage.py fill_db

menugen's People

Contributors

kiyomenager avatar obitux avatar plnech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

menugen's Issues

Trying to run app

Hi Guys!
The grunt command does not work for me, because there is no grunt file provided. Am I doing sg wrong?

Thank a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.