EasyCook AI

EasyCook AI homepage screenshot

🚀 Try Live Demo 💻 View on GitHub

Overview

EasyCook AI is an AI-powered recipe extraction system that transforms YouTube cooking videos into structured, timestamped recipes. Using Google’s Gemini API, it intelligently parses video content and syncs extracted recipe segments with the video timeline, creating an interactive hands-free cooking experience.

The Problem

YouTube is full of cooking tutorials, but extracting structured recipes from video is manual and tedious. Viewers have to pause, take notes, or watch repeatedly to gather ingredients and instructions. EasyCook AI automates this process entirely, delivering a clean, timestamped recipe synced perfectly with the video.

How It Works

Architecture

  • Backend: Flask API that accepts YouTube URLs and orchestrates the extraction pipeline
  • AI Engine: Google Gemini API receives the YouTube video URL directly and extracts recipe components from it
  • Frontend: Interactive YouTube player synced to extracted recipe segments with timestamped navigation, served by the same Flask app so the whole thing is one process on one origin
  • Caching: File-backed, video-ID-keyed cache prevents redundant API calls and preserves extracted recipes across deployments

The Pipeline

  1. User submits a YouTube URL to the frontend
  2. Backend parses the video ID (the player loads the video right away while extraction runs) and checks the cache
  3. If cached, returns stored recipe instantly; if not, sends to Gemini
  4. Gemini analyzes the video and returns timestamped recipe segments (title, ingredients, instructions)
  5. Backend caches the result and returns structured JSON
  6. Frontend renders recipe segments and syncs the player to jump between steps

Key Features

Intelligent Extraction

The system extracts:

  • Recipe title
  • Ingredients list
  • Step-by-step instructions
  • Precise timestamps for each segment

Hands-Free Mode

Voice command support (in browsers with Web Speech API) lets users navigate the recipe without touching the screen — handy when your hands are covered in flour:

  • "play" / "continue" / "resume" — Resume video
  • "next" / "skip" — Jump to the next ingredient or step
  • "back" / "previous" — Go to the previous step
  • "repeat" / "again" — Replay the current step
  • Auto-pause after each ingredient for voice-command readiness
  • Only listens while the recipe is paused, so words spoken in the video can’t skip a step
  • Keeps the screen awake during playback and while listening

Ingredients & Shopping List

  • View every ingredient in the recipe in one list
  • Check off what you already have, then copy the rest as a shopping list

Step Timeline

A readable strip of recipe steps you can tap to jump around the video — fully keyboard-navigable.

Sharing

  • Shareable recipe links that open straight into the extracted recipe
  • Link previews show the recipe’s title and video thumbnail
  • Native share sheet on mobile

Kitchen Mode

Built to sit on a kitchen counter:

  • Light/dark theme toggle
  • Adjustable text size
  • Print-friendly recipe layout
  • Installable to the home screen as a web app

Feedback

A built-in feedback box so users can tell me what to fix or build next.

Intelligent Caching

All forms of a YouTube URL collapse to the same cache key. Whether the user provides:

  • youtube.com/watch?v=ID
  • youtu.be/ID
  • youtube.com/shorts/ID
  • URLs with timestamps, playlists, or query parameters

…the system recognizes the same video and reuses the cached extraction. This saves API quota and provides instant results for popular recipes.

Multi-Process Safe

Cache uses atomic file operations and exclusive locks (flock), so concurrent requests from multiple workers cannot corrupt data.

Technical Stack

  • Backend: Flask 3.0.0, Python 3.12
  • AI: Google Gemini API (models/gemini-3.6-flash)
  • Server: Gunicorn (Docker) behind Caddy for HTTPS
  • Frontend: Vanilla JavaScript with YouTube IFrame API
  • Deployment: Docker, DigitalOcean

API Endpoints

Extract Recipe

POST /extract-recipe
Content-Type: application/json

{
  "youtube_url": "https://www.youtube.com/watch?v=...",
  "force": false
}

Response:
{
  "status": "ok",
  "segments": 12,
  "recipe": [...timestamped segments...],
  "cached": true,
  "video_id": "dQw4w9WgXcQ",
  "cached_at": 1785782831.8
}

Cache Management

GET    /cache              → list all cached videos
GET    /cache/<video_id>  → fetch specific recipe
DELETE /cache/<video_id>  → clear one entry
DELETE /cache              → clear all entries
GET    /health             → cache status, API availability, video count

Other Endpoints

GET    /                   → the app itself (with per-recipe link previews)
GET    /video-id?url=...   → resolve a YouTube URL to its video ID (no Gemini call)
POST   /feedback           → submit feedback
GET    /feedback           → list feedback (personal details removed)

Deployment on DigitalOcean

EasyCook AI is deployed as a single Docker container on a $4 DigitalOcean droplet, with swap configured for the limited memory and Caddy in front handling HTTPS. This provides:

  • Simplified deployment: one container, one port
  • Persistent storage for the recipe cache and feedback via Docker volumes
  • Production-grade gunicorn configuration with multiple threads
  • Automatic environment variable injection for API keys
  • Easy updates: git pull && docker compose up -d --build

Quick Start

git clone https://github.com/mathewvarghesemanu/recipe_app && cd recipe_app
echo "GEMINI_API_KEY=your-key-here" > .env
docker compose up -d --build

curl localhost:5001/health

Local Development

scripts/setup.sh       # one-time setup
scripts/run.sh start   # start both servers
# Frontend: http://localhost:8000
# Backend: http://localhost:5001

Security & Production Considerations

  • API Key Management: .env never built into images; injected at runtime
  • CORS: Enabled for safe cross-origin requests
  • TLS: Caddy in front of the container terminates HTTPS; the app only listens on localhost
  • Rate Limiting: Firewall or proxy auth to prevent quota abuse
  • Non-Root Execution: Container runs as a restricted user

Why This Matters

Cooking videos are abundant but fragmented. Viewers waste time searching for the ingredient list or rewinding to find measurements. EasyCook AI bridges this gap by automating the extraction and indexing that chefs and food bloggers do manually. The result is a faster, more accessible cooking experience that respects both video creators and their audience.

Future Directions

  • Multi-language recipe extraction
  • Nutritional analysis per ingredient
  • Recipe difficulty and time estimates
  • Integration with recipe databases
  • User annotations and custom segments

🚀 Try Live Demo 💻 View on GitHub