Skip to content

notusknot/food

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Food (name is a work in progress)

A program (and Rust library) that recommends you a meal plan based on your needs
View Demo · Report Bug · Request Feature

Latest Release GPL3 License LOC Lint Status

Table of Contents

About

asciicast

This project is my first one done in Rust, so please excuse any code that could be improved. However, I am working hard to make sure this program is fast, safe, and correct, in the spirit of the Rust language.

A changelog can be found in [CHANGELOG.md]

Check out some benchmarks in the performance section!

(back to top)

Getting Started

If you would just like to download and run the program, executables for Windows, MacOS and Linux can be found in the releases page. If you would like to compile the program locally on your machine:

Prerequisites

  • cargo & rustc OR
  • nix

Installation

First, clone the repo:

git clone https://github.com/notusknot/food
cd food

Using Nix

nix build .

The binary and library will be in result/

Using Cargo

To build the cli:

cargo build --release

To build just the library:

cargo build --lib --release

The binary and library will be in target/release/

(back to top)

Usage

Generate a three meals for one day, between 2100 and 2200 calories:

food 2100 2200 3 1

Generate a whole week of meals between 2500 and 2600 calories per day, with 4 meals per day:

food 2500 2600 4 7

Generate a year's worth of meals between 3600 and 3700 calories per day, with 8 meals per day:

food 3600 3700 8 365

(back to top)

Performance

As of the current version, food is very fast. Generating an average meal plan takes about 5 ms:

$ hyperfine "target/release/food 1800 2200 3 7" --warmup 30
Benchmark 1: target/release/food 1800 2200 3 7
  Time (mean ± σ):       5.3 ms ±   0.4 ms    [User: 2.2 ms, System: 2.1 ms]
  Range (min … max):     3.8 ms …   7.2 ms    283 runs

The program can also handle generating large amounts of complex plans quickly:

$ hyperfine "target/release/food 3500 3600 8 365" --warmup 30
Benchmark 1: target/release/food 3500 3600 8 365
 Time (mean ± σ):     135.6 ms ±   2.6 ms    [User: 20.1 ms, System: 113.1 ms]
 Range (min … max):   130.0 ms … 141.5 ms    20 runs

Roadmap

  • Custom recipes to database
  • Family planning: find meal plans that work for a group of people
  • Community-submitted recipes to database
  • Pricing per meal, day, week, nutrient, etc
  • Automatic grocery list
  • Pantry matching (only use ingredients user already has)
  • Sharing/exporting plans
  • Filter based on more than one nutrient (should be pretty easy)
  • Implement breakfast/lunch/dinner/snack sorting (will take brute force work on database)
  • Build web interface and compile Rust to WASM + integrate
  • More micronutrient filtering options
  • Filtering options based on health focus, condition, or diet (i.e. optimize for muscle gain, to help with diabetes, vegetarian, etc)
  • Content-based recommendation engine (requires database extension)

(back to top)

Contributing

This project is still in a very rough phase, so contributions are greatly apreciated. Thank you!

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GPL License. See LICENSE for more information.

(back to top)

Contact

My website, containing all my up-to-date contact info - notusknot.com

If my website ever goes down, it is archived on the Wayback Machine

(back to top)

Acknowledgments

(back to top)