๐ฝ๏ธ RecipeAI โ Snap, Scan & Cook
Upload a food photo or paste any recipe text. AI structures it, analyzes it, and makes it interactive.
What is RecipeAI?
RecipeAI is a full-stack AI-powered recipe assistant that lets users:
- Upload a food photo โ AI identifies the dish and fetches a structured recipe
- Paste any recipe text โ even messy, emoji-heavy WhatsApp-style formats โ and AI parses and structures it automatically
- Scale servings โ ingredient quantities adjust in real time
- Localize recipes โ adapt dishes to local/regional ingredients (e.g. a Kenyan twist on a European dish)
- Substitute ingredients โ "I don't have thyme, what can I use?"
- Get nutritional info โ calories, macros, and dietary flags per serving
Tech Stack
Project Structure
recipeai/
โโโ frontend/ # Next.js app
โ โโโ app/
โ โ โโโ (auth)/ # Login / signup pages
โ โ โโโ dashboard/ # User saved recipes
โ โ โโโ recipe/[id]/ # Single recipe view
โ โ โโโ upload/ # Upload & paste flow
โ โโโ components/
โ โ โโโ RecipeCard.tsx
โ โ โโโ IngredientList.tsx
โ โ โโโ ServingScaler.tsx
โ โ โโโ NutritionBadge.tsx
โ โโโ lib/
โ โ โโโ supabase.ts # Supabase client
โ โ โโโ api.ts # FastAPI client helpers
โ โโโ public/
โ
โโโ backend/ # FastAPI app
โ โโโ main.py
โ โโโ routers/
โ โ โโโ recipes.py # Parse, structure, save
โ โ โโโ vision.py # Image recognition
โ โ โโโ ai.py # Gemini AI calls
โ โ โโโ auth.py # Supabase JWT verification
โ โโโ models/
โ โ โโโ recipe.py # Pydantic models
โ โโโ services/
โ โ โโโ gemini_service.py
โ โ โโโ vision_service.py
โ โโโ requirements.txt
โ
โโโ supabase/
โ โโโ migrations/ # DB schema SQL files
โ
โโโ .env.example
โโโ .gitignore
โโโ README.md
Getting Started
Prerequisites
1. Clone the repo
git clone https://github.com/your-username/recipeai.git
cd recipeai
2. Set up environment variables
Copy the example env file and fill in your keys:
cp .env.example .env
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Google Gemini
GEMINI_API_KEY=your_gemini_api_key
# Google Cloud Vision
GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credentials.json
# FastAPI
BACKEND_URL=http://localhost:8000
3. Frontend setup
cd frontend
npm install
npm run dev
Frontend runs at http://localhost:3000
4. Backend setup
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload
Backend runs at http://localhost:8000
API docs available at http://localhost:8000/docs
5. Supabase DB setup
Run the migration in supabase/migrations/ via the Supabase dashboard SQL editor, or use the Supabase CLI:
supabase db push
Database Schema (Supabase)
-- Users handled by Supabase Auth
create table recipes (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users(id) on delete cascade,
title text not null,
description text,
image_url text,
source_text text, -- original pasted/uploaded input
structured_data jsonb, -- parsed ingredients, steps, etc.
nutrition jsonb,
servings integer default 4,
created_at timestamptz default now()
);
create table saved_recipes (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users(id) on delete cascade,
recipe_id uuid references recipes(id) on delete cascade,
created_at timestamptz default now()
);
API Endpoints
| Method |
Endpoint |
Description |
POST |
/api/recipes/parse |
Parse raw recipe text using Gemini AI |
POST |
/api/vision/identify |
Identify dish from uploaded image |
GET |
/api/recipes/{id} |
Fetch a single saved recipe |
POST |
/api/recipes/save |
Save structured recipe to Supabase |
GET |
/api/recipes/user/{user_id} |
Get all recipes for a user |
POST |
/api/recipes/substitute |
Get ingredient substitutions |
POST |
/api/recipes/localize |
Localize recipe to a region |
AI Features In Detail
Recipe Parser (Gemini)
Sends raw text (including emojis, informal formatting) to Gemini with a structured prompt. Returns clean JSON with title, ingredients[], steps[], servings, and tags.
Image Recognition (Google Vision)
Uploads image to Vision API โ gets label annotations โ uses top labels as search terms โ Gemini generates or fetches a matching recipe.
Ingredient Substitution (Gemini)
Sends ingredient + dish context โ returns 2โ3 substitution options with notes on flavor impact.
Localization (Gemini)
Sends full recipe + target region โ returns adapted recipe with locally available ingredient equivalents.
Deployment
Frontend โ Vercel
# Push to GitHub, connect repo on vercel.com
# Add all NEXT_PUBLIC_* env vars in Vercel dashboard
Backend โ Render
# Push backend/ to GitHub
# Create a new Web Service on render.com
# Build command: pip install -r requirements.txt
# Start command: uvicorn main:app --host 0.0.0.0 --port 10000
# Add all env vars in Render dashboard
Screenshots
Text Parser - Upload Recipe Text

Parsed Recipe Preview

Complete Recipe View

Landing Page (Desktop)

Mobile View

Contributing
Pull requests are welcome. For major changes, please open an issue first.
License
MIT
Author
Built by Daniel Giathi โ a Software Engineer passionate about building AI-powered tools for everyday life.