Recipe Management App is a full-stack React + Vite single-page application (SPA) for comprehensive recipe management. Users can browse paginated recipe collections, perform full CRUD operations (Create, Read, Update, Delete), manage favorites, authenticate with persistent profiles, and navigate seamlessly across 12+ interconnected pages.
The architecture features centralized global state management in App.jsx with props drilling to child components, React Router v6 for client-side routing, localStorage persistence for user data, and a 25+ recipe mock dataset with consistent data structure. Responsive design ensures optimal experience across desktop, tablet, and mobile devices.
- Master Layout: Fixed Navbar (top), Sidebar (left filters), dynamic Content area, Footer
- HomePage: Paginated 3x2 recipe grid (6/page) with SearchBar, RecipeList, individual RecipeCard components
- RecipeCard: Displays image, name, calories, servings + FavoriteButton toggle + CRUD actions (edit/delete)
- Authentication Flow: LoginPage modal → CreateProfilePage → ProfilePage with localStorage sync
- Recipe Management: AddRecipe form (create/edit), RecipesDetailsPage (full view), delete confirmation
- Favorites System: FavoritesPage filters global
favoritesarray, maintains pagination - Global State Flow:
App.jsx→ Pages → Components via props (recipes, favorites, profile, callbacks) - Routing: 12+ routes including protected pages, 404 handling (NotFoundPage)
- Persistence: Automatic localStorage sync for profile/login state via
useEffect
| Category | Recipe Count | Examples |
|---|---|---|
| Pasta & Pizza | 4 | Pepperoni Pizza, Meat Lasagna |
| Meat | 4 | Pot Roast, Beef Hamburger |
| Fish | 3 | Roasted Cod, Grilled Salmon |
| Asian | 3 | Chicken Pad Thai, Spicy Curry |
| Mexican | 1 | Chicken Fajitas |
| Salad | 1 | Caesar Salad |
| Dessert | 1 | Chocolate Cake |
| Soup | 1 | Red Lentil Soup |
| Vegetarian | 1 | Hearty Chili |
Core features required for production-ready MVP:
- App Layout: Navbar + Sidebar + Content + Footer with responsive CSS Grid
- Recipe Browsing: HomePage → RecipeList (pagination 6/page) → RecipeCard
- Authentication: Login modal + CreateProfile + Profile display
- CRUD Operations: AddRecipe form + edit/delete in RecipeCard
- Favorites: Toggle system + dedicated FavoritesPage
- Routing: React Router with all 12 pages + 404 fallback
- State Management: Global state in App.jsx with props drilling
- Persistence: localStorage for profile/login across sessions
Post-MVP enhancements:
- Backend API: Node.js/Express + MongoDB for recipes/users
- Advanced Search: Filter by calories, ingredients, dietary restrictions
- Image Upload: Cloudinary/AWS S3 integration
- Infinite Scroll: Replace pagination with virtual scrolling
- Social Features: Recipe ratings, comments, sharing
- PWA: Service Worker + offline support
- Analytics: Track most popular recipes, user engagement
- React + Vite (fast dev server, optimized builds)
- React Router DOM (file-based routing, nested routes)
- JavaScript ES6+ (Hooks, async/await, destructuring)
- localStorage API + useEffect (data persistence)
- UUID v4 (unique recipe IDs)
- CSS Grid/Flexbox (responsive layouts)
- React Hook Form principles (controlled components)
main.jsx → BrowserRouter → App.jsx → Routes → Individual Pages
App.jsx (Global State) ├── Navbar.jsx (receives: openLoginModal) ├── Footer.jsx (static) ├── HomePage.jsx (receives: recipes, favorites, toggleFavorite) │ ├── SearchBar.jsx (local filtering) │ └── RecipeList.jsx (receives: recipes, favorites, toggleFavorite) │ └── RecipeCard.jsx (receives: recipe, isFavorite, toggleFavorite, edit/delete) │ └── FavoriteButton.jsx (receives: isFavorite, onToggle) ├── ProfilePage.jsx (receives: profile, isLoggedIn, callbacks) ├── FavoritesPage.jsx (receives: favorites, recipes, toggleFavorite) ├── AddRecipe.jsx (receives: onAddRecipe, onUpdateRecipe, initialRecipe) ├── RecipesDetailsPage.jsx (receives: recipes, match.params.id) └── LoginPage.jsx (modal - receives: onLogin, onClose)
recipes—Array[RecipeObject](25+ items from recipesData.js)favorites—Array[RecipeObject](user-selected recipes)profile—{username, email, password, image}(localStorage synced)isLoggedIn—boolean(authentication flag)isModalOpen—boolean(LoginPage visibility)
setFavorites(prev => prev.some(r => r.id === recipe.id) ? prev.filter(r => r.id !== recipe.id) : [...prev, recipe]);
setRecipes(remainingRecipes => [newRecipe, ...remainingRecipes]); // Adds to top
setRecipes(remainingRecipes => prev.filter(recipe => recipe.id !== recipe_id));
// Validates against stored profile return profile && (username === profile.username || username === profile.email);
- {
- id: "uuid-v4-string",
- name: "Recipe Name",
- calories: 400, // Number
- image: "https://url", // External CDN
- servings: 1, // Number
- type: "Pasta & Pizza", // Category filter
- ingredients: ["item1", "item2"], // Array[string]
- instructions: "Step by step..." // Multi-line string
- }
- const [currentPage, setCurrentPage] = useState(1);
- const ITEMS_PER_PAGE = 6;
- const startIndex = (currentPage - 1) * ITEMS_PER_PAGE;
- const recipesToShow = recipes.slice(startIndex, startIndex + ITEMS_PER_PAGE);
- Create Mode:
initialRecipe = null→ generatesuuidv4() - Edit Mode:
initialRecipeprop → pre-populates form - Single
handleFormSubmithandles both via conditional logic
Purpose: Composes the primary recipe discovery experience
Children Chain:
- HomePage
- ├── SearchBar (local state filtering)
- └── RecipeList
- └── RecipeCard ×6 (paginated)
- ├── FavoriteButton
- ├── Link to Details
- └── Edit/Delete (if authorized)
Responsibilities:
- Logo → Home (
/) - NavLinks →
/profile,/favorites,/add-recipe - Login button → triggers
openLoginModal()from App
Data Flow: localStorage.getItem("profileData") → App.jsx useState → ProfilePage props
-
Unauthenticated Home (
/)- Full recipe grid + login prompt in Navbar
- Browse → Details → Back
-
Login Flow Navbar Login → LoginPage Modal → (No Profile) CreateProfilePage → (Has Profile) ProfilePage
-
Authenticated State ProfilePage ↔ Home ↔ Favorites ↔ AddRecipe
-
Recipe Deep Dive Any RecipeCard → RecipesDetailsPage(/recipe/:id)
-
Protected Routes /profile, /favorites, /add-recipe (redirects unauthenticated users)
- Vite + Router Setup
npm create vite@latest --template reactnpm i react-router-dom uuid
- Core Architecture
- App.jsx (Routes + Global State)
- Master layout (Navbar/Sidebar/Footer)
- Data Layer
- recipesData.js (25+ recipes)
- Global state with persistence
- Recipe Browsing
- HomePage → RecipeList → RecipeCard chain
- Pagination (6/page) + SearchBar
- Authentication
- Login modal + CreateProfile + ProfilePage
- localStorage persistence
- CRUD Operations
- AddRecipe (create/edit modes)
- Delete/Update in RecipeCard
- Additional Pages
- FavoritesPage, About, Contact, Collaborate
- RecipesDetailsPage, NotFoundPage
- Responsive Design
- CSS Grid breakpoints
- Mobile-first touch targets
-
Full CRUD Pipeline
-
✅ Add/Edit/Delete with single reusable form
-
✅ Visual confirmation + error states
-
✅ UUID collision protection
-
Advanced State Management
-
✅ Global favorites sync across pages
-
✅ Profile persistence (multi-tab support)
-
✅ Real-time UI updates via props
-
Enterprise Routing
-
✅ 12+ protected routes
-
✅ Dynamic
/recipe/:idmatching -
✅ 404 fallback + breadcrumbs
-
Performance Optimizations
-
✅ Pagination prevents DOM overload
-
✅ Memoized recipe filtering
-
✅ Lazy-loaded detail pages






