Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nick/auto-soylent
Automatic Soylent recipe generator
https://github.com/nick/auto-soylent
Last synced: 3 months ago
JSON representation
Automatic Soylent recipe generator
- Host: GitHub
- URL: https://github.com/nick/auto-soylent
- Owner: nick
- Created: 2014-03-23T21:02:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-03-26T03:48:04.000Z (over 10 years ago)
- Last Synced: 2024-05-07T19:32:55.175Z (6 months ago)
- Language: JavaScript
- Size: 223 KB
- Stars: 19
- Watchers: 4
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-food - Auto-Soylent - Automatic Soylent recipe generator. (Food-related projects)
README
# Auto-Soylent
Although there are many theories on the best way to automatically generate soylent recipes, so far only 1 has been
attempted: https://github.com/nick/genetic-soylentThe purpose of this skeleton project is to provide a base from which developers can work on other ways to generate
soylent recipes automatically.This first version lets you access the ingredient and nutrient targets from any of the recipes on the DIY Soylent
website. The base example is the popular "People Chow" recipe.For a detailed discussion on generating soylent recipes automatically, see the thread on the Soylent forum:
http://discourse.soylent.me/t/genetic-algorithms-automatic-diy-soylent
## Goals
A successful implementation would, given a list of ingredients, generate a recipe with close to 100% of each of the
nutrients in a given profile.The API should look something like this:
generateRecipe(ingredients, nutrientTargets) {
// code to generate recipe
// return an array of quantities in the same order the ingredients were provided in.
return ingredientQuantities;
}A nutrient profile looks like this:
var nutrientProfile = {
"name": "U.S. government DRI, male 19-50, 2000 calories","calories": 2000,
"calories_max": 2100,
"protein": 85,
"protein_max": 90,
"fat": 65,
"fat_max": 70,
"calcium": 1,
"calcium_max": 2.5,
"vitamin_c": 90,
"vitamin_c_max": 2000,
...
}Ingredients look like this:
var ingredients = [
{
"name": "Masa harina",
"serving": 100,
"unit": "g",
"calories": 365,
"protein": 9.3,
"fat": 3.86,
"calcium": 0.141,
"vitamin_c": 0,
...
},
{
"name": "Now Foods 100% Whey Protein Isolate",
"serving": 100,
"unit": "g",
"calories": 110,
"protein": 25,
"fat": 0.5,
...
},
...
]Note that the 'serving' and 'unit' properties denote the quantity of an ingredient the nutrient amounts relate to.
For example, in the ingredients above, 100g of Masa harina contains 365 calories and 9.3g protein.## Implementation
This project was implemented in Javascript so that, if a successful solution is found, it can be re-incorporated to the
DIY Soylent website. The idea is that any user could automatically reconfigure a recipe to their nutrient profile.## Installation
- This project depends on Node.js and Git.
- Visit http://nodejs.org/ to install node.js.
- Visit http://try.github.io/ for a quick intro to Git and GitHub
- Once you have node and git installed, clone this repository to your local machine
- Run `npm install` to download the dependencies
- Type `node app` to run the app.## Example output
![Example Auto-Soylent Output](example-output.png)
## Licence
MIT