From b25440d66f4f25423cb6d26c10378fe3b2327aef Mon Sep 17 00:00:00 2001 From: HeWillCook Date: Mon, 16 Nov 2026 15:55:43 -0500 Subject: [PATCH 01/12] types: add recipe instruction fields Co-Authored-By: Claude Opus 5.5 --- src/domain/recipes/types.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/domain/recipes/types.ts b/src/domain/recipes/types.ts index ea4a145..2848cff 100644 --- a/src/domain/recipes/types.ts +++ b/src/domain/recipes/types.ts @@ -19,6 +19,18 @@ export interface Recipe { emoji: string; defaultServingsPerPerson: number; items: RecipeItem[]; + /** One-line pitch shown in the picker preview, e.g. "Smash-style patties with all the fixings". */ + description?: string; + /** Hands-on prep time in minutes (chopping, mixing, forming). */ + prepMinutes?: number; + /** Cook / bake / chill time in minutes. */ + cookMinutes?: number; + /** Ordered how-to steps. Each is one complete instruction a novice can follow. */ + steps?: string[]; + /** Short practical tips: make-ahead, doneness temps, scaling for a crowd, swaps. */ + tips?: string[]; + /** Equipment needed, e.g. "Grill", "Instant-read thermometer", "9x13 pan". */ + equipment?: string[]; } /** Sections the Menu picker groups starter recipes into. */ @@ -33,3 +45,7 @@ export type RecipeCategory = export interface StarterRecipe extends Recipe { category: RecipeCategory; } + +/** Starter recipes must ship complete instructions. */ +export type CompleteStarterRecipe = StarterRecipe & + Required>; From 5653c61277ca21198010781d0e0cbe8510dc4757 Mon Sep 17 00:00:00 2001 From: HeWillCook Date: Mon, 16 Nov 2026 16:22:51 -0500 Subject: [PATCH 02/12] recipes: full prep instructions and realistic quantities Co-Authored-By: Claude Opus 5.5 --- src/domain/recipes.test.ts | 81 ++++++++++ src/domain/recipes/desserts-drinks.ts | 184 +++++++++++++++++++--- src/domain/recipes/grill.ts | 190 ++++++++++++++++++++--- src/domain/recipes/groups.test.ts | 37 ++++- src/domain/recipes/handhelds.ts | 132 ++++++++++++++-- src/domain/recipes/index.ts | 12 +- src/domain/recipes/sides.ts | 214 ++++++++++++++++++++------ 7 files changed, 738 insertions(+), 112 deletions(-) diff --git a/src/domain/recipes.test.ts b/src/domain/recipes.test.ts index 6895362..05dd00e 100644 --- a/src/domain/recipes.test.ts +++ b/src/domain/recipes.test.ts @@ -1,6 +1,20 @@ import { describe, expect, it } from "vitest"; +import { buildShoppingList } from "@/domain/shopping"; import { RECIPE_GROUPS, STARTER_RECIPES, recipeCategory } from "./recipes"; +/** + * Pantry items whose smallest retail package still dwarfs what a 10-person party needs. + * Everything here is a bag or box the store only sells in one size, so the extra stock + * goes back in the cupboard rather than to waste. + */ +const SINGLE_PACKAGE_PANTRY = new Set([ + "starter-coleslaw-sugar", // 1 lb bag of sugar vs. a few tablespoons of dressing + "starter-brownies-eggs", // eggs only come by the dozen + "starter-pancakes-eggs", // eggs only come by the dozen + "starter-falafel-pitas-flour", // 5 lb bag is the smallest flour sold + "starter-mac-and-cheese-flour", // same flour bag, used only for the roux +]); + describe("starter recipe library", () => { it("has a useful number of dishes across every group", () => { expect(STARTER_RECIPES.length).toBeGreaterThanOrEqual(20); @@ -27,4 +41,71 @@ describe("starter recipe library", () => { expect(recipeCategory(recipe), recipe.id).toBe(recipe.category); } }); + + it("describes the same ingredient the same way in every recipe", () => { + const seen = new Map< + string, + { unit: string; buyUnit: string; unitsPerBuy: number; priceCents: number; id: string } + >(); + for (const recipe of STARTER_RECIPES) { + for (const item of recipe.items) { + const key = item.name.trim().toLowerCase(); + const shape = { + unit: item.unit, + buyUnit: item.buyUnit, + unitsPerBuy: item.unitsPerBuy, + priceCents: item.priceCents, + }; + const first = seen.get(key); + if (first) { + expect(shape, `${item.id} should match ${first.id} for "${item.name}"`).toEqual({ + unit: first.unit, + buyUnit: first.buyUnit, + unitsPerBuy: first.unitsPerBuy, + priceCents: first.priceCents, + }); + } else { + seen.set(key, { ...shape, id: item.id }); + } + } + } + }); + + it("buys a practical amount of lemonade for a dozen guests", () => { + const lemonade = STARTER_RECIPES.find((recipe) => recipe.id === "starter-lemonade"); + if (!lemonade) throw new Error("missing lemonade"); + const [line] = buildShoppingList( + [{ recipe: lemonade, servingsPerPerson: lemonade.defaultServingsPerPerson }], + 12, + ); + // One can of concentrate makes 48 oz of finished lemonade, and each guest drinks + // two 12 oz servings: 24 servings x 12 oz = 288 oz, so six cans. + expect(line.needed).toBe(288); + expect(line.neededUnit).toBe("oz"); + expect(line.buyQty).toBe(6); + const finishedOz = line.buyQty * line.unitsPerBuy; + expect(finishedOz / 12).toBeGreaterThanOrEqual(20); // oz per guest + expect(finishedOz / 12).toBeLessThanOrEqual(30); + }); + + it("does not wildly over-buy any item for a ten-person party", () => { + for (const recipe of STARTER_RECIPES) { + const lines = buildShoppingList( + [{ recipe, servingsPerPerson: recipe.defaultServingsPerPerson }], + 10, + ); + for (const line of lines) { + if (SINGLE_PACKAGE_PANTRY.has(line.itemId)) continue; + const needed = line.needed; + const bought = line.buyQty * line.unitsPerBuy; + expect(bought / needed, `${line.itemId} (${line.name})`).toBeLessThanOrEqual(6); + } + } + for (const id of SINGLE_PACKAGE_PANTRY) { + expect( + STARTER_RECIPES.some((recipe) => recipe.items.some((item) => item.id === id)), + id, + ).toBe(true); + } + }); }); diff --git a/src/domain/recipes/desserts-drinks.ts b/src/domain/recipes/desserts-drinks.ts index 68dd339..3b2a1ff 100644 --- a/src/domain/recipes/desserts-drinks.ts +++ b/src/domain/recipes/desserts-drinks.ts @@ -1,4 +1,4 @@ -import type { StarterRecipe } from "./types"; +import type { CompleteStarterRecipe } from "./types"; /** * Sweet things, drinks and brunch dishes. @@ -8,13 +8,30 @@ import type { StarterRecipe } from "./types"; * Keep the totals realistic at 10 people: about 1 dessert portion per person, * 2 drinks per person (12–16 oz each), and 2–3 pancakes per person. */ -export const dessertDrinkRecipes: StarterRecipe[] = [ +export const dessertDrinkRecipes: CompleteStarterRecipe[] = [ { id: "starter-smores", name: "S'mores", emoji: "🍫", category: "Desserts", defaultServingsPerPerson: 2, + description: "Toasted marshmallow and chocolate sandwiched in graham crackers.", + prepMinutes: 10, + cookMinutes: 5, + equipment: ["Campfire or grill", "Long roasting sticks", "Small tray"], + steps: [ + "Break the Chocolate bars into squares and set them out on a small tray.", + "Break each Graham crackers sheet in half to make two squares.", + "Toast the Marshmallows over medium coals for 30 to 60 seconds, turning often, until golden and soft.", + "Slide a hot marshmallow onto one graham square and lay a square broken from a Chocolate bars bar on top.", + "Cap with a second graham square and press gently for 10 seconds so the chocolate softens.", + "Repeat with the remaining pieces and serve while everything is still warm.", + ], + tips: [ + "Keep the Chocolate bars in the shade or a cooler; they melt fast on a sunny table.", + "Over a gas grill, use low heat and turn the marshmallows constantly so they don't catch fire.", + "Set out a board of graham squares, marshmallows and chocolate so guests can build their own.", + ], items: [ { id: "starter-smores-graham-crackers", @@ -54,6 +71,23 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🍉", category: "Desserts", defaultServingsPerPerson: 1, + description: "Juicy summer fruit tossed with lime and a drizzle of honey.", + prepMinutes: 20, + cookMinutes: 0, + equipment: ["Large bowl", "Chef's knife", "Cutting board", "Citrus juicer"], + steps: [ + "Cut the Watermelon into 1-inch cubes, discarding the rind and any seeds.", + "Hull and quarter the Strawberries and rinse the Blueberries under cold water.", + "Peel and slice the Bananas 1/2 inch thick, but add them last so they don't bruise.", + "Whisk the juice of 1 Lime with 1 tbsp Honey per 4 cups of fruit.", + "Fold the watermelon, strawberries and blueberries into the dressing with a rubber spatula, then chill for 30 minutes.", + "Fold in the Bananas and spoon the salad into bowls just before serving.", + ], + tips: [ + "Cut the melon and berries the morning of the party and keep them in separate containers.", + "Drain any juice that collects before serving so the salad doesn't turn soupy.", + "Swap the Honey for maple syrup to make the salad vegan.", + ], items: [ { id: "starter-fruit-salad-watermelon", @@ -71,7 +105,7 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🍓", perServing: 1 / 10, unit: "lb", - buyUnit: "pack", + buyUnit: "container", unitsPerBuy: 1, priceCents: 400, }, @@ -112,8 +146,8 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ perServing: 1 / 2, unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 32, - priceCents: 600, + unitsPerBuy: 24, + priceCents: 500, }, ], }, @@ -123,6 +157,23 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🍰", category: "Desserts", defaultServingsPerPerson: 1, + description: "Fudgy one-bowl brownies with a shiny crackly top.", + prepMinutes: 10, + cookMinutes: 30, + equipment: ["9x13 baking dish", "Large bowl", "Whisk", "Toothpick"], + steps: [ + "Heat the oven to 350°F and grease a 9x13 baking dish, or line it with parchment.", + "Whisk the Brownie mix, Eggs and melted Butter in a large bowl for about 40 strokes, until just combined with no dry streaks.", + "Spread the batter evenly in the prepared dish.", + "Bake for 25 to 30 minutes, until a toothpick inserted 2 inches from the edge comes out with a few moist crumbs.", + "Cool completely in the pan, about 1 hour, before cutting into 2-inch squares.", + "Cut with a plastic knife for clean edges and lift the squares out with a spatula.", + ], + tips: [ + "Pull the brownies while the center still looks slightly underdone; they set as they cool.", + "Bake a day ahead and store them covered at room temperature, then cut just before serving.", + "Use the Butter in place of the oil the box calls for and the brownies taste richer.", + ], items: [ { id: "starter-brownies-mix", @@ -150,9 +201,9 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🧈", perServing: 1 / 3, unit: "tbsp", - buyUnit: "pack", - unitsPerBuy: 32, - priceCents: 500, + buyUnit: "stick", + unitsPerBuy: 8, + priceCents: 150, }, ], }, @@ -162,20 +213,37 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🍋", category: "Drinks", defaultServingsPerPerson: 2, + description: "Fresh-squeezed lemonade with just the right sweet-tart balance.", + prepMinutes: 15, + cookMinutes: 0, + equipment: ["Large pitcher", "Citrus juicer", "Long spoon", "Cutting board"], + steps: [ + "Empty 1 can of Lemonade concentrate into a large pitcher and add 3 cans of cold water, then stir until the concentrate dissolves completely.", + "Roll each Lemon on the counter, cut it in half, and squeeze in 1 tbsp fresh juice per serving.", + "Stir in 2 tsp Sugar per serving until it dissolves, then taste and add more Sugar or lemon juice.", + "Chill for at least 1 hour, or pour the lemonade over Ice in glasses.", + "Float the remaining Lemon slices in the pitcher just before serving.", + "Keep the pitcher in the shade and top it up with Ice as it melts.", + ], + tips: [ + "Stir the Sugar into 1 cup of warm water first so it dissolves, then chill the syrup before mixing.", + "Freeze lemon slices in an ice cube tray so the drinks stay cold without watering down.", + "Swap half the water for sparkling water just before serving for a fizzy version.", + ], items: [ { id: "starter-lemonade-concentrate", name: "Lemonade concentrate", emoji: "🥤", - perServing: 9 / 4, + perServing: 12, unit: "oz", buyUnit: "can", - unitsPerBuy: 12, - priceCents: 300, + unitsPerBuy: 48, + priceCents: 150, }, { id: "starter-lemonade-lemons", - name: "Lemons", + name: "Lemon", emoji: "🍋", perServing: 1 / 4, unit: "lemon", @@ -190,8 +258,8 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ perServing: 1 / 16, unit: "cup", buyUnit: "bag", - unitsPerBuy: 16, - priceCents: 300, + unitsPerBuy: 4, + priceCents: 200, }, { id: "starter-lemonade-ice", @@ -211,6 +279,23 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🧊", category: "Drinks", defaultServingsPerPerson: 2, + description: "Smooth, lightly sweet iced tea with fresh lemon.", + prepMinutes: 10, + cookMinutes: 10, + equipment: ["Large pot", "Large pitcher", "Long spoon", "Fine-mesh strainer"], + steps: [ + "Bring 1 quart of water to a boil in a large pot for every Iced tea bag you plan to steep.", + "Remove the pot from the heat, add the Iced tea bags, cover, and steep for 5 minutes.", + "Lift out the bags without squeezing them, then stir in 2 tsp Sugar per cup of tea until it dissolves.", + "Let the tea cool for 15 minutes, then pour it into a pitcher and refrigerate for at least 1 hour.", + "Cut the Lemon into wedges and add half of them to the pitcher.", + "Fill glasses with Ice, pour the tea over, and garnish with the remaining lemon wedges.", + ], + tips: [ + "Don't steep longer than 5 minutes or the tea turns bitter and cloudy.", + "Make it the night before and keep the pitcher in the fridge so you don't need as much ice.", + "For unsweet tea, skip the Sugar and set a small bowl of it out for guests.", + ], items: [ { id: "starter-iced-tea-bags", @@ -224,7 +309,7 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ }, { id: "starter-iced-tea-lemons", - name: "Lemons", + name: "Lemon", emoji: "🍋", perServing: 1 / 4, unit: "lemon", @@ -239,8 +324,8 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ perServing: 1 / 16, unit: "cup", buyUnit: "bag", - unitsPerBuy: 16, - priceCents: 300, + unitsPerBuy: 4, + priceCents: 200, }, { id: "starter-iced-tea-ice", @@ -260,6 +345,24 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🥞", category: "Brunch", defaultServingsPerPerson: 1, + description: "Fluffy pancakes with blueberries and warm maple syrup.", + prepMinutes: 10, + cookMinutes: 20, + equipment: ["Large griddle", "Whisk", "Mixing bowl", "Ladle", "Spatula"], + steps: [ + "Whisk the Pancake mix, Eggs, Milk and melted Butter in a mixing bowl just until combined; a few small lumps are fine.", + "Rest the batter for 5 minutes while the griddle heats over medium, about 350°F.", + "Grease the griddle lightly and ladle 1/4 cup of batter per pancake.", + "Scatter a few Blueberries onto each pancake before the surface sets.", + "Cook for 2 to 3 minutes, until bubbles pop on top and the edges look dry, then flip and cook 1 to 2 minutes more.", + "Stack the finished pancakes on a sheet pan in a 200°F oven while you cook the rest.", + "Serve with the Butter and warmed Maple syrup.", + ], + tips: [ + "Overmixing makes pancakes tough, so stop stirring while streaks of mix still show.", + "The batter holds for 1 hour in the fridge; thin it with a splash of Milk if it thickens.", + "Freeze extra pancakes with parchment between them and reheat in the toaster.", + ], items: [ { id: "starter-pancakes-mix", @@ -287,9 +390,9 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🥛", perServing: 1 / 8, unit: "cup", - buyUnit: "gallon", - unitsPerBuy: 16, - priceCents: 400, + buyUnit: "quart", + unitsPerBuy: 4, + priceCents: 200, }, { id: "starter-pancakes-butter", @@ -297,9 +400,9 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🧈", perServing: 1 / 4, unit: "tbsp", - buyUnit: "pack", - unitsPerBuy: 32, - priceCents: 500, + buyUnit: "stick", + unitsPerBuy: 8, + priceCents: 150, }, { id: "starter-pancakes-syrup", @@ -329,6 +432,24 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🌯", category: "Brunch", defaultServingsPerPerson: 1.5, + description: "Egg, sausage and potato burritos with melted cheddar and salsa.", + prepMinutes: 15, + cookMinutes: 20, + equipment: ["Large skillet", "Large bowl", "Whisk", "Aluminum foil", "Instant-read thermometer"], + steps: [ + "Cook the Breakfast sausage in a large skillet over medium heat for 8 to 10 minutes, turning, until browned and 160°F inside.", + "Add the Hash browns to the same skillet and cook for 6 to 8 minutes, stirring, until golden and crisp.", + "Whisk the Eggs with a pinch of salt in a large bowl, then scramble them in a second skillet over low heat until just set but still glossy.", + "Warm the Flour tortillas in a dry pan for 20 seconds per side so they fold without cracking.", + "Layer eggs, sausage, hash browns, Shredded cheddar and Salsa down the center of each tortilla.", + "Fold in the sides, roll each burrito tightly, and wrap it in foil to keep it warm.", + "Serve with extra Salsa on the side.", + ], + tips: [ + "Let the fillings cool for 5 minutes before rolling so the tortillas don't tear.", + "Rolled burritos freeze well; reheat wrapped in foil at 350°F for 20 minutes.", + "Cook the eggs a little softer than you like them since they keep cooking in the wrap.", + ], items: [ { id: "starter-breakfast-burritos-tortillas", @@ -398,6 +519,23 @@ export const dessertDrinkRecipes: StarterRecipe[] = [ emoji: "🥯", category: "Brunch", defaultServingsPerPerson: 1.5, + description: "Bagels with cream cheese, smoked salmon, capers and fresh veg.", + prepMinutes: 20, + cookMinutes: 0, + equipment: ["Cutting board", "Serrated knife", "Serving platter", "Small bowls"], + steps: [ + "Slice the Bagels in half with a serrated knife and arrange them cut side up on a serving platter.", + "Spread each half with a thick layer of Cream cheese.", + "Separate the Smoked salmon into thin ribbons and drape it over half of the bagels.", + "Slice the Tomatoes and Cucumber into thin rounds and the Onion into paper-thin slices.", + "Scatter the Capers over the salmon and arrange the vegetables around the platter.", + "Let guests add their own toppings and finish with black pepper.", + ], + tips: [ + "Assemble the platter up to 30 minutes ahead and keep it covered in the fridge.", + "Keep the Cream cheese and salmon cold; set the platter over a tray of ice if it sits out in the sun.", + "Toast the bagels first if you like crunch, but the platter holds up better untoasted.", + ], items: [ { id: "starter-bagel-platter-bagels", diff --git a/src/domain/recipes/grill.ts b/src/domain/recipes/grill.ts index 35c70c2..0fdc861 100644 --- a/src/domain/recipes/grill.ts +++ b/src/domain/recipes/grill.ts @@ -1,4 +1,4 @@ -import type { StarterRecipe } from "./types"; +import type { CompleteStarterRecipe } from "./types"; /** * Grill and mains. Every amount is per serving of the dish; `defaultServingsPerPerson` @@ -7,13 +7,32 @@ import type { StarterRecipe } from "./types"; * Keep the totals realistic at 10 people: a main is usually 0.25–0.5 lb of raw protein * per person, and a starchy side is 0.3–0.5 lb per person. */ -export const grillRecipes: StarterRecipe[] = [ +export const grillRecipes: CompleteStarterRecipe[] = [ { id: "starter-burgers", name: "Burgers", emoji: "🍔", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Smash-style beef patties with melted cheese and sharp onion.", + prepMinutes: 15, + cookMinutes: 10, + equipment: ["Grill", "Instant-read thermometer", "Large mixing bowl", "Sheet pan"], + steps: [ + "Divide the Ground beef into loose portions of about 1/3 lb each and shape them into patties about 3/4 inch thick, pressing a shallow dimple into the center of each one so it cooks flat.", + "Season both sides of every patty with salt and pepper, then leave them on a Sheet pan at room temperature for 10 minutes while the grill heats.", + "Heat the grill to medium-high, about 450°F, and oil the grates with a folded paper towel held with tongs.", + "Grill the patties with the lid closed for 3 to 4 minutes per side, until the internal temperature reads 160°F on an instant-read thermometer.", + "Lay 1 slice from the Cheese slices pack on each patty for the last minute and close the lid until it melts.", + "Split the Burger buns and toast them cut side down on the grill for 30 to 60 seconds, until lightly golden.", + "Slice the Onion and Jalapeño thinly and set them out in small bowls.", + "Rest the patties for 2 minutes, then build each burger on a toasted bun with onion and jalapeño.", + ], + tips: [ + "Shape the patties up to a day ahead and stack them with parchment between; pull them out 15 minutes before grilling.", + "Keep raw beef and cooked burgers on separate plates, and never leave either sitting in direct sun.", + "For a crowd, grill in batches and hold finished patties in a 200°F oven in a single layer.", + ], items: [ { id: "starter-burgers-beef", @@ -73,6 +92,23 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🌭", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Classic grilled dogs with ketchup, mustard, relish and onion.", + prepMinutes: 5, + cookMinutes: 8, + equipment: ["Grill", "Tongs", "Small serving bowls"], + steps: [ + "Heat the grill to medium, about 375°F, and oil the grates lightly with a folded paper towel.", + "Grill the Hot dog sausages for 6 to 8 minutes, turning every 2 minutes, until browned all over and steaming hot.", + "Split the Hot dog buns and grill them cut side down for about 30 seconds, until just toasted.", + "Spoon the Ketchup, Yellow mustard and Relish into separate small bowls so guests can serve themselves.", + "Slice the Onion thin and add it to the topping line.", + "Set each sausage in a toasted bun and let guests finish with their own toppings.", + ], + tips: [ + "Grill the sausages an hour ahead and hold them in a covered pan at 150°F, then toast buns to order.", + "Set opened condiments in a cooler with ice if the table sits in direct sun.", + "Plant-based sausages grill the same way; give them their own tongs and spot on the grill.", + ], items: [ { id: "starter-hot-dogs-sausage", @@ -106,13 +142,13 @@ export const grillRecipes: StarterRecipe[] = [ }, { id: "starter-hot-dogs-mustard", - name: "Mustard", + name: "Yellow mustard", emoji: "🥫", - perServing: 1, - unit: "tsp", + perServing: 1 / 3, + unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 90, - priceCents: 250, + unitsPerBuy: 16, + priceCents: 200, }, { id: "starter-hot-dogs-relish", @@ -142,6 +178,24 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🍗", category: "Grill", defaultServingsPerPerson: 2, + description: "Lemon-garlic chicken thighs with smoky paprika and charred edges.", + prepMinutes: 20, + cookMinutes: 15, + equipment: ["Grill", "Instant-read thermometer", "Large bowl", "Tongs"], + steps: [ + "Mince the Garlic and stir it in a large bowl with the juice of 1 Lemon, 1 tbsp Olive oil per pound of chicken, and 1/2 tsp Paprika per pound until it forms a loose paste.", + "Pat the Chicken thighs (boneless) dry, add them to the bowl, and turn until every piece is coated; let them marinate for 20 minutes at room temperature.", + "Heat the grill to medium-high, about 425°F, and oil the grates well.", + "Grill the thighs smooth side down for 5 to 6 minutes, until they release easily and have dark grill marks.", + "Flip and cook 5 to 7 minutes more, until the thickest part reads 165°F on an instant-read thermometer.", + "Rest the chicken on a cutting board for 5 minutes, then slice against the grain.", + "Squeeze the remaining Lemon over the sliced chicken just before serving.", + ], + tips: [ + "The marinade can go in a zip-top bag in the fridge for up to 4 hours; don't leave it longer or the lemon starts to cure the meat.", + "Hold cooked thighs on a sheet pan in a 200°F oven for up to 30 minutes without drying out.", + "Boneless chicken breast works in place of thighs at the same 165°F, but pull it 2 minutes sooner.", + ], items: [ { id: "starter-chicken-thighs-chicken", @@ -180,8 +234,8 @@ export const grillRecipes: StarterRecipe[] = [ perServing: 1 / 2, unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 64, - priceCents: 800, + unitsPerBuy: 33, + priceCents: 550, }, { id: "starter-chicken-thighs-paprika", @@ -190,8 +244,8 @@ export const grillRecipes: StarterRecipe[] = [ perServing: 1 / 4, unit: "tsp", buyUnit: "jar", - unitsPerBuy: 48, - priceCents: 400, + unitsPerBuy: 24, + priceCents: 300, }, ], }, @@ -201,6 +255,23 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🌭", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Grilled brats piled with tangy sauerkraut, mustard and sweet onion.", + prepMinutes: 10, + cookMinutes: 20, + equipment: ["Grill", "Large pot", "Tongs", "Instant-read thermometer"], + steps: [ + "Heat the grill to medium, about 375°F, while you simmer the sausages.", + "Put the Bratwurst in a large pot, cover them with water, and simmer over medium heat for 8 to 10 minutes, until firm and heated through.", + "Transfer the brats to the grill and cook 6 to 8 minutes, turning every 2 minutes, until browned and 160°F inside.", + "Warm the Sauerkraut in a small pot over low heat for 5 minutes, then drain off the extra liquid.", + "Split the Hot dog buns and toast them cut side down on the grill for 30 seconds.", + "Slice the Onion thin, then set out the brats with buns, sauerkraut, onion and Yellow mustard.", + ], + tips: [ + "Simmer the brats the day before, chill them, and finish on the grill to order so they never sit dry.", + "A slow cooker on low keeps sauerkraut warm for hours without scorching it.", + "Vegetarian brats can be simmered and grilled the same way; cook them to 165°F.", + ], items: [ { id: "starter-bratwurst-sausage", @@ -234,13 +305,13 @@ export const grillRecipes: StarterRecipe[] = [ }, { id: "starter-bratwurst-mustard", - name: "Mustard", + name: "Yellow mustard", emoji: "🥫", - perServing: 1, - unit: "tsp", + perServing: 1 / 3, + unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 90, - priceCents: 250, + unitsPerBuy: 16, + priceCents: 200, }, { id: "starter-bratwurst-onion", @@ -260,6 +331,23 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🍔", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Grilled veggie patties with avocado, tomato and melted cheese.", + prepMinutes: 15, + cookMinutes: 10, + equipment: ["Grill", "Wide spatula", "Sheet pan", "Instant-read thermometer"], + steps: [ + "Heat the grill to medium, about 375°F, and brush the grates with oil so the patties don't stick.", + "Grill the Veggie burger patties for 4 to 5 minutes per side, until heated through to 165°F and marked with grill lines.", + "Lay 1 slice from the Cheese slices pack on each patty in the last minute and close the lid so it melts.", + "Split the Burger buns and toast them cut side down for 30 to 60 seconds, until golden.", + "Separate the Lettuce into leaves, slice the Tomatoes, and slice the Avocado.", + "Build each burger with lettuce on the bottom bun, then a patty, tomato and avocado.", + ], + tips: [ + "Veggie patties are fragile, so use a wide spatula and turn them only once.", + "Slice the avocado last and press plastic wrap onto the cut surface so it doesn't brown.", + "For a vegan burger, skip the cheese or use a dairy-free slice and check the patty label.", + ], items: [ { id: "starter-veggie-burgers-patties", @@ -329,6 +417,24 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🐟", category: "Grill", defaultServingsPerPerson: 1, + description: "Buttery grilled salmon with lemon, dill and charred asparagus.", + prepMinutes: 15, + cookMinutes: 12, + equipment: ["Grill", "Instant-read thermometer", "Fish spatula", "Small saucepan"], + steps: [ + "Heat the grill to medium-high, about 400°F, and oil the grates well.", + "Melt the Butter in a small saucepan over low heat with the minced Garlic and chopped Dill, then keep it warm.", + "Pat the Salmon fillet dry, cut it into portions about 6 oz each, and season both sides with salt and pepper.", + "Grill the salmon skin side down for 5 to 7 minutes without moving it, until the skin releases cleanly from the grates.", + "Turn the fillets and cook 2 to 3 minutes more, until the center is opaque and reads 145°F on an instant-read thermometer.", + "Grill the Asparagus alongside the salmon for 4 to 6 minutes, turning once, until just tender and lightly charred.", + "Serve each portion with a squeeze of Lemon and a spoonful of the warm dill butter.", + ], + tips: [ + "Salmon carries over, so pull it at 145°F and let it rest 3 minutes before serving.", + "Salmon is good at room temperature; grill it up to 30 minutes ahead and keep it covered away from the sun.", + "Lay a sheet of foil on the grates for very thin fillets that might fall through.", + ], items: [ { id: "starter-grilled-salmon-fillet", @@ -356,9 +462,9 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🧈", perServing: 1 / 2, unit: "tbsp", - buyUnit: "pack", - unitsPerBuy: 32, - priceCents: 500, + buyUnit: "stick", + unitsPerBuy: 8, + priceCents: 150, }, { id: "starter-grilled-salmon-garlic", @@ -398,6 +504,24 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🍢", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Marinated sirloin skewers with peppers, onion and mushrooms.", + prepMinutes: 25, + cookMinutes: 10, + equipment: ["Grill", "Wooden skewers", "Large bowl", "Instant-read thermometer"], + steps: [ + "Soak the wooden skewers in water for 20 minutes so they don't burn over the fire.", + "Whisk the minced Garlic, 1 tbsp Olive oil per pound of steak, 1/2 tsp salt and 1/4 tsp pepper in a large bowl.", + "Cut the Sirloin steak into 1-inch cubes, add them to the bowl, and toss to coat; marinate for 20 minutes.", + "Cut the Bell pepper and Onion into 1-inch pieces and halve the Mushrooms.", + "Thread steak and vegetables onto the skewers, alternating them and leaving a small gap between pieces so they cook evenly.", + "Grill over medium-high heat, about 425°F, for 8 to 10 minutes, turning every 2 to 3 minutes, until the beef reads 145°F for medium-rare.", + "Rest the skewers on a platter for 5 minutes before serving.", + ], + tips: [ + "Don't crowd the skewers; a packed skewer steams instead of browning.", + "For medium, cook to 150°F, and pull them by 160°F before the meat turns dry.", + "Metal skewers skip the soaking step but get hot, so hand them out with a folded towel.", + ], items: [ { id: "starter-steak-skewers-steak", @@ -446,8 +570,8 @@ export const grillRecipes: StarterRecipe[] = [ perServing: 1 / 2, unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 64, - priceCents: 800, + unitsPerBuy: 33, + priceCents: 550, }, { id: "starter-steak-skewers-garlic", @@ -467,6 +591,24 @@ export const grillRecipes: StarterRecipe[] = [ emoji: "🍖", category: "Grill", defaultServingsPerPerson: 1.5, + description: "Slow-cooked pork shoulder piled on buns with cool slaw and pickles.", + prepMinutes: 20, + cookMinutes: 300, + equipment: ["Dutch oven", "Two forks", "Instant-read thermometer", "Rimmed baking sheet"], + steps: [ + "Heat the oven to 300°F and cut the Pork shoulder into 4 equal chunks, then season all over with 1 tsp salt per pound.", + "Sear the pork in a Dutch oven over medium-high heat for 3 to 4 minutes per side, until deeply browned.", + "Add 1/2 cup water per 3 lb of pork, cover tightly, and cook in the oven for 4 to 5 hours, until the meat shreds with no resistance and reads at least 200°F.", + "Shred the pork with two forks, discard the large pieces of fat, and toss the meat with the BBQ sauce.", + "Toss the Coleslaw mix with the Mayonnaise and a pinch of salt, then refrigerate it until serving.", + "Split the Burger buns and warm them on a sheet pan in the oven for 5 minutes.", + "Pile pork onto each bun and top with slaw and Pickles.", + ], + tips: [ + "Shredded pork holds for 2 hours in a 200°F oven with a splash of water, so it's a safe make-ahead main.", + "Sauce half the pork and leave the rest plain so guests can choose.", + "Keep the slaw in a cooler or over ice; mayonnaise-based salads shouldn't sit in the sun.", + ], items: [ { id: "starter-pulled-pork-pork", @@ -510,13 +652,13 @@ export const grillRecipes: StarterRecipe[] = [ }, { id: "starter-pulled-pork-mayo", - name: "Mayo", + name: "Mayonnaise", emoji: "🫙", perServing: 1 / 2, unit: "tbsp", buyUnit: "jar", - unitsPerBuy: 60, - priceCents: 400, + unitsPerBuy: 30, + priceCents: 250, }, { id: "starter-pulled-pork-pickles", diff --git a/src/domain/recipes/groups.test.ts b/src/domain/recipes/groups.test.ts index e5ccf8e..71a8d96 100644 --- a/src/domain/recipes/groups.test.ts +++ b/src/domain/recipes/groups.test.ts @@ -4,7 +4,7 @@ import { grillRecipes } from "./grill"; import { handheldRecipes } from "./handhelds"; import { sideRecipes } from "./sides"; import { dessertDrinkRecipes } from "./desserts-drinks"; -import type { StarterRecipe } from "./types"; +import type { CompleteStarterRecipe } from "./types"; /** * Per-recipe checks that any one group can run on its own, before every group is filled. @@ -14,7 +14,10 @@ const MAX_ITEM_AMOUNT = 50; const MAX_BUY_UNITS = 500; const MAX_PRICE_CENTS = 10_000; -const GROUPS: Record = { +/** Any pictograph (emoji, dingbat, symbol) that has no place in a cooking instruction. */ +const EMOJI = /\p{Extended_Pictographic}/u; + +const GROUPS: Record = { grill: grillRecipes, handhelds: handheldRecipes, sides: sideRecipes, @@ -63,6 +66,36 @@ describe("recipe groups", () => { } }); + it("ships instructions a first-time cook can follow", () => { + for (const recipe of recipes) { + const where = recipe.id; + expect(recipe.description.trim().length, where).toBeGreaterThan(20); + expect(recipe.description.length, where).toBeLessThan(90); + expect(Number.isInteger(recipe.prepMinutes), where).toBe(true); + expect(recipe.prepMinutes, where).toBeGreaterThanOrEqual(0); + expect(Number.isInteger(recipe.cookMinutes), where).toBe(true); + expect(recipe.cookMinutes, where).toBeGreaterThanOrEqual(0); + expect(recipe.steps.length, where).toBeGreaterThanOrEqual(5); + expect(recipe.steps.length, where).toBeLessThanOrEqual(10); + expect(recipe.tips.length, where).toBeGreaterThanOrEqual(2); + expect(recipe.tips.length, where).toBeLessThanOrEqual(4); + expect(recipe.equipment.length, where).toBeGreaterThanOrEqual(2); + expect(recipe.equipment.length, where).toBeLessThanOrEqual(6); + + for (const step of recipe.steps) { + expect(step.trim().length, where).toBeGreaterThan(20); + expect(EMOJI.test(step), `${where}: ${step}`).toBe(false); + } + for (const tip of recipe.tips) { + expect(tip.trim().length, where).toBeGreaterThan(10); + expect(EMOJI.test(tip), `${where}: ${tip}`).toBe(false); + } + for (const tool of recipe.equipment) { + expect(tool.trim().length, where).toBeGreaterThan(1); + } + } + }); + it("scales cleanly to a shopping list for any headcount", () => { for (const people of [1, 4, 10, 25]) { for (const recipe of recipes) { diff --git a/src/domain/recipes/handhelds.ts b/src/domain/recipes/handhelds.ts index 7393929..6886841 100644 --- a/src/domain/recipes/handhelds.ts +++ b/src/domain/recipes/handhelds.ts @@ -1,4 +1,4 @@ -import type { StarterRecipe } from "./types"; +import type { CompleteStarterRecipe } from "./types"; /** * Tacos, sliders, gyros and other food you eat with your hands. @@ -8,13 +8,30 @@ import type { StarterRecipe } from "./types"; * Keep the totals realistic at 10 people: 0.2–0.4 lb of raw protein per person, * 2–3 tortillas per person for a taco bar, and enough toppings for every portion. */ -export const handheldRecipes: StarterRecipe[] = [ +export const handheldRecipes: CompleteStarterRecipe[] = [ { id: "starter-beef-tacos", name: "Beef taco bar", emoji: "🌮", category: "Tacos & handhelds", defaultServingsPerPerson: 3, + description: "Build-your-own tacos with seasoned beef, crunchy lettuce and lime.", + prepMinutes: 15, + cookMinutes: 10, + equipment: ["Large skillet", "Wooden spoon", "Small serving bowls", "Instant-read thermometer"], + steps: [ + "Heat a large skillet over medium-high heat, add the Ground beef, and cook for 6 to 8 minutes, breaking it into small crumbles with a spoon, until no pink remains and it reads 160°F.", + "Stir in the Taco seasoning plus 1/4 cup water per pound of beef and simmer for 2 to 3 minutes, until the liquid thickens and coats the meat.", + "Warm the Corn tortillas in a dry skillet for 20 to 30 seconds per side, then stack them in a clean towel so they stay soft.", + "Shred the Lettuce, dice the Tomatoes, and cut the Lime into wedges.", + "Spoon the Shredded Mexican cheese, Sour cream and Salsa into separate bowls.", + "Set everything out in a line, meat first, so guests can build their own tacos.", + ], + tips: [ + "Keep the beef warm in a slow cooker on low, and add a splash of water if it starts to look dry.", + "Set the cheese, sour cream and lettuce over a bowl of ice if the table is in the sun.", + "Ground turkey works in place of beef; cook it to 165°F.", + ], items: [ { id: "starter-beef-tacos-beef", @@ -114,6 +131,25 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🌯", category: "Tacos & handhelds", defaultServingsPerPerson: 2.5, + description: "Sizzling chicken, peppers and onions in warm flour tortillas.", + prepMinutes: 20, + cookMinutes: 12, + equipment: ["Large skillet", "Tongs", "Instant-read thermometer", "Large bowl"], + steps: [ + "Slice the Chicken breast, Bell pepper and Onion into strips about 1/4 inch thick.", + "Toss the chicken with 1 tbsp Olive oil per pound, 1/2 tsp salt and 1/4 tsp pepper, and let it sit for 10 minutes.", + "Heat a large skillet over medium-high until a drop of water sizzles, then add the chicken in a single layer.", + "Cook the chicken for 4 to 5 minutes, turning once, until browned and 165°F inside, then move it to a plate.", + "Add the peppers and onion to the same pan and cook 4 to 5 minutes, until softened with browned edges.", + "Return the chicken to the pan and squeeze half of a Lime over the top.", + "Warm the Flour tortillas in the pan for 20 seconds per side and stack them under a towel.", + "Serve with the Sour cream and the remaining Lime cut into wedges.", + ], + tips: [ + "Cook the chicken in two batches so it browns instead of steaming.", + "Slice the chicken and peppers the night before and refrigerate them in separate bags.", + "Swap the chicken for the same weight of large shrimp and cook just 1 to 2 minutes per side, to 145°F.", + ], items: [ { id: "starter-chicken-fajitas-chicken", @@ -162,8 +198,8 @@ export const handheldRecipes: StarterRecipe[] = [ perServing: 1 / 4, unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 64, - priceCents: 800, + unitsPerBuy: 33, + priceCents: 550, }, { id: "starter-chicken-fajitas-sour-cream", @@ -193,6 +229,24 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🍔", category: "Tacos & handhelds", defaultServingsPerPerson: 2.5, + description: "Tender BBQ pork and crunchy slaw on soft slider buns.", + prepMinutes: 20, + cookMinutes: 300, + equipment: ["Dutch oven", "Two forks", "Instant-read thermometer", "Rimmed baking sheet"], + steps: [ + "Heat the oven to 300°F, cut the Pork shoulder into 4 chunks, and season all over with 1 tsp salt per pound.", + "Sear the pork in a Dutch oven over medium-high heat for 3 to 4 minutes per side, until browned all over.", + "Add 1/2 cup water per 3 lb of pork, cover, and cook in the oven for 4 to 5 hours, until the meat pulls apart easily and reads 200°F.", + "Shred the pork with two forks and toss it with the BBQ sauce.", + "Toss the Coleslaw mix with a pinch of salt and let it sit for 10 minutes so the cabbage softens slightly.", + "Split the Slider buns and warm them on a baking sheet for 5 minutes in the oven.", + "Fill each bun with pork, a spoonful of slaw and a Pickles slice.", + ], + tips: [ + "The pork can be cooked and shredded a day ahead; reheat it gently with 2 tbsp water per pound.", + "Keep the slaw cold and undressed until the last minute so the buns don't go soggy.", + "Slider buns dry out fast, so warm them right before the party starts.", + ], items: [ { id: "starter-pork-sliders-pork", @@ -252,6 +306,23 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🥙", category: "Tacos & handhelds", defaultServingsPerPerson: 1.5, + description: "Garlicky chicken in warm pita with cool cucumber-yogurt sauce.", + prepMinutes: 25, + cookMinutes: 15, + equipment: ["Grill or grill pan", "Instant-read thermometer", "Box grater", "Small bowl"], + steps: [ + "Grate the Cucumber on the large holes of a box grater, squeeze the shreds dry in a clean towel, and stir them into the Greek yogurt with 1 minced Garlic clove and a pinch of salt.", + "Slice the Chicken thighs (boneless) into 1-inch strips and toss them with the remaining Garlic, 1/2 tsp salt and 1/4 tsp pepper per pound.", + "Heat the grill or grill pan to medium-high, then cook the chicken for 5 to 6 minutes per side, until browned and 165°F inside.", + "Slice the Tomatoes and Onion thin and crumble the Feta.", + "Warm the Pita bread for 20 seconds per side in a dry pan, then wrap the stack in a towel.", + "Fill each pita with chicken, tomato, onion, feta and a spoonful of the yogurt sauce.", + ], + tips: [ + "The yogurt sauce keeps for 3 days in the fridge, so make it the night before.", + "Grilled chicken can be served warm or at room temperature; hold it covered for up to 30 minutes.", + "For a vegetarian version, replace the chicken with chickpeas tossed in the same garlic and salt.", + ], items: [ { id: "starter-gyros-chicken", @@ -341,6 +412,24 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🧆", category: "Tacos & handhelds", defaultServingsPerPerson: 1.5, + description: "Crispy chickpea patties stuffed into pita with tahini and crunch.", + prepMinutes: 30, + cookMinutes: 15, + equipment: ["Food processor", "Large bowl", "Heavy skillet", "Slotted spoon"], + steps: [ + "Drain and rinse the Chickpeas, then pulse them in a food processor with the Garlic, Parsley, Cumin, Flour and 1/2 tsp salt until the mixture holds together when squeezed, about 30 seconds.", + "Chill the mixture for 15 minutes so it firms up, then shape it into patties about 2 inches wide and 1/2 inch thick.", + "Heat 1 inch of neutral oil in a heavy skillet to 350°F.", + "Fry the patties in batches for 3 to 4 minutes per side, until deep golden and crisp, then drain them on paper towels.", + "Whisk the Tahini with the juice of 1 Lemon and 1 tbsp water per 1/4 cup tahini until the sauce pours easily.", + "Slice the Cucumber, Tomatoes and Onion thin.", + "Warm the Pita bread and fill each one with 2 or 3 falafel, the vegetables and a spoonful of tahini sauce.", + ], + tips: [ + "Fried falafel stays crisp for about an hour; reheat it at 400°F for 8 minutes if you fry ahead.", + "To skip the oil, bake the patties at 400°F for 20 minutes, flipping once, until firm and browned.", + "Pat the chickpeas very dry before processing, or the mixture turns wet and the patties fall apart.", + ], items: [ { id: "starter-falafel-pitas-chickpeas", @@ -406,7 +495,7 @@ export const handheldRecipes: StarterRecipe[] = [ id: "starter-falafel-pitas-garlic", name: "Garlic", emoji: "🧄", - perServing: 0.5, + perServing: 1 / 2, unit: "clove", buyUnit: "head", unitsPerBuy: 10, @@ -416,10 +505,10 @@ export const handheldRecipes: StarterRecipe[] = [ id: "starter-falafel-pitas-cumin", name: "Cumin", emoji: "🌿", - perServing: 0.25, + perServing: 1 / 3, unit: "tsp", buyUnit: "jar", - unitsPerBuy: 48, + unitsPerBuy: 24, priceCents: 300, }, { @@ -429,8 +518,8 @@ export const handheldRecipes: StarterRecipe[] = [ perServing: 0.02, unit: "cup", buyUnit: "bag", - unitsPerBuy: 20, - priceCents: 300, + unitsPerBuy: 18, + priceCents: 350, }, { id: "starter-falafel-pitas-parsley", @@ -438,7 +527,7 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🌿", perServing: 0.1, unit: "bunch", - buyUnit: "each", + buyUnit: "bunch", unitsPerBuy: 1, priceCents: 100, }, @@ -460,6 +549,23 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🍤", category: "Tacos & handhelds", defaultServingsPerPerson: 3, + description: "Chili-lime shrimp tacos with crunchy cabbage and cool crema.", + prepMinutes: 15, + cookMinutes: 6, + equipment: ["Large skillet", "Tongs", "Small bowl", "Instant-read thermometer"], + steps: [ + "Pat the Shrimp (raw, peeled) dry and toss them with the juice of 1 Lime, 1/2 tsp salt and 1/4 tsp pepper per pound.", + "Stir the Sour cream with the juice of half a Lime and a pinch of salt to make a quick crema.", + "Shred the Cabbage very thin and chop the Cilantro.", + "Heat a large skillet over medium-high heat until a drop of water sizzles.", + "Cook the shrimp in a single layer for 1 to 2 minutes per side, until pink, opaque and 145°F on an instant-read thermometer.", + "Warm the Corn tortillas and fill them with shrimp, cabbage, cilantro, crema and sliced Avocado.", + ], + tips: [ + "Shrimp turn rubbery fast, so pull them as soon as they curl into a loose C.", + "Keep the crema in the cooler until serving, and set the avocado out last.", + "Thaw frozen shrimp overnight in the fridge, never on the counter.", + ], items: [ { id: "starter-shrimp-tacos-shrimp", @@ -468,8 +574,8 @@ export const handheldRecipes: StarterRecipe[] = [ perServing: 0.1, unit: "lb", buyUnit: "bag", - unitsPerBuy: 1, - priceCents: 900, + unitsPerBuy: 2, + priceCents: 1400, }, { id: "starter-shrimp-tacos-tortillas", @@ -507,7 +613,7 @@ export const handheldRecipes: StarterRecipe[] = [ emoji: "🌿", perServing: 1 / 16, unit: "bunch", - buyUnit: "each", + buyUnit: "bunch", unitsPerBuy: 1, priceCents: 100, }, diff --git a/src/domain/recipes/index.ts b/src/domain/recipes/index.ts index da3e194..6e4b764 100644 --- a/src/domain/recipes/index.ts +++ b/src/domain/recipes/index.ts @@ -2,12 +2,18 @@ import { dessertDrinkRecipes } from "./desserts-drinks"; import { grillRecipes } from "./grill"; import { handheldRecipes } from "./handhelds"; import { sideRecipes } from "./sides"; -import type { Recipe, StarterRecipe } from "./types"; +import type { CompleteStarterRecipe, Recipe } from "./types"; -export type { Recipe, RecipeCategory, RecipeItem, StarterRecipe } from "./types"; +export type { + CompleteStarterRecipe, + Recipe, + RecipeCategory, + RecipeItem, + StarterRecipe, +} from "./types"; /** Every built-in recipe, in picker order. */ -export const STARTER_RECIPES: StarterRecipe[] = [ +export const STARTER_RECIPES: CompleteStarterRecipe[] = [ ...grillRecipes, ...handheldRecipes, ...sideRecipes, diff --git a/src/domain/recipes/sides.ts b/src/domain/recipes/sides.ts index 1f4dae8..50cca39 100644 --- a/src/domain/recipes/sides.ts +++ b/src/domain/recipes/sides.ts @@ -1,4 +1,4 @@ -import type { StarterRecipe } from "./types"; +import type { CompleteStarterRecipe } from "./types"; /** * Side dishes and salads that round out a cookout. @@ -8,13 +8,31 @@ import type { StarterRecipe } from "./types"; * Keep the totals realistic at 10 people: 0.3–0.5 lb of potato or pasta per person, * about 1 cup of salad per person, and one ear of corn per person. */ -export const sideRecipes: StarterRecipe[] = [ +export const sideRecipes: CompleteStarterRecipe[] = [ { id: "starter-potato-salad", name: "Classic potato salad", emoji: "🥔", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Creamy mustard potato salad with celery, egg and sweet relish.", + prepMinutes: 20, + cookMinutes: 20, + equipment: ["Large pot", "Small pot", "Colander", "Large bowl", "Rimmed baking sheet"], + steps: [ + "Scrub the Potatoes and cut them into 1-inch chunks, then put them in a large pot and cover with cold water by 1 inch.", + "Add 1 tsp salt per quart of water, bring to a boil, and simmer for 10 to 12 minutes, until a knife slides in with no resistance.", + "Drain the potatoes in a colander and spread them on a rimmed baking sheet for 10 minutes to steam dry.", + "Put the Eggs in a small pot, cover with cold water, bring to a boil, then turn off the heat and let them stand for 10 minutes before cooling in ice water and peeling.", + "Whisk the Mayonnaise, Yellow mustard, Relish, 1/2 tsp salt and 1/4 tsp pepper in a large bowl.", + "Fold in the warm potatoes, sliced Celery, diced Onion and chopped Eggs, then refrigerate for at least 1 hour.", + "Taste and stir in more Yellow mustard or salt just before serving.", + ], + tips: [ + "Dress the potatoes while they are still warm so they soak up more flavor.", + "Keep the bowl below 40°F at the party by nesting it in a larger bowl of ice.", + "Swap half the Mayonnaise for Greek yogurt for a lighter salad that still tastes rich.", + ], items: [ { id: "starter-potato-salad-potatoes", @@ -28,13 +46,13 @@ export const sideRecipes: StarterRecipe[] = [ }, { id: "starter-potato-salad-mayo", - name: "Mayo", + name: "Mayonnaise", emoji: "🫙", perServing: 1.5, unit: "tbsp", buyUnit: "jar", - unitsPerBuy: 60, - priceCents: 400, + unitsPerBuy: 30, + priceCents: 250, }, { id: "starter-potato-salad-celery", @@ -58,13 +76,13 @@ export const sideRecipes: StarterRecipe[] = [ }, { id: "starter-potato-salad-mustard", - name: "Mustard", + name: "Yellow mustard", emoji: "🟡", - perServing: 0.5, - unit: "tsp", + perServing: 1 / 3, + unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 90, - priceCents: 250, + unitsPerBuy: 16, + priceCents: 200, }, { id: "starter-potato-salad-eggs", @@ -80,7 +98,7 @@ export const sideRecipes: StarterRecipe[] = [ id: "starter-potato-salad-relish", name: "Relish", emoji: "🥒", - perServing: 1 / 4, + perServing: 1 / 2, unit: "tbsp", buyUnit: "jar", unitsPerBuy: 30, @@ -94,6 +112,22 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🥬", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Cool, crunchy cabbage slaw in a tangy creamy dressing.", + prepMinutes: 15, + cookMinutes: 0, + equipment: ["Large bowl", "Whisk", "Box grater"], + steps: [ + "Whisk 1 tbsp Mayonnaise, 1 tsp Sugar, 1 tsp White vinegar and a pinch of salt per cup of Coleslaw mix in a large bowl.", + "Grate the Carrot on the large holes of a box grater.", + "Add the Coleslaw mix and Carrot to the dressing and toss for 30 seconds, until every strand is coated.", + "Refrigerate for at least 30 minutes so the cabbage softens slightly.", + "Toss again right before serving and add salt to taste.", + ], + tips: [ + "The slaw keeps for 2 days in the fridge and actually improves overnight.", + "Dress only what you plan to serve and keep the rest of the bag dry for a refill.", + "Celery seed or a spoonful of Dijon mustard is an easy flavor upgrade.", + ], items: [ { id: "starter-coleslaw-cabbage", @@ -107,13 +141,13 @@ export const sideRecipes: StarterRecipe[] = [ }, { id: "starter-coleslaw-mayo", - name: "Mayo", + name: "Mayonnaise", emoji: "🫙", perServing: 1.75, unit: "tbsp", buyUnit: "jar", - unitsPerBuy: 60, - priceCents: 400, + unitsPerBuy: 30, + priceCents: 250, }, { id: "starter-coleslaw-sugar", @@ -122,17 +156,17 @@ export const sideRecipes: StarterRecipe[] = [ perServing: 1 / 48, unit: "cup", buyUnit: "bag", - unitsPerBuy: 16, - priceCents: 300, + unitsPerBuy: 4, + priceCents: 200, }, { id: "starter-coleslaw-vinegar", name: "White vinegar", emoji: "🧴", - perServing: 1 / 2, + perServing: 1, unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 64, + unitsPerBuy: 32, priceCents: 200, }, { @@ -141,9 +175,9 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🥕", perServing: 1 / 10, unit: "each", - buyUnit: "bag", - unitsPerBuy: 10, - priceCents: 150, + buyUnit: "each", + unitsPerBuy: 1, + priceCents: 25, }, ], }, @@ -153,6 +187,25 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🧀", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Baked mac and cheese with a crisp golden breadcrumb top.", + prepMinutes: 15, + cookMinutes: 45, + equipment: ["Large pot", "9x13 baking dish", "Whisk", "Colander", "Small saucepan"], + steps: [ + "Heat the oven to 375°F and grease a 9x13 baking dish with a little of the Butter.", + "Boil the Macaroni in well-salted water for 2 minutes less than the package says, then drain it in a colander.", + "Melt the Butter in a small saucepan over medium heat, whisk in the Flour, and cook for 1 minute until it smells toasty.", + "Pour in the Milk in a steady stream, whisking constantly, and simmer for 3 to 4 minutes, until thick enough to coat the back of a spoon.", + "Off the heat, stir in the Shredded cheddar one handful at a time until smooth, then season with salt and pepper.", + "Fold the macaroni into the cheese sauce and scrape everything into the baking dish.", + "Toss the Bread crumbs with 1 tbsp melted Butter and scatter them over the top.", + "Bake for 20 to 25 minutes, until bubbling at the edges and golden brown on top.", + ], + tips: [ + "Grate the cheddar yourself; pre-shredded cheese is coated and gives a grainy sauce.", + "Assemble the dish up to a day ahead, refrigerate it, and add 10 minutes to the bake time.", + "Reheat leftovers with a splash of Milk so the sauce loosens again.", + ], items: [ { id: "starter-mac-and-cheese-macaroni", @@ -180,9 +233,9 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🥛", perServing: 3 / 10, unit: "cup", - buyUnit: "gallon", - unitsPerBuy: 16, - priceCents: 400, + buyUnit: "quart", + unitsPerBuy: 4, + priceCents: 200, }, { id: "starter-mac-and-cheese-butter", @@ -190,9 +243,9 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🧈", perServing: 1 / 5, unit: "tbsp", - buyUnit: "pack", - unitsPerBuy: 32, - priceCents: 500, + buyUnit: "stick", + unitsPerBuy: 8, + priceCents: 150, }, { id: "starter-mac-and-cheese-flour", @@ -201,14 +254,14 @@ export const sideRecipes: StarterRecipe[] = [ perServing: 1 / 50, unit: "cup", buyUnit: "bag", - unitsPerBuy: 20, - priceCents: 300, + unitsPerBuy: 18, + priceCents: 350, }, { id: "starter-mac-and-cheese-bread-crumbs", name: "Bread crumbs", emoji: "🍞", - perServing: 1 / 24, + perServing: 1 / 12, unit: "cup", buyUnit: "canister", unitsPerBuy: 4, @@ -222,6 +275,23 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🌽", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Sweet grilled corn rolled in seasoned butter.", + prepMinutes: 10, + cookMinutes: 12, + equipment: ["Grill", "Tongs", "Small bowl", "Pastry brush"], + steps: [ + "Heat the grill to medium-high, about 400°F.", + "Shuck the Corn and pull off every strand of silk.", + "Mash the Butter with the Salt-free seasoning blend and a pinch of salt in a small bowl.", + "Grill the ears for 10 to 12 minutes, turning every 3 minutes, until the kernels are tender and spotted brown.", + "Brush each ear generously with the seasoned butter while it is still hot.", + "Sprinkle with more seasoning and serve right away.", + ], + tips: [ + "Grill the corn up to 30 minutes ahead and keep it wrapped in foil in a cooler.", + "No grill? Boil shucked ears for 4 minutes, then butter them the same way.", + "Stand the cooked ears on their ends and slice off the kernels for kids or for a salad.", + ], items: [ { id: "starter-corn-on-the-cob-corn", @@ -239,19 +309,19 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🧈", perServing: 1 / 2, unit: "tbsp", - buyUnit: "pack", - unitsPerBuy: 32, - priceCents: 500, + buyUnit: "stick", + unitsPerBuy: 8, + priceCents: 150, }, { id: "starter-corn-on-the-cob-seasoning", name: "Salt-free seasoning blend", emoji: "🌿", - perServing: 1 / 4, + perServing: 1 / 2, unit: "tsp", buyUnit: "jar", - unitsPerBuy: 40, - priceCents: 350, + unitsPerBuy: 16, + priceCents: 300, }, ], }, @@ -261,6 +331,23 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🫘", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Smoky baked beans simmered with bacon, onion and brown sugar.", + prepMinutes: 10, + cookMinutes: 45, + equipment: ["Large pot", "Wooden spoon", "Chef's knife", "Cutting board"], + steps: [ + "Cook the Bacon in a large pot over medium heat for 5 to 7 minutes, until crisp, then move it to paper towels.", + "Add the diced Onion to the bacon fat and cook for 4 to 5 minutes, until soft and translucent.", + "Stir in the Baked beans, Brown sugar and Yellow mustard, then crumble the bacon back into the pot.", + "Simmer over low heat for 20 to 30 minutes, stirring every 5 minutes, until thick and bubbling at the edges.", + "Taste and adjust with salt and a little more Yellow mustard.", + "Keep warm on the lowest heat until serving.", + ], + tips: [ + "Make the beans a day ahead and reheat them slowly; the flavor gets deeper overnight.", + "A slow cooker on warm holds them for hours without scorching the bottom.", + "Skip the bacon and add 1 tsp smoked paprika for a vegetarian pot.", + ], items: [ { id: "starter-baked-beans-beans", @@ -296,21 +383,21 @@ export const sideRecipes: StarterRecipe[] = [ id: "starter-baked-beans-brown-sugar", name: "Brown sugar", emoji: "🍬", - perServing: 1 / 32, + perServing: 1 / 16, unit: "cup", buyUnit: "bag", - unitsPerBuy: 16, - priceCents: 300, + unitsPerBuy: 2, + priceCents: 250, }, { id: "starter-baked-beans-mustard", - name: "Mustard", + name: "Yellow mustard", emoji: "🟡", - perServing: 1 / 2, - unit: "tsp", + perServing: 1 / 3, + unit: "tbsp", buyUnit: "bottle", - unitsPerBuy: 90, - priceCents: 250, + unitsPerBuy: 16, + priceCents: 200, }, ], }, @@ -320,6 +407,22 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🥗", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Crisp romaine with cherry tomatoes, cucumber and shaved parmesan.", + prepMinutes: 15, + cookMinutes: 0, + equipment: ["Large salad bowl", "Salad spinner", "Vegetable peeler"], + steps: [ + "Tear the Romaine into bite-size pieces, wash them, and dry them well in a salad spinner.", + "Halve the Cherry tomatoes and slice the Cucumber into thin rounds.", + "Shave the Parmesan into thin strips with a vegetable peeler.", + "Just before serving, toss the greens, tomatoes and cucumber with the Vinaigrette, 1 tbsp at a time, until lightly coated.", + "Top with the Croutons and Parmesan and serve right away.", + ], + tips: [ + "Keep the greens, vegetables and dressing separate until the last minute so nothing wilts.", + "Chill the salad bowl in the fridge; a cold bowl keeps the leaves crisp longer.", + "Add a can of drained chickpeas to turn this into a vegetarian main.", + ], items: [ { id: "starter-garden-salad-romaine", @@ -336,9 +439,9 @@ export const sideRecipes: StarterRecipe[] = [ name: "Cherry tomatoes", emoji: "🍅", perServing: 2, - unit: "tomato", + unit: "oz", buyUnit: "pack", - unitsPerBuy: 12, + unitsPerBuy: 10, priceCents: 300, }, { @@ -389,6 +492,23 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🥑", category: "Sides & salads", defaultServingsPerPerson: 1, + description: "Chunky avocado guacamole with lime, cilantro and jalapeño.", + prepMinutes: 15, + cookMinutes: 0, + equipment: ["Mixing bowl", "Potato masher", "Chef's knife", "Cutting board"], + steps: [ + "Halve, pit and scoop the Avocado into a mixing bowl.", + "Mash it with a potato masher, leaving some 1/2-inch chunks for texture.", + "Mince the Jalapeño, removing the seeds for less heat, then dice the Onion and Tomatoes and chop the Cilantro.", + "Fold the vegetables into the avocado with the juice of 1 Lime and 1/2 tsp salt per avocado.", + "Taste and add more Lime or salt until the flavor is bright.", + "Spoon into a wide bowl and serve with the Tortilla chips.", + ], + tips: [ + "Press plastic wrap directly onto the surface to slow browning, and make it no more than an hour ahead.", + "Keep the guacamole in the shade and stir it once before setting it out.", + "Stretch it for a crowd by folding in a spoonful of Salsa right before serving.", + ], items: [ { id: "starter-chips-and-guac-chips", @@ -426,7 +546,7 @@ export const sideRecipes: StarterRecipe[] = [ emoji: "🌿", perServing: 1 / 20, unit: "bunch", - buyUnit: "each", + buyUnit: "bunch", unitsPerBuy: 1, priceCents: 100, }, From b09b332001f6414cbfa52b9cff21a7bd528bb405 Mon Sep 17 00:00:00 2001 From: HeWillCook Date: Mon, 16 Nov 2026 16:25:28 -0500 Subject: [PATCH 03/12] shopping: merged lines, aisle groups, need-vs-buy, copy list - Merge ingredient rows that share a normalized name, recipe unit, buy unit and pack size; sum the need first and round up to buy units once, so three onion rows become one and 36 buns buys 5 packs instead of 3 + 3. - Merged ticks: every contributing item id is checked/unchecked in one transaction with the line's buy quantity as the basis; the actual price is stored on the sorted-first id and other ids are cleared and ignored. - Group the list by store aisle with an alphabetized section per aisle and a muted "for Burgers, Hot dogs" line on merged rows. - Show "Buy 3 packs" with "need 18 buns (packs of 8)" underneath; format quantities with common fractions and at most two decimals. - Tick optimistically with useOptimistic: the box flips immediately, rolls back and shows the reason when the save fails. - Copy list as plain text grouped by aisle, unchecked first, with Copied! feedback and a clipboard fallback; add a client-only hide-got toggle. - Reword the extras card as a spending log and label the per-guest total "per guest (incl. extras)"; progress reads "N of M ingredients". Co-Authored-By: Claude Opus 5.5 --- src/components/shopping/CopyListButton.tsx | 49 ++++ src/components/shopping/ExtrasCard.tsx | 7 +- src/components/shopping/ShoppingLineRow.tsx | 78 +++--- .../shopping/ShoppingPanel.test.tsx | 161 ++++++++++--- src/components/shopping/ShoppingPanel.tsx | 69 +++++- src/domain/aisles.test.ts | 66 +++++ src/domain/aisles.ts | 228 ++++++++++++++++++ src/domain/shopping.test.ts | 127 ++++++++-- src/domain/shopping.ts | 116 +++++++-- src/lib/shopping-text.test.ts | 67 ++++- src/lib/shopping-text.ts | 98 +++++++- src/services/shopping.test.ts | 126 +++++++++- src/services/shopping.ts | 130 ++++++---- 13 files changed, 1170 insertions(+), 152 deletions(-) create mode 100644 src/components/shopping/CopyListButton.tsx create mode 100644 src/domain/aisles.test.ts create mode 100644 src/domain/aisles.ts diff --git a/src/components/shopping/CopyListButton.tsx b/src/components/shopping/CopyListButton.tsx new file mode 100644 index 0000000..e345040 --- /dev/null +++ b/src/components/shopping/CopyListButton.tsx @@ -0,0 +1,49 @@ +"use client"; + +import { useEffect, useState } from "react"; +import { Button } from "../ui/Button"; + +/** How long "Copied!" stays up before the button resets. */ +const FEEDBACK_MS = 2000; + +/** + * Copies the plain-text shopping list. Feedback clears itself after two seconds; + * a blocked clipboard says so rather than pretending the copy worked. + */ +export function CopyListButton({ text }: { text: string }) { + const [feedback, setFeedback] = useState<{ status: "copied" | "failed"; at: number } | null>(null); + + useEffect(() => { + if (!feedback) return; + const timer = window.setTimeout(() => setFeedback(null), FEEDBACK_MS); + return () => window.clearTimeout(timer); + }, [feedback]); + + async function copy() { + try { + if (typeof navigator === "undefined" || typeof navigator.clipboard?.writeText !== "function") { + throw new Error("clipboard unavailable"); + } + await navigator.clipboard.writeText(text); + setFeedback({ status: "copied", at: Date.now() }); + } catch { + setFeedback({ status: "failed", at: Date.now() }); + } + } + + const copied = feedback?.status === "copied"; + + return ( +
+ +

+ {copied ? "Paste it into your notes or a message." : null} + {feedback?.status === "failed" + ? "Couldn't copy automatically. Select the list and copy it by hand." + : null} +

+
+ ); +} diff --git a/src/components/shopping/ExtrasCard.tsx b/src/components/shopping/ExtrasCard.tsx index fb3b4ce..698bf08 100644 --- a/src/components/shopping/ExtrasCard.tsx +++ b/src/components/shopping/ExtrasCard.tsx @@ -97,10 +97,13 @@ export function ExtrasCard({ }) { return ( -

Extras

+
+

Extra spending

+

Costs that aren't on the ingredient list.

+
{extras.length === 0 ? ( -

Drinks, ice and charcoal go here.

+

Log other spending like ice, charcoal or plates so the total stays honest.

) : (
diff --git a/src/components/shopping/ShoppingLineRow.tsx b/src/components/shopping/ShoppingLineRow.tsx index 6b9017b..a13a42a 100644 --- a/src/components/shopping/ShoppingLineRow.tsx +++ b/src/components/shopping/ShoppingLineRow.tsx @@ -1,8 +1,8 @@ "use client"; -import { useActionState, useState } from "react"; +import { useActionState, useOptimistic, useState, useTransition } from "react"; import { formatCents } from "@/domain/money"; -import { formatBuyQty } from "@/lib/shopping-text"; +import { formatBuyQty, formatNeed } from "@/lib/shopping-text"; import type { ShoppingPlan } from "@/services/shopping"; import { FormError } from "../menu/menuForm"; import { @@ -17,23 +17,47 @@ export interface ShoppingLineActions { priceAction: ShoppingFormAction; } -function CheckBox({ name, checked, action }: { name: string; checked: boolean; action: ShoppingFormAction }) { - const [state, formAction, pending] = useActionState(action, INITIAL_SHOPPING_FORM_STATE); +/** + * The tick box. Optimistic: the box flips on tap, and if the save fails the + * transition ends without new props so the box flips back — with the reason + * shown underneath instead of a silently-checked row. + */ +function CheckBox({ line, action }: { line: ShoppingPlan["lines"][number]; action: ShoppingFormAction }) { + const [checked, setOptimisticChecked] = useOptimistic(line.checked); + const [pending, startTransition] = useTransition(); + const [error, setError] = useState(null); + + function toggle(next: boolean) { + startTransition(async () => { + setOptimisticChecked(next); + setError(null); + // An unticked checkbox sends nothing, matching the form's encoding. + const data = new FormData(); + if (next) data.append("checked", "on"); + try { + const result = await action(INITIAL_SHOPPING_FORM_STATE, data); + if (result.error) setError(result.error); + } catch { + // A thrown action (network, server crash) rolls back the same way. + setError("Couldn't save that tick. Try again."); + } + }); + } + return ( -
+
- - + +
); } @@ -77,7 +101,7 @@ function PriceBox({ ); } -/** One ingredient: tick box, emoji, name, how much to buy, and an editable price. */ +/** One ingredient: tick box, emoji, name, how much to buy vs. need, and an editable price. */ export function ShoppingLineRow({ line, rangeNote, @@ -91,13 +115,7 @@ export function ShoppingLineRow({ return (
- {/* Re-keyed when the saved tick changes, so the box always shows the server's state. */} - +