Design a Combination of Cookbook/Meal Planning/Shopping List App

I am building a cookbook for my family’s recipes (https://technome-cookbook.tiddlyhost.com/) that can also be used for planning meals (both manually and somewhat automated) and create lists of ingredients to check the pantry for before going to the grocery store. I’d like to discuss my goals and current design to see if any of it might be better designed.

Goals

  1. Allow easy entry of new recipes without having to understand the ins and outs of TW5
  2. A custom front-end/editor for building meal plans on a weekly basis
  3. Have TW5 automatically show today’s meal plan when I first open the wiki
  4. Have a shopping list auto generated by selecting a meal plan to shop for. The shopping list should group together all similar items and add the quantities (if 3 recipes call for a teaspoon of salt, the shopping list should contain a single entry for 3 teaspoons of salt)
  5. A robust search mechanism to search for recipes. Examples:
    a. Search by tag (Dessert, Dinner, Meat, Vegetarian, Beef, Chicken, Freezable/able to be prepared in advance)
    a. Search by # of ingredients or by a specific ingredient

Current Design

Recipes - Each recipe is currently a tiddler, with transcluded Ingredients that contain quantity/measurement/ingredient (1 tbsp Salt) fields and a template to display the information stored in the fields. Each Recipe is tagged as “Recipes” (should this be singular?). Ingredients are not currently tagged and have a recipe-parent field linking back to the Recipe tiddler title.

Meal Plans - Each meal plan is currently planned to be for a week and be its own tiddler. @Springer suggested in another thread that it might be better to have each day’s meal plan be its own tiddler, which may make Goal #3 easier to accomplish.

Shopping List - Based on a given Meal Plan, I can currently find ingredients from each tiddler mentioned in a meal plan and generate a list of all ingredients, but I don’t yet have a mechanism to group and sum those items.

I welcome any input on this design before I go much further. I am reading Grok TiddlyWiki while working through my idea, and have installed the TW Commander plugin to make it easier to make bulk changes to the few recipes I’ve already added as my design changes. My background is in web development and CRUD database design so get as technical as you want in your suggestions!

Shawn

1 Like

This is a discussion I’d like to participate some in – though I don’t have too much time atm, I’ll contribute that I am both an archivist of recipes and also a thorough meal planner and macronutrient calculator

  • Right now I use MealPrepPro for meal planning nearly everything, it works spectacularly for most things but is obviously a paid service and, sometimes, they will change recipes and I will lose access to them

  • For archival of recipes (both MPP recipes and others I find) I use Mealie, which works very well, is open source, and I self-host.

Mealie works nearly as well as MPP but lacks some the macro nutrient calculations that MPP has - that’s not too big of a compromise for most people (even me) – but, more essentially, does not allow me to adjust recipes based on calories required per person, number of people, meals per person, and, probably most importantly if it had all those, a calculator for portioning appropriately.

All of this is to say, I have considered what you are talking about and would be interested in further discussions, but first I recommend checking out Mealie and identifying the features it does not offer and how those weigh into your needs.

2 Likes

@technome
Here are two recipe related wikis / plugins which were previously shared in this forum which can be helpful for you.

  1. Maple — recipes | meal-planning | grocery
  2. Recipe plugin — For storing your recipes
1 Like

Weighing in from 2006 is an idea I played with
https://no-sin.com/wiki/Recipies.htm

2 Likes

There needs to be more then just meat on the table

Indeed

Goal #0 which was not stated above was to try building a relatively complex application on top of TW5. You are right, Mealie looks like exactly what I would want, but my hope is to build something good enough in TW5 and expand on it over time. For example, Mealie mentioned fuzzy searching was an option if you hosted the database on PostgreSQL. That’s not something I need immediately but would be fun to add later on.

Well, in terms of being something fun to tinker with, I can certainly see the appeal and would be excited to follow :slight_smile: I often think that it would be nice to transition toward using TW for complex applications I have other solutions for, simply because one of my core philosophies in my approach to TW is that one should be able to reference any things from all points – therefore, it is sometimes annoying annoying to me that, for example, my journal entry about the day I spent meal prepping does not have an interlink with the place where I am doing my mealplanning

However, I have to pick and choose my battles :grinning_face_with_smiling_eyes:so to speak

1 Like

@well-noted without getting too far off-topic, I agree 100% with that idea and am following along with great interest in your audio/video parsing/note-taking for similar reasons. It’s very appealing to have as much of your workflow in a single tool or platform where it makes sense to do so. Mealie mentioned above may very well be the right tool for me, but if I don’t understand what the limitations of TW5 are I won’t be as equipped to make those decisions in advance of a prototyping session.

1 Like

What I typically do is design like I would if I was doing a relational database design. Define my entities (eg recipe, ingredient, measurement). For each, define my fields. Text and numeric fields map well into TW. Sometimes I use tags for Boolean fields, sometimes I don’t. Lookup fields add a bit of complexity. Measurement or measures might be a lookup field (in TW it’s called a list field); cup vs teaspoon. I would create a create measurement entity for these.

For each entity I would tag it singular lowercase, eg ‘measurement’. In this way when I see a mixed case tag I know it’s not one of my entities.

I have written TW edit templates to address the field data types (ie fields for user to populate). This includes tiddler lookup fields to populate custom list fields (like a database index field). Eg. When user tags a tiddler as a measurement tiddler an edit template automatically provides a list of all fields supported by this entity. Lookup fields are either shown as drop-down selection or if multiple selection is supported I provide a pop up window where the user can multi select options.

I then write view templates to show the entities how I want.

I can provide examples and screen shots if you’d like.

2 Likes

That would be great! I have spent 20+ years designing CRUD database applications for the web so this is definitely how my brain is wired, it’s just a matter of learning how to map that to TW5 vocabulary and where things like normalization may or may not be beneficial.

Yes, very well said :slight_smile:

2 Likes

Not sure how long this will be, how detailed this will get, or whether this will help you out or not.

During the COVID lockdowns, I was jealous of the wife. She was breaking down genealogy/family history walls. We have been doing genealogy for decades. I wanted to get back into it too, but I did not want to use traditional genealogy apps, and I did not want to write one. I’m a software developer—more accurately, a recently retired software developer.

I found TW had what I wanted, but, as you say, I needed to understand and respect it’s limitations and restrictions. My primary entities are people, places, events, sources, organizations, photographs, and more.

Here is what the user sees… if the user creates a new tiddler, they are presented with a list of tags from which the genealogical solution supports. Sure, the user can use the TW tag control, but it is not helpful for the new user. I grouped the entities/tags into research, conclusion, supporting, and authoring. Users simply selects/clicks on one of the options.

If I click on place… I get this:

The user is provided with more information and options to define the type of place. Aside: users can generate custom place types, which would appear here too. "(Gee, I should add a button here for the user to create a new custom place type.)

Also, since a place has been selected, the user is presented with a list of fields. I continued to show the TW fields as TW provides them, but below that I provide a list of the supported fields for a place tiddler.

As the user populates these fields, the TW fields are automatically populated.

One of the place fields is a field to reference a parent place. For example, the parent place of Denver, CO would be Colorado. The user clicks on the “Select Place” button to show a popup of places that the user can select from:

The pop-up provides a search box to filter the list of places to help find the parent place. As the user selects places, they appear above the “Select Place” button in a list box and in the place TW field. So, in this case the place field is a TW list field.

All of the above are provided via TW edit templates.

Then a TW view template, specifically for places in this case, shows how I want a place presented to the user:

Some TW users, depending on their application, prefer to provide edit fields in the view template. In my case, I went the other way, meaning the user has to enter edit mode of the tiddler to edit my entity tiddlers.

The details of an edit template are somewhat complex. In short, edit templates use CSS to determine what fields are shown. Eg. this CSS drives how fields are shown in the edit template:

By default, all fields are hidden/not shown:

.fieldset {display: none}

But this CSS enables the fields I want shown for a place tiddler (I also have field IDs listed here in view templates I want shown):

[data-tags~="place"] #fieldsetid,
[data-tags~="place"] #tabplaceid,
[data-tags~="place"] #placelegendid,
[data-tags~="place"] #placeid,
[data-tags~="place"] #googlemapid,
[data-tags~="place"] #googlemapsid,
[data-tags~="place"] #gpsid,
[data-tags~="place"] #akaid,
[data-tags~="place"] #foundingdateid,
[data-tags~="place"] #colorid,
[data-tags~="place"] #imageid,
[data-tags~="place"] #projectid,
[data-tags~="place"] #todoid,
[data-tags~="place"] #extrefid,
[data-tags~="place"] #captiongenericid,
[data-tags~="place"] #descriptionid
{
 display: block;
}

This is a start. Hopefully this is helpful. Also, I’m open to comments and ideas that improve performance and shorten the content (like that CSS listed above).

3 Likes

I believe you could use the :is selector to abbreviate that a bit:

[data-tags~="place"] :is(#fieldsetid, #tabplaceid, #placelegendid, #placeid, #googlemapid, #googlemapsid, #gpsid, #akaid, #foundingdateid, #colorid, #imageid, #projectid, #todoid, #extrefid, #captiongenericid, #descriptionid)
{
 display: block;
}

And here’s the Memory Keeper demo in case you’d like to explore the code in situ, @technome.

@clsturgeon, I’m sure I’ve said it before, but Memory Keeper is a truly beautiful piece of work and, IMO, one of the best TW showcases out there.

2 Likes

@etardiff Thanks, I had tried the is operator. Since I have a large list of entities, I have a large list of fields. After I added the is operator on a few, it appeared to be working. After changing all of them, I was getting odd behaviour. Many fields were not being shown. In the end I had to revert back. I need to investigate this again. Thanks.

Thank you for the kind words. The latest build, 0.0.19, is the last “experimental build.” The next release is 1.0.01 with many fixes, enhancements, and cleaned-up documentation, where the documentation is actually implemented using The Memory Keeper. But, as usual for me, I struggle to determine where to cut off changes.

@technome I like where your project is going, beyond recipes, to include meal planning and shopping lists. So, if I were to select the meals I wanted to plan for a week, for a family of four, could the application automatically generate a shopping list based on the quantity of ingredients required?

1 Like

This is one of the main goals of the project, with the eventual goal of summarizing all the quantities for each and allowing you to check off ones that you already have/modify quantities, and even further group ingredients to make it easier to sort in the order that you shop.

Another couple of ways to use ingredients and recipes that might interest you was discussed here

1 Like

@Sunny Thanks this looks like a very relevant thread!