Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ ChefMind AI

Intelligent Food & Nutrition Assistant powered by Groq & Gemini AI
Turn your available ingredients into delicious recipes, weekly meal plans, and smart grocery lists β€” instantly.

Python Flask SQLite Groq Gemini License


πŸ“– Table of Contents


🧠 Overview

ChefMind AI is a full-stack, AI-powered food and nutrition platform built with Python (Flask), SQLite, and modern responsive web design. It eliminates the daily meal-decision friction by converting whatever ingredients you have at home into:

  • βœ… Safe, cookable AI-generated recipes
  • βœ… Goal-driven 7-day meal plans
  • βœ… Auto-consolidated grocery shopping lists
  • βœ… Real-time cooking assistant chatbot

Whether you're trying to lose weight, build muscle, or just eat healthier β€” ChefMind AI adapts to your goals and dietary restrictions.


🌟 Key Features

Feature Description
πŸ€– AI Recipe Generator Generates structured recipes from your available ingredients, cuisine preferences, cook time & servings
πŸ“… AI Meal Planner Creates 7-day, goal-based meal plans (Weight Loss, Muscle Gain, Healthy Lifestyle, etc.)
πŸ’¬ Cooking Chatbot Real-time conversational culinary support for substitutions, tips & techniques
πŸ“š Cookbook Library Browsable and searchable static recipe catalogue
🚫 Allergy Safety Filter Hard exclusion of declared allergens (Peanut, Dairy, Seafood, Egg, Gluten, Soy)
πŸ›’ Shopping List Manager Auto-consolidated missing ingredient lists with export & print support
πŸ“Š User Dashboard & History Chronological history logging and nutrition trend metrics
πŸ” User Authentication Secure sign-up, login, and profile management with hashed passwords

πŸ› οΈ Tech Stack

Backend

  • Python 3.10+ β€” Core language
  • Flask 3.0+ β€” Web framework with Blueprint-based modular routing
  • SQLite β€” Lightweight embedded relational database
  • Werkzeug β€” Password hashing & WSGI utilities
  • python-dotenv β€” Environment variable management

AI / APIs

  • Groq API β€” Ultra-fast LLM inference (LLaMA models)
  • Google Gemini API β€” Multimodal AI capabilities

Frontend

  • Jinja2 β€” Server-side HTML templating
  • Vanilla CSS + JavaScript β€” Custom responsive UI with animations
  • Google Fonts β€” Modern typography

πŸ“ Project Structure

ChefMind_AI/
β”‚
β”œβ”€β”€ app.py                      # Application factory (create_app)
β”œβ”€β”€ config.py                   # Configuration & environment variables
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ .env.example                # Environment variable template
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”œβ”€β”€ run.bat                     # Windows quick-run script
β”‚
β”œβ”€β”€ ai/                         # πŸ€– Decoupled AI Reasoning Engine
β”‚   β”œβ”€β”€ groq_api.py             # Groq & Gemini API client handler
β”‚   β”œβ”€β”€ prompts.py              # System prompt templates
β”‚   β”œβ”€β”€ recipe_generator.py     # Recipe synthesis module
β”‚   β”œβ”€β”€ meal_planner.py         # Meal plan engine
β”‚   β”œβ”€β”€ nutrition.py            # Nutrition calculator
β”‚   β”œβ”€β”€ allergy_checker.py      # Hard allergen exclusion logic
β”‚   β”œβ”€β”€ chatbot.py              # Cooking assistant module
β”‚   └── shopping_generator.py   # Shopping list AI generator
β”‚
β”œβ”€β”€ database/                   # πŸ—„οΈ Database Layer
β”‚   β”œβ”€β”€ chefmind.db             # SQLite database (auto-created)
β”‚   └── init_db.py              # Schema initialization & seed script
β”‚
β”œβ”€β”€ models/                     # πŸ“¦ Data Access Layer
β”‚   β”œβ”€β”€ database.py             # Connection pooling & query abstraction
β”‚   β”œβ”€β”€ user.py                 # User authentication & profiles
β”‚   β”œβ”€β”€ recipe.py               # Recipe data access model
β”‚   β”œβ”€β”€ history.py              # History logging model
β”‚   β”œβ”€β”€ mealplan.py             # Meal plan storage model
β”‚   β”œβ”€β”€ shopping.py             # Shopping list consolidation model
β”‚   └── favorites.py            # Saved bookmarks model
β”‚
β”œβ”€β”€ routes/                     # πŸ›£οΈ Modular Flask Blueprints
β”‚   β”œβ”€β”€ home.py                 # Landing page
β”‚   β”œβ”€β”€ auth.py                 # Login, signup, logout
β”‚   β”œβ”€β”€ recipe.py               # Recipe generation & display
β”‚   β”œβ”€β”€ mealplanner.py          # Meal plan creation
β”‚   β”œβ”€β”€ chatbot.py              # Chatbot interface
β”‚   β”œβ”€β”€ cookbook.py             # Static recipe catalogue
β”‚   β”œβ”€β”€ dashboard.py            # User dashboard & metrics
β”‚   β”œβ”€β”€ history.py              # Generation history
β”‚   β”œβ”€β”€ shopping.py             # Shopping list management
β”‚   └── profile.py              # User profile & settings
β”‚
β”œβ”€β”€ templates/                  # 🎨 Jinja2 HTML Templates
β”‚   └── (base.html + page-specific templates)
β”‚
└── static/                     # πŸ“‚ Static Assets
    β”œβ”€β”€ css/                    # Stylesheets
    β”œβ”€β”€ js/                     # JavaScript files
    └── images/                 # Image assets

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.10 or higher β€” Download Python
  • pip β€” comes bundled with Python
  • Git β€” Download Git
  • API keys for Groq and/or Google Gemini (free tiers available β€” see API Keys)

Installation

1. Clone the repository:

git clone https://github.com/YOUR_USERNAME/ChefMind_AI.git
cd ChefMind_AI

2. Create and activate a virtual environment (recommended):

# Windows
python -m venv .venv
.venv\Scripts\activate

# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies:

pip install -r requirements.txt

4. Set up environment variables (see Environment Variables below).

5. Initialize the database:

python database/init_db.py

Environment Variables

Copy the example file and fill in your credentials:

# Windows
copy .env.example .env

# macOS / Linux
cp .env.example .env

Then open .env and fill in your values:

# Flask Security β€” use a strong random string in production
SECRET_KEY=your_strong_random_secret_key_here

# Flask Settings
FLASK_DEBUG=True

# Database
DATABASE_TYPE=sqlite
DATABASE_PATH=database/chefmind.db

# AI API Keys (get yours for free β€” see API Keys section)
GROQ_API_KEY=your_groq_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here

⚠️ Security Warning: Never commit your .env file to GitHub. It is already excluded by .gitignore. Only .env.example (with no real keys) should be committed.


Running the App

Option 1 β€” Python directly:

python app.py

Option 2 β€” Windows batch script:

run.bat

Then open your browser and navigate to:

http://127.0.0.1:5000/

πŸ“± Usage

  1. Register a new account or log in with existing credentials.
  2. Navigate to Recipe Generator β†’ Enter your available ingredients, select cuisine & cooking time β†’ Get an AI-generated recipe instantly.
  3. Go to Meal Planner β†’ Choose your health goal β†’ Receive a complete 7-day meal plan.
  4. Use the Cooking Chatbot for ingredient substitutions, cooking tips, or any culinary questions.
  5. Check your Shopping List to see which ingredients are still needed.
  6. Browse the Cookbook for a curated collection of static recipes.
  7. Track your generation history and nutrition trends on the Dashboard.

πŸ”‘ API Keys

ChefMind AI uses two AI providers. You need at least one of the following:

Provider Free Tier Sign Up
Groq βœ… Very generous free tier console.groq.com
Google Gemini βœ… Free via AI Studio aistudio.google.com

The app uses Groq as the primary provider and falls back to Gemini when needed. Add both keys to your .env file for maximum reliability.


🀝 Contributing

Contributions are welcome and appreciated! Here's how to get started:

  1. Fork this repository on GitHub.
  2. Create a feature branch:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit with a clear message:
    git commit -m "feat: add your feature description"
  4. Push your branch:
    git push origin feature/your-feature-name
  5. Open a Pull Request against the main branch.

Contribution Guidelines

  • Follow the existing Blueprint-based modular structure for new routes.
  • Keep code clean, readable, and well-commented.
  • Do not commit .env, *.db files, or __pycache__ directories.
  • Test all changes locally before submitting a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.
Feel free to use, modify, and distribute this project with attribution.


πŸ™ Acknowledgements

  • Groq for blazing-fast LLM inference
  • Google DeepMind for the Gemini AI API
  • Flask for the excellent web framework
  • The open-source community for inspiration and tooling

Made with ❀️ and a lot of πŸ•

About

An intelligent cooking assistant featuring AI recipe generation, meal planning, cookbook management, and chatbot integration.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages