Inspiration

Food waste is a global problem, with households throwing away billions of dollars worth of groceries annually simply because they don't know what to cook with what they have. We were inspired by the common scenario of staring into a fridge full of ingredients but feeling uninspired or unsure about what meals to prepare. CookNow was born from the desire to help people reduce food waste, save money, and discover delicious recipes using ingredients they already own.

What it does

CookNow is an intelligent cooking assistant that bridges the gap between your available ingredients and authentic recipes from around the world. Here's how it works:

  1. Automatic Country Detection: The app automatically detects your location using IP geolocation, instantly personalizing your experience with relevant recipes and local marketplace links.
  2. AI-Powered Ingredient Recognition: Simply snap a photo of your fridge or pantry, and our Gemini AI analyzes the image to identify all visible ingredients with high accuracy.
  3. Smart Recipe Matching: Using TheMealDB API, CookNow suggests three tiers of recipes:
    • Ready Now: Recipes using only what you have
    • Quick Trip: Recipes needing 1-3 additional ingredients -Full Feast: More elaborate dishes requiring 4+ ingredients but utilizing your base items
  4. Interactive Cooking Experience: Each recipe includes step-by-step instructions with interactive timers, high-quality images, and detailed cooking techniques.
  5. Shopping Integration: Missing ingredients? CookNow provides direct marketplace links for quick shopping.

How we built it

Architecture:

  1. Client-Side: React components handle user interactions, image uploads, and recipe display
  2. Edge Functions:
    • analyze-image: Processes uploaded photos using Gemini AI to extract ingredients
    • analyze-ingredients: Queries TheMealDB API to match recipes with available ingredients
  3. Caching Strategy: LocalStorage caching for country data (7-day expiry) to minimize API calls
  4. Real-time Features: Interactive timers with background execution and browser notifications

Challenges we ran into

  1. Image Analysis Accuracy: Getting the AI to accurately identify ingredients from varied photo qualities and lighting conditions required careful prompt engineering and response parsing.
  2. Recipe Matching Algorithm: Developing a smart algorithm to categorize recipes into three meaningful tiers while ensuring diverse cuisine representation was complex. We had to balance ingredient matching with recipe variety.
  3. API Rate Limit: Working with free-tier APIs meant implementing intelligent caching strategies and optimizing API calls to avoid hitting rate limits while maintaining responsiveness.
  4. Cross-Browser Compatibility: Ensuring image upload, file reading, and timer notifications worked consistently across different browsers required extensive testing and fallback mechanisms.
  5. Data Transformation: TheMealDB API returns data in a specific format that needs significant transformation to match our application's data structure, especially for ingredients and cooking steps.

Accomplishments that we're proud of

  • Seamless AI Integration: Successfully integrated Gemini AI for real-time ingredient detection with impressive accuracy
  • Smart Recipe Categorization: Developed an intelligent algorithm that meaningfully categorizes recipes based on ingredient availability

What we learned

  • AI Prompt Engineering: Learned how to craft effective prompts for computer vision tasks to get structured, parseable responses
  • API Integration Best Practices: Gained experience in integrating multiple third-party APIs while handling errors gracefully
  • Real-time Features: Mastered browser APIs for notifications, timers, and background processes

What's next for CookNow

  • Voice Guidance: Hands-free cooking with voice-guided instructions
  • Social Features: Share recipes, cooking tips, and photos with friends
  • Smart Kitchen Integration- Connect with smart appliances for automated cooking assistan

Built With

Share this project:

Updates

Submission history