Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🥗 MealPlanner AI

An AI-powered meal planning web app that generates personalized 5-meal plans with a consolidated grocery list based on your dietary preferences, health restrictions, and lifestyle.


✨ Features

  • AI-Personalized Meal Plans — Generates 5 meals tailored to your dietary profile using Claude AI
  • Dietary & Health Restrictions — Supports allergies, health conditions, cuisine preferences, and lifestyle diets
  • Consolidated Grocery List — Automatically merges ingredients across all meals into a single shopping list
  • Grocery Integration — Add ingredients directly to your cart via Kroger API
  • Secure Auth — JWT-based authentication with httpOnly cookie session management
  • Responsive UI — Mobile-first React web app optimized for small screens

🛠 Tech Stack

Layer Technology
Frontend React (mobile-responsive)
Backend FastAPI
Database PostgreSQL
ORM SQLAlchemy + Alembic
AI Claude API (Anthropic)
Auth PyJWT + Argon2
Grocery API Kroger API

🚀 Getting Started

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Supabase API Key
  • Groq API Key

Backend Setup

# Clone the repo
git clone https://github.com/yourusername/meal-plan-generator.git
cd meal-plan-generator/backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Fill in your keys in .env

# Start the server
fastapi dev

Frontend Setup

cd ../frontend

# Install dependencies
npm install

# Start the dev server
npm run dev

⚙️ Environment Variables

# Supabase configuration
SUPABASE_HOST="db.hxmafgrftwodbw.supabase.co"
SUPABASE_PORT="5432"
SUPABASE_DB="postgres"
SUPABASE_USER="postgres"
SUPABASE_PASSWORD="HghdfgsdfgBpxgr9i"

# JWT configuration
JWT_SECRET_KEY="qwertyuio"
JWT_ALGORITHM="HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30

# Groq API configuration
GROQ_API_KEY="ixx5D4yCffXS5hplCKiP5ic"

📁 Project Structure

mealplanner-ai/
├── backend/
│   ├── app.py
|   ├── DB.py
|   ├── CreateTable.py
│   ├── Schema/
│   │   ├── schema.py
│   ├── Services/
│   │   ├── UserServices.py
│   │   ├── MealPlanServices.py
│   ├── prompts/
│   │   └── MealPlanPrompt.py
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── compnents/
│   │   │   ├── BottomNav.tsx
│   │   │   ├── ChipSelect.tsx
│   │   │   ├── DayCard.tsx
│   │   │   ├── IngrediatRow.tsx
│   │   │   ├── MealCard.tsx
│   │   │   └── ProgressDots.tsx
│   │   ├── pages/
│   │   │   ├── AuthStep.tsx
│   │   │   ├── DietStep.tsx
│   │   │   ├── GoalsStep.tsx
│   │   │   ├── Ingredients.tsx
│   │   │   └── MealPlans.tsx
│   │   └── main.tsx
│   └── package.json
└── README.md

🧠 How It Works

  1. Onboarding — User sets dietary lifestyle, allergies, health conditions, cuisine preferences, cooking skill, budget, and serving size
  2. Meal Plan Generation — User preferences are passed to Claude API which returns a structured 5-meal plan
  3. Grocery List — Ingredients are consolidated across all 5 meals into a categorized grocery list
  4. Shopping — User adds grocery list directly to their Kroger cart via API

🗂 Database Schema

Users

Column Type
id UUID (PK)
email String (unique)
first_name String
last_name String
phone_number String
password String (Argon2 hash)
created_date DateTime
updated_date DateTime

User Preferences

Column Type
id UUID (PK)
user_id UUID (FK)
dietary_lifestyle Array(String)
allergies Array(String)
health_conditions Array(String)
nutritional_goals Array(String)
cuisine_preferences Array(String)
cooking_skill_level String
created_date DateTime
updated_date DateTime

Meal Plan

Column Type
id UUID (PK)
user_id UUID (FK)
meal_number Integer
meal_name String
cuisine_type String
cook_time_minutes Integer
estimated_cost Double
calories_per_serving Integer
ingredients Array(JSON)
instructions String
created_date DateTime
updated_date DateTime

📄 License

MIT

About

An AI-powered meal planning web app that generates personalized 5-meal plans with a consolidated grocery list based on your dietary preferences, health restrictions, and lifestyle.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages