ForkLoop eliminates "what should I cook?" decision fatigue with personalized recipe recommendations. Built on proven React architecture, this application provides intelligent meal suggestions based on your dietary preferences, cooking skill level, available ingredients, and nutritional goals.
Core Mission: Transform meal planning from a daily chore into an effortless, personalized experience.
- Smart Recipe Discovery: Personalized recommendations using Spoonacular API
- Dietary Intelligence: Filter by preferences, restrictions, and nutritional goals
- Skill-Based Suggestions: Recipes matched to your cooking experience level
- Ingredient-Aware: Find recipes based on what you already have
- Personal Collections: Save, organize, and rate your favorite recipes
- Meal Planning: Strategic meal prep and planning tools
- Frontend: React 18.2.0 + React Router 6.26.1
- Styling: CSS Modules with BEM methodology
- API Integration: Spoonacular API for recipe data
- State Management: React Context for user preferences
- Authentication: JWT tokens with localStorage
- Development: Create React App with ESLint, Prettier
- Deployment: GitHub Pages (Live: https://zimmermanjosh.github.io/stage_1_forkloop_frontend)
Built by strategically transforming proven WTWR architecture:
clothingItem.js β recipe.jsWeather API β Spoonacular APIItemCard β RecipeCardWeather conditions β Meal categoriesClothing collections β Recipe collections
Timeline: 28 days (Frontend + API Integration)
- β Foundation & branding updates
- β Core components (RecipeCard, search, detail views)
- β Spoonacular API integration & filtering
- β Polish, responsive design, deployment
ForkLoop leverages modular React components for recipe discovery and meal planning:
Core Components:
RecipeCard- Individual recipe display and interactionRecipeDetail- Comprehensive recipe view with ingredients/instructionsSearchFilters- Dietary preferences, cuisine, cooking time filtersRecipeCollection- Personal saved recipes and meal plansUserProfile- Dietary preferences and cooking skill management
Utility Structure:
src/
βββ components/ # React components
β βββ App/ # Main application logic
β βββ RecipeCard/ # Recipe display components
β βββ Header/ # Navigation and branding
β βββ Profile/ # User management
βββ contexts/ # React context providers
βββ utils/ # API utilities (Spoonacular, auth)
βββ images/ # Assets and icons
βββ vendor/ # Third-party resources
API Integration:
src/utils/SpoonacularApi.jsx- Recipe data and searchsrc/utils/auth.jsx- User authenticationsrc/utils/config.jsx- Environment configuration
- nvm
- npm
- nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
open a terminal and copy below and paste the following
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
open a new terminal || type source ~/.bashrc || ~/.zshrc .. etc
-
open a new terminal
-
type :
nvm install npm
- type :
cd <root directory> && nvm use
check installed nvm version
- type :
nvm -ls
- type :
nvm install <node version>
then
- type :
nvm use
- type :
npm i || npm install
-
Copy environment template:
cp .env.example .env
-
Add your Spoonacular API key to
.env:- Get a free API key from Spoonacular
- Replace
your_spoonacular_api_key_herewith your actual API key - Free tier: 150 requests/day
-
Verify environment variables are loaded:
npm run dev:local # Check browser console for API calls with your key
npm run dev:local- Recommended for local development - serves athttp://localhost:3000/npm run dev- Standard development (uses conditional base path)npm run dev:ci- CI/GitHub Actions development servernpm run start- Alias fornpm run dev
npm run build- Build for production (includes GitHub Pages base path)npm run preview- Preview production build locallynpm run github:deploy- Deploy to GitHub Pages
npm run lint- Run ESLintnpm run lint:fix- Fix ESLint issues automaticallynpm run clean- Removes build artifacts '/node_modules' && '/build'
- Local Development: http://localhost:3000/ (use
npm run dev:local) - Production Preview: http://localhost:4173/ (use
npm run preview)
- Local Development: No base path (
/) - GitHub Pages: Base path (
/stage_1_forkloop_frontend/) - Automatically configured based on
NODE_ENV
π Live Site: https://zimmermanjosh.github.io/stage_1_forkloop_frontend
Use these credentials to test Save Recipe and Authentication features:
Test User 1:
Email: jtest@test.com
Password: test123456
Test User 2:
Username: testuser
Email: testuser@test.com
Password: password123456
Avatar: https://i.pravatar.cc/300?img=50
Step-by-step testing guide:
-
Visit the Live Site: https://zimmermanjosh.github.io/stage_1_forkloop_frontend
-
Login Process:
- Click "Log in" button in the header
- Use either test account credentials above
- The login modal shows both test accounts for convenience
- Click "Log in" to authenticate
-
Test Save Recipe Functionality:
- Search for recipes using the search bar
- Click on any recipe card to view details
- Click "πΎ Save Recipe" button in the recipe modal
- Recipe will be added to your personal collection
-
Test User-Specific Data:
- Login with User 1, save some recipes
- Logout and login with User 2, save different recipes
- Each user maintains separate recipe collections
- Verify recipes are user-specific
-
Test Profile Management:
- Click your avatar in the header when logged in
- Update your name and avatar URL
- Changes persist for that user session
Note: Mock authentication is enabled for GitHub Pages deployment, so all features work without a backend server.
Features Available:
- β Recipe search and discovery
- β Add/delete recipes functionality
- β User authentication (register/login)
- β Personal recipe collections
- β Responsive design across devices
- β Spoonacular API integration
ForkLoop includes comprehensive testing components for API and authentication validation:
Access these routes after running npm start:
-
Full Test Dashboard: http://localhost:3000/tests
- Complete testing suite with all functionality
- Real-time API connection testing
- Authentication flow validation
- Visual feedback and detailed results
-
API Tests Only: http://localhost:3000/api-test
- Spoonacular API integration testing
- Recipe search, random recipes, details
- Connection and response validation
-
Auth Tests Only: http://localhost:3000/auth-test
- User registration and login testing
- JWT token validation
- Profile management testing
Note: These test routes are built into the application for development purposes and provide interactive testing without needing external testing frameworks.
Open browser console and run quick tests:
// Quick API connectivity test
window.testAPI.runQuickTest();
// Test recipe search functionality
window.testAPI.testSearch("chicken");
// Test random recipe fetching
window.testAPI.testRandom("breakfast");
// Test individual recipe details
window.testAPI.testDetails("715538");
// Run comprehensive API test suite
window.testAPI.runAllTests();-
π§ͺ API Testing: Spoonacular integration validation
- Recipe search with filters (diet, cuisine, cooking time)
- Random recipe fetching by category
- Individual recipe detail retrieval
- Error handling and fallback testing
-
π Authentication Testing: User system validation
- User registration flow
- Login authentication with JWT tokens
- Token validation and refresh
- Profile update functionality
- Complete auth flow testing
-
π Visual Results: Detailed test feedback
- Real-time loading states
- Error message display
- Parsed API response inspection
- User-friendly result summaries
- Live Testing: Interactive components for immediate feedback
- API Validation: Test Spoonacular integration before deployment
- Auth Flow Testing: Complete user registration/login verification
- Debug Tools: Quick connection and error diagnosis
- Data Verification: Inspect parsed API responses in real-time
- Error Handling: Verify fallback mechanisms work correctly
The testing infrastructure is built into these components:
src/components/
βββ TestDashboard/ # Main testing hub (/tests route)
βββ ApiTest/ # Spoonacular API testing (/api-test route)
βββ AuthTest/ # Authentication testing (/auth-test route)
βββ AddRecipeDemo/ # Interactive recipe adding demo
βββ MockAuthDemo/ # Mock authentication examples
- Start Development Server:
npm start - Navigate to Test Routes: Use URLs above or click links in the app
- Interactive Testing: Click buttons to run specific tests
- Console Integration: Use
window.testAPIfunctions for scripted testing - Real-time Results: View immediate feedback and detailed responses
- Create account at Spoonacular
- Get your API key (150 requests/day free tier)
- Add API key to environment configuration
For local development with mock data:
npm install -g json-server@^0
- copy 'mockdb/mockdb.json' to root as
db.json - run:
json-server --watch db.json --id \_id --port 3001
Target Completion: 7 days early (Day 21)
- Week 1: β Foundation & branding transformation
- Week 2: β Core recipe components & Spoonacular integration
- Week 3: XX Advanced filtering & user preferences
- Week 4: π Polish, responsive design, deployment
- Responsive design (320px+ no horizontal scroll)
- BEM CSS methodology compliance
- React hooks implementation
- Fetch API integration (no third-party request libraries)
- Spoonacular API integration (150 req/day limit)
- Frontend: [https://github.com/zimmermanjosh/stage_1_forkloop_frontend]
- Backend (Stage 2): [https://github.com/zimmermanjosh/stage_2_forkloop_backend]
- Live Demo: https://zimmermanjosh.github.io/stage_1_forkloop_frontend
- checkout: [new branch update PR - stage-1-frontend-and-api]
- checkout: [new branch update PR - stage-1-frontend-and-api_2]
- fixed github actions
- updates as per nikolai
- updates to readme :
- to allow for faked login and saving
- to have pre-determined user and pass