const app = { dom: {}, state: { recipes: [], }, api: { async getRecipes() { try { const response = await fetch('api/get_recipes.php'); const data = await response.json(); if (data.success) { app.state.recipes = data.recipes; } else { console.error('Failed to load recipes:', data.error); app.dom.recipeCardsContainer.innerHTML = '
Error loading recipes.
Could not connect to the server.
Your saved recipes will appear here.
Your shopping list is empty. Add a recipe, and its ingredients will appear here.