Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyFridgeBuddy – What should I cook with what's in the fridge?

A Shiny app that turns up to five ingredients into recipe matches (via association rules mined from 20K recipes) and builds a calorie-targeted meal plan from your profile — with a printable plan and a grocery list. Coursework that I still use at home.

My Fridge Buddy — home

Try it live → · App source · Data package

Features

  • Recipe Matcher — pick up to 5 main ingredients; the app ranks recipes by an Apriori rule set (arules) mined over recipe → main-ingredient transactions, so it suggests what goes with what you have, not just exact matches.
  • Smart Meal Planner — age, height, weight, sex, weekly exercise and goal (maintain / lose / gain) → BMR and TDEE → a 3-, 5- or 7-day plan at 1–3 meals a day, each meal within ±10% of its calorie target, filtered by diet tags (vegetarian, gluten-free, …) and preferred ingredients.
  • Nutrition scoring — recipes scored against the computed macro profile, not just calories.
  • Exports — download the plan as PDF (R Markdown) and the grocery list as CSV.
  • Drag-and-drop ordering (SortableJS), Bootstrap Flatly theme, reactable tables.

Screenshots

Recipe Matcher: fridge items, matched recipes with grade / rating / calories, saved recipes and missing ingredients

Data

Epicurious Recipes with Rating and Nutrition (Kaggle, HugoDarwood): ~20K recipes with ingredients, directions, categories and nutrition. Curated into a SQLite database (app/inst/extdata/myfridgebuddy.sqlite) and published as the companion R data package myfridgebuddydata (data-package/) with ingredients, categories, recipes, directions and transform_ingre datasets.

How it works

app/R/
├── app_ui.R / app_server.R   # Shiny UI and server
├── db_init.R                 # SQLite connection
├── ingredient_matcher.R      # fridge items -> candidate recipes
├── rules_engine.R            # arules::apriori over recipe x main-ingredient transactions
├── profile_calc.R            # BMR / TDEE / macro targets
├── nutrition_score.R         # score recipes against the profile
├── meal_planner.R            # calorie-window sampling with diet + ingredient filters
└── meal_plan_report.Rmd      # PDF export

Stack

R · Shiny · arules · dplyr · RSQLite · reactable · rmarkdown

Run it

# app
install.packages(c("shiny","shinythemes","reactable","arules","dplyr","DBI","RSQLite","here","rmarkdown"))
shiny::runApp("app")

# data package
remotes::install_github("alyssahoang/myfridgebuddy", subdir = "data-package")
library(myfridgebuddydata); data("recipes")

Deploy

Rscript deploy.R publishes app/ to shinyapps.io (needs your account token once — see the header of the script).

Structure

myfridgebuddy/
├── app/               # Shiny application (app.R, R/, www/, inst/extdata/*.sqlite, data-csv/)
├── deploy.R           # shinyapps.io deployment
├── data-package/      # myfridgebuddydata R package (data/*.rda, man/, inst/extdata/*.csv)
└── assets/

Course project for Advanced R (with Ahmad Huseynov). Data © HugoDarwood / Epicurious, Kaggle; MIT licence for the code.

About

Shiny app: recipe matching by association rules and a calorie-targeted meal planner, plus the myfridgebuddydata R package

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages