Recipes (What to Cook + Discover)

module_id
recipes
source_nav_id
whattocook
user_facing_name
What to Cook
recipe_version
visual-recipe-v0.5
build
SmartPantry v0.1-rebuild (manual FvRE-style extraction, July 2026)

Purpose

Recipe picker + discovery. 'What to Cook' uses current stock + mealplan to rank feasible meals (have-it/close-to-it/missing-it). 'Discover' searches + filters curated dataset.

recipe.json

{
  "schema_version": "visual-recipe-v0.5",
  "module_id": "recipes",
  "name": "Recipes",
  "source_nav_ids": [
    "whattocook",
    "discover"
  ],
  "user_facing_names": [
    "What to Cook",
    "Discover"
  ],
  "purpose": "Recipe discovery + selection. 'What to Cook' picks recipes based on stock + mealplan. 'Discover' searches and surfaces new recipes.",
  "behaviour": {
    "what_to_cook": {
      "input": "current stock + current week mealplan",
      "output": "ranked list of feasible meals",
      "scoring": "have-it / close-to-it / missing-it"
    },
    "discover": {
      "input": "search query + filters",
      "output": "recipe feed",
      "search": "name + ingredient + tag fuzzy"
    },
    "recipe_details_modal": "shows ingredients, steps, substitutions, nutrition",
    "recipe_drag_into_mealplan": true,
    "recipe_subs": "per-ingredient substitution preferences (pantry_subPrefs)",
    "image_cache": "lazy-loaded, cached as base64 in localStorage",
    "nutrition_cache": "calculated on demand, cached"
  },
  "data": {
    "custom_recipes": "pantry_customRecipes (localStorage)",
    "saved_recipes_key": "pantry_favorites (localStorage)",
    "substitutions": "pantry_recipeSubs (localStorage)",
    "visibility": "pantry_recipeVisibility (localStorage)",
    "sub_prefs": "pantry_subPrefs (localStorage)",
    "image_cache": "pantry_recipeImageCache (localStorage)",
    "nutrition": "pantry_recipeNutrition (localStorage)",
    "quick_ideas": "pantry_quickIdeas, pantry_pinnedQuickIdeas, pantry_highlightedQuickIdeas (localStorage)",
    "pinned_collapsed": "pantry_pinnedCollapsed (localStorage)"
  },
  "key_functions": [
    "getAllRecipes",
    "getRecipe",
    "openDiscoverRecipe",
    "getVariantRecipe",
    "findBestVariant",
    "editRecipeSubs",
    "deleteCustomRecipe",
    "getAutoRecipeImage",
    "getRecipeGradient",
    "getRecipeNutrition",
    "getLastCookedDate",
    "getDaysSinceLastCooked",
    "handleRecipeDragStart",
    "handleRecipeDragEnd",
    "handleRecipeDrop",
    "renderDiscoverFeed",
    "renderDiscoverCard",
    "renderDiscoverCardCompact",
    "filterDiscover",
    "searchRecipesAndFilter"
  ],
  "files": {
    "html": "app/index.html#whattocook-tab, discover-tab",
    "css": "app/styles.css (recipe card + modal classes)",
    "js": "app/modules/recipes.js"
  },
  "tests": [
    "What to Cook ranks recipes by stock match",
    "Discover search filters recipes correctly",
    "Recipe modal shows ingredients + steps",
    "Drag recipe to mealplan adds it",
    "Substitution preference is honoured",
    "Image cache works for repeated views"
  ]
}

Rebuild decisions for this module


Part of the SmartPantry module-organised rebuild. Authored by hand following the FvRE Recipe Book pattern. Source: /workspace/smartpantry-app/recipe-book/recipes/recipe.json