supervegan! vegan food blog

meals.rec

another more different recipe manager that i made myself
a screenshot of meals.rec running in tmux

February 15, 2024

by dozens

Two of my favorite things are being vegan and databases.

So after messing around with mealmaster for a while I became inspired to hack together my own solution for keeping track of recipes and planning meals. One that doesn’t require firing up DOSBox, a database that I don’t know how to query directly, or a data format that is difficult to parse.

It’s pretty much a fully functional prototype at this point and you can check out the source at https://git.tilde.town/dozens/meals.

Here are the data types:

  1. menu: a daily menu of breakfast, lunch, and dinner meals

  2. meals: a meal that usually consists of a couple different recipes. Like “black bean patties w salad and roast broccoli”

  3. recipes: a single recipe. Like roasted broccoli.

And here’s what it does with that data:

  1. Creates a .rem file for remind(1) so I can print a calendar in the terminal, or export to .ics and include in my calendar program. I use this sometimes, but not as often as I thought I would. (Because I use remind a lot. It is pretty much my main calendar tool these days.) (see: https://dianne.skoll.ca/projects/remind/, https://blog.thechases.com/posts/remind/)

  2. Creates a PDF of the week’s menu. I email this to my family so they know what’s being served this week. Sometimes I get feedback on some planned meals. And sometimes I listen to that feedback! (Future goals: I would love to magnet an old e-ink e-reader to the fridge and have it auto fetch a new PDF to display each week. I think that’d be really neat!)

  3. Creates a list of ingredients based on the recipes chosen for the week.

Here’s the technology I used for this:

  1. GNU recutils: the world’s best plain-text relational database. https://www.gnu.org/software/recutils/

  2. groff: for making PDFs. https://www.gnu.org/software/groff/

  3. fzf: I wanted a way to review/confirm ingredients before adding them to an actual shopping list. I plan a lot of my meals around what I already have on hand. So just because a recipe calls for 16 ounces of black beans doesn’t mean I have to go out and buy any. Turns out instead of coding something, I can just pipe the whole ingredient list through fzf and multi-select the things I actually need to buy. And then copy and paste that into my grocery list in Notes.app. https://github.com/junegunn/fzf

  4. bash and GNU coreutils

So there are two different kinds of workflows:

  1. Recipes: Think of or find a new recipe that I’d like to try, and add it to the recipe database.

  2. Meals: Look at my ingredients on hand, previous meals, and any new recipes I want to try, and think about what I’d like to eat next week. Combine recipes to make meals. And then print a shopping list based on all the recipes I’ve chosen for the week!

I’ve been doing this for several weeks now to plan my meals and my shopping. And I really like it! It has gotten me seriously thinking about meal prep and meal planning in a way that I never have before. It feels good. No more trying to pull a meal together last minute. No more just throwing things into the shopping basket with no clear plans for them. My grocery budget has gone down. And we are enjoying more, better (in my opinion!) homecooked meals during the week. It has also gotten me to actually iterate on, tweak, and update recipes more than I have in the past, which has been really fun.

In the future, I’d like to use meals.rec as the official backend for this website. Which is to say, recipes appearing here will be exported from my recipe database. I’d also like to use it to export JSON-LD data so that recipes can be imported from this website directly into your own recipe app. Or maybe just to your downloads or whatever.