Recipe Scaler
Recipe Scaler is the example app from the how to vibe code guide, built from the prompts printed below the app. Enter a title, the servings the recipe was written for and your ingredients, then set the servings you want. Amounts update at once, and the recipe stays in your browser.
Ingredients
Scaled: 300 g
Scaled: 500 ml
Scaled: 3
The recipe is saved in this browser only.
The prompts that built it
These are the three prompts from the how to vibe code guide: the first prompt, one bug fix and one feature. The app on this page was built to satisfy them.
Create a web app called Recipe Scaler.
Who uses it: a home cook who wants to cook for a different number of people than the recipe says.
What it does: one page. The user enters a recipe title, the number of servings the recipe was written for, and a list of ingredients (name, amount, unit). A second field sets the servings they want. When they change it, every amount updates immediately. Amounts display as simple decimals, rounded to two places.
Out of scope: accounts, a database, sharing, images. Save the current recipe in the browser so it is still there after a refresh.
Use Next.js with TypeScript and Tailwind CSS. Make it work on a phone screen first. Plain, readable design, no gradients.
Before you write code, tell me the file structure you plan to create and wait for my OK.Bug: when I type 1,5 as an amount (with a comma), the scaled amount shows NaN.
Expected: treat the comma as a decimal point, so 1,5 is 1.5.
Only change the amount parsing. Do not restyle anything. Tell me which file you changed.Add a "Copy as text" button under the ingredient list. It copies the scaled recipe to the clipboard as plain text, one ingredient per line, like "300 g flour". After copying, the button label changes to "Copied" for two seconds.
Do not change anything else on the page.