Intelligent Food & Nutrition Assistant powered by Groq & Gemini AI
Turn your available ingredients into delicious recipes, weekly meal plans, and smart grocery lists β instantly.
- Overview
- Key Features
- Tech Stack
- Project Structure
- Getting Started
- Usage
- API Keys
- Contributing
- License
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.
| 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 |
- 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
- Groq API β Ultra-fast LLM inference (LLaMA models)
- Google Gemini API β Multimodal AI capabilities
- Jinja2 β Server-side HTML templating
- Vanilla CSS + JavaScript β Custom responsive UI with animations
- Google Fonts β Modern typography
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
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)
1. Clone the repository:
git clone https://github.com/YOUR_USERNAME/ChefMind_AI.git
cd ChefMind_AI2. Create and activate a virtual environment (recommended):
# Windows
python -m venv .venv
.venv\Scripts\activate
# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate3. Install dependencies:
pip install -r requirements.txt4. Set up environment variables (see Environment Variables below).
5. Initialize the database:
python database/init_db.pyCopy the example file and fill in your credentials:
# Windows
copy .env.example .env
# macOS / Linux
cp .env.example .envThen 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.envfile to GitHub. It is already excluded by.gitignore. Only.env.example(with no real keys) should be committed.
Option 1 β Python directly:
python app.pyOption 2 β Windows batch script:
run.batThen open your browser and navigate to:
http://127.0.0.1:5000/
- Register a new account or log in with existing credentials.
- Navigate to Recipe Generator β Enter your available ingredients, select cuisine & cooking time β Get an AI-generated recipe instantly.
- Go to Meal Planner β Choose your health goal β Receive a complete 7-day meal plan.
- Use the Cooking Chatbot for ingredient substitutions, cooking tips, or any culinary questions.
- Check your Shopping List to see which ingredients are still needed.
- Browse the Cookbook for a curated collection of static recipes.
- Track your generation history and nutrition trends on the Dashboard.
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.
Contributions are welcome and appreciated! Here's how to get started:
- Fork this repository on GitHub.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes and commit with a clear message:
git commit -m "feat: add your feature description" - Push your branch:
git push origin feature/your-feature-name
- Open a Pull Request against the
mainbranch.
- Follow the existing Blueprint-based modular structure for new routes.
- Keep code clean, readable, and well-commented.
- Do not commit
.env,*.dbfiles, or__pycache__directories. - Test all changes locally before submitting a Pull Request.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute this project with attribution.
- 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 π