Proactively choose the right state management pattern: derived state, URL state, server state, local state, lifted state, Context, or external store. Always apply without being asked.
84
76%
Does it follow best practices?
Impact
97%
1.16xAverage score across 5 eval scenarios
Passed
No known issues
Build a recipe browsing application in React with TypeScript. Users can browse recipes, search and filter them, save favorites, and view detailed cooking instructions.
Data:
/api/recipes which returns { recipes: Recipe[] } where each Recipe has id: string, title: string, cuisine: string, difficulty: "easy" | "medium" | "hard", prepTime: number (minutes), cookTime: number (minutes), servings: number, ingredients: string[], instructions: string[], image: string, and rating: number.Features:
/recipes/:id which fetches full details from /api/recipes/:id and shows all ingredients and step-by-step instructionsProduce TypeScript/TSX files in a src/ directory:
src/types.ts -- TypeScript type definitionssrc/hooks/useRecipes.ts -- hook to fetch all recipessrc/hooks/useRecipe.ts -- hook to fetch a single recipe by IDsrc/context/FavoritesContext.tsx -- favorites state shared across the appsrc/components/RecipeBrowser.tsx -- the main browse page with tabs, search, filterssrc/components/RecipeCard.tsx -- individual recipe card with favorite togglesrc/components/RecipeGrid.tsx -- the grid of recipe cardssrc/components/RecipeDetail.tsx -- the full recipe detail pagesrc/components/SearchAndFilters.tsx -- search and filter controlssrc/components/Header.tsx -- header with favorites countsrc/App.tsx -- app with routingThe code does not need to run against a real server. Do not include test files or build configuration.