Recipe Finder – Project Prompt (React + Vite) Build a simple, modern, colorful, and…
- User
Recipe Finder – Project Prompt (React + Vite)
Build a simple, modern, colorful, and responsive frontend web application called "Recipe Finder" using React + Vite.
The application must fetch live recipe data from TheMealDB API and display recipes in attractive cards. The project should be beginner-friendly, use reusable React components, and avoid unnecessary complexity.
API
Use the following free public API:
https://www.themealdb.com/api/json/v1/1/search.php?s=
The recipes must be fetched using the Fetch API (fetch()).
Do not use static or hardcoded recipe data.
Project Requirements
- React + Vite Build the project using React with Vite. Keep the project simple and beginner-friendly.
- Fetch Live Recipes Fetch recipes from TheMealDB API using fetch(). Fetch data when the application loads. Store the recipes in React state.
- Display Recipe Cards
Display recipes inside modern and responsive cards.
Each card should display:
🍽 Meal Image 🍔 Meal Name 🏷 Category 🌍 Cuisine (Area) 📖 Short Description (first 100–150 characters of the instructions) 🔗 "View Recipe" button (opens the recipe source or YouTube video in a new tab if available) 4. Search Functionality
Add a search input.
The search should:
Filter recipes instantly while typing. Search by meal name. 5. Loading State
While recipes are loading, display:
Loading recipes...
- Error Handling
If the API request fails, display:
Oops! We couldn't load the recipes. Please try again.
- Empty State
If no recipes match the search, display:
No recipes found 🍽
- Responsive Design
The application must work properly on:
Mobile Tablet Desktop
Use CSS Grid or Flexbox.
- UI Design
Create a modern food-themed interface with:
Soft gradient background Rounded recipe cards Beautiful meal images Hover animations Box shadows Smooth transitions Clean spacing Readable typography
Do not use Bootstrap, Tailwind CSS, Material UI, or other UI libraries.
- Reusable Components
Create reusable React components:
SearchBar RecipeCard Loading
Keep the code simple and easy to understand.
- React Concepts
The project should clearly demonstrate:
React Components Props useState useEffect fetch() Conditional Rendering Array map() Array filter() README.md
Include:
Project Name Project Description Features API Used Technologies Used Installation Steps How to Run the Project Build Command GitHub & Vercel Deployment Instructions Deployment
The project should be ready to:
Push to GitHub Deploy on Vercel Important Instructions Use fetch() only. Do not use Axios. Do not use Redux or Context API. Do not use TypeScript. Do not use Tailwind CSS. Do not use hardcoded recipe data. Keep the code clean, simple, and beginner-friendly. Use reusable React components. Ensure the application clearly demonstrates: Loading state Successful API data display Search/filter functionality Empty state API error state Project Architecture recipe-finder/ │ ├── public/ │ ├── src/ │ │ ├── components/ │ │ ├── SearchBar.jsx │ │ ├── RecipeCard.jsx │ │ └── Loading.jsx │ │ │ ├── App.jsx │ ├── App.css │ ├── main.jsx │ └── index.css │ ├── package.json ├── README.md └── index.html Component Responsibilities App.jsx
Responsible for:
Fetching recipes from the API Managing application state Handling loading, error, and search states Filtering recipes Rendering the appropriate UI SearchBar.jsx
Responsible for:
Displaying the search input Sending the search value back to App.jsx RecipeCard.jsx
Responsible for displaying:
Meal Image Meal Name Category Area (Cuisine) Short Description View Recipe button
Each card should receive one recipe object through props.
Loading.jsx
Responsible for displaying:
Loading recipes...
Optionally include a simple CSS spinner.
Application States
The application must correctly display the following states:
Loading
Loading recipes...
Success
Display all recipe cards.
Error
Oops! We couldn't load the recipes. Please try again.
Empty Search
No recipes found 🍽
Assistant
I'll build a Recipe Finder application with React + Vite. Let me start by exploring the current project structure and then create all the necessary components.
Let me read the current files to understand the setup:
Now I'll create the Recipe Finder application. I'll update the files to use plain JavaScript and custom CSS instead of TypeScript and Tailwind. Let me start building:
Now let me create the components folder and the three reusable components:
Now let me create the Loading component and update the CSS files:
Now let me clean up the old TypeScript files that are no longer needed:
All files are created. Now let me build the project to verify everything works correctly:
The project built successfully! Let me verify the final file structure:
The Recipe Finder application has been built successfully! Here's a summary of what was created:
✅ Project Complete
Files Created/Modified:
File Description index.htmlUpdated title and font imports src/main.jsxReact entry point src/App.jsxMain component with API fetching, state management, and conditional rendering src/App.cssApp styles with responsive grid src/index.cssGlobal styles and CSS variables src/components/SearchBar.jsxSearch input with clear button src/components/SearchBar.cssSearch bar styling src/components/RecipeCard.jsxRecipe card displaying image, name, category, cuisine, description src/components/RecipeCard.cssCard styling with hover animations src/components/Loading.jsxLoading spinner component src/components/Loading.cssAnimated loading styles README.mdComplete documentation with setup and deployment instructions Features Implemented:
- 🔍 Search - Instant filtering as you type
- 🍽️ Recipe Cards - Image, name, category, cuisine, description, and view link
- ⏳ Loading State - Animated spinner
- ❌ Error Handling - Error message with retry button
- 📭 Empty State - "No recipes found" message
- 📱 Responsive - Mobile, tablet, desktop friendly
- 🎨 Modern UI - Soft gradients, rounded cards, shadows, hover animations
- 🔄 Live API - Fetches from TheMealDB API using fetch()
React Concepts Demonstrated:
- Components (SearchBar, RecipeCard, Loading)
- Props passing
- useState for state management
- useEffect for API calls
- Fetch API for HTTP requests
- Conditional rendering
- Array map() and filter()
Build Status: ✅ Success
The project builds successfully and outputs to
dist/index.html.Files built:
index.html,src/main.jsx,src/App.jsx,src/App.css,src/components/SearchBar.jsx,src/components/SearchBar.css,src/components/RecipeCard.jsx,src/components/RecipeCard.css,src/components/Loading.jsx,src/components/Loading.css,src/index.css,README.md