Build a recipe sharing platform where users can share recipes, rate them, and create meal plans
Create a recipe sharing platform where users can post recipes, browse collections, rate recipes, save favorites, and create meal plans.
// Generate shopping list
function generateShoppingList(recipes) {
const ingredients = {};
recipes.forEach(recipe => {
recipe.ingredients.forEach(ing => {
const key = ing.name.toLowerCase();
if (ingredients[key]) {
ingredients[key].amount += convertUnit(ing.amount, ing.unit);
} else {
ingredients[key] = { name: ing.name, amount: ing.amount, unit: ing.unit };
}
});
});
return Object.values(ingredients);
}