AI Kitchen is an intelligent recipe generation web application that provides personalized recipes, nutritional information, and cooking unit conversion tools powered by AI.
- π€ AI-Powered Recipe Generation - Get personalized recipes based on dish names
- π₯ Ingredient-Based Search - Find recipes from available ingredients with smart filtering (Tasty, Healthy, Quick)
- π Detailed Nutrition Info - Comprehensive nutritional breakdown for every recipe
- π Unit Normalizer - Convert cooking measurements between different units
- β€οΈ Favorite Recipes - Save and manage your favorite recipes locally
- π Ingredient Alternatives - Get smart ingredient substitution suggestions
- π Servings Adjustment - Dynamically scale ingredient quantities
- π¨ Modern UI - Beautiful, responsive interface with smooth animations
- π± Dietary Badges - Automatic detection of Vegan, Vegetarian, and Non-Veg dishes
- FastAPI - Modern Python web framework
- Google Gemini AI - Recipe generation and intelligence
- TheMealDB API - Recipe database
- Pexels API - High-quality food images
- HTTPX - Async HTTP client
- HTML5 - Semantic markup
- CSS3 - Modern styling with gradients and animations
- JavaScript (ES6+) - Interactive functionality
- Local Storage - Client-side data persistence
Before you begin, ensure you have the following installed:
- Python 3.8 or higher - Download Python
- pip - Python package manager (comes with Python)
- Git (optional) - For cloning the repository
bash
git clone cd recipe_unit_normalizer
bash
python -m venv venv venv\Scripts\activate
python3 -m venv venv source venv/bin/activate
bash pip install -r requirements.txt
The requirements.txt includes:
- fastapi==0.104.1
- uvicorn==0.24.0
- httpx==0.25.1
- python-dotenv==1.0.0
- google-generativeai==0.3.1
- requests==2.31.0
- pydantic==2.5.0
Create a .env file in the project root directory:
bash
copy .env.example .env
cp .env.example .env
Edit the .env file and add your API keys:
env GEMINI_API_KEY=your_google_gemini_api_key_here PEXELS_API_KEY=your_pexels_api_key_here
Google Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy and paste it into the
.envfile
Pexels API Key:
- Visit Pexels API
- Sign up for a free account
- Generate an API key
- Copy and paste it into the
.envfile
bash python app.py
The server will start on http://localhost:8001
You should see output similar to:
INFO: Started server process INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8001
Open your web browser and navigate to:
-
By Dish Name:
- Click on "New Recipe" mode
- Enter a dish name (e.g., "Chicken Biryani", "Vegan Buddha Bowl")
- Click the search button
- View detailed recipe with ingredients, instructions, and nutrition
-
By Ingredients:
- Click on "Parse Text" mode
- Enter available ingredients separated by commas
- Choose filter: Tasty, Healthy, or Quick
- Click search to get matching recipes
- Navigate to "Unit Normalizer" in the top menu
- Enter the value to convert
- Select the source unit (From)
- Select the target unit (To)
- Click "CONVERT" - the result appears instantly
- Click the heart icon on any recipe to save it
- Access saved recipes from "My Recipes" in the top menu
- Click on any saved recipe to view it again
- On any recipe, use the +/- buttons next to servings
- Ingredient quantities automatically scale
- Click "Replace" next to any ingredient
- View AI-suggested alternatives and substitution notes
recipe_unit_normalizer/ β βββ app.py # FastAPI backend server βββ index.html # Main HTML file βββ style.css # Styling and animations βββ script.js # Frontend JavaScript logic βββ requirements.txt # Python dependencies βββ .env # Environment variables (create this) βββ .env.example # Example environment file βββ README.md # This file
To change the server port, edit app.py:
python if name == "main": uvicorn.run(app, host="127.0.0.1", port=8001) # Change port here
CORS is configured to allow all origins. To restrict, edit in app.py:
python app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:8001"], # Specify allowed origins allow_credentials=True, allow_methods=[""], allow_headers=[""], )
Error: Address already in use
- Solution: Change the port in
app.pyor kill the process using port 8001
Error: No module named 'fastapi'
- Solution: Ensure you've activated the virtual environment and run
pip install -r requirements.txt
Error: Invalid API key
- Solution: Check that your
.envfile has valid API keys with no extra spaces
Error: Rate limit exceeded
- Solution: Wait a few minutes or upgrade your API plan
- Check browser console (F12) for JavaScript errors
- Ensure
style.cssandscript.jsare in the same directory asindex.html - Clear browser cache (Ctrl+Shift+R)
- Check server logs for API errors
- Verify internet connection
- Ensure backend is running on
http://localhost:8001
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is open source and available under the MIT License.
- Google Gemini AI - Recipe generation
- TheMealDB - Recipe database
- Pexels - Food photography
- FastAPI - Web framework
- Unsplash - Additional food images
For issues or questions, please open an issue on the repository or contact the maintainer.
Made with β€οΈ and AI
it is for helping people across all our world to normalize the unites and also sharing recipe.
AI Kitchen is an intelligent recipe generation web application that provides personalized recipes, nutritional information, and cooking unit conversion tools powered by AI.
- π€ AI-Powered Recipe Generation - Get personalized recipes based on dish names
- π₯ Ingredient-Based Search - Find recipes from available ingredients with smart filtering (Tasty, Healthy, Quick)
- π Detailed Nutrition Info - Comprehensive nutritional breakdown for every recipe
- π Unit Normalizer - Convert cooking measurements between different units
- β€οΈ Favorite Recipes - Save and manage your favorite recipes locally
- π Ingredient Alternatives - Get smart ingredient substitution suggestions
- π Servings Adjustment - Dynamically scale ingredient quantities
- π¨ Modern UI - Beautiful, responsive interface with smooth animations
- π± Dietary Badges - Automatic detection of Vegan, Vegetarian, and Non-Veg dishes
- FastAPI - Modern Python web framework
- Google Gemini AI - Recipe generation and intelligence
- TheMealDB API - Recipe database
- Pexels API - High-quality food images
- HTTPX - Async HTTP client
- HTML5 - Semantic markup
- CSS3 - Modern styling with gradients and animations
- JavaScript (ES6+) - Interactive functionality
- Local Storage - Client-side data persistence
Before you begin, ensure you have the following installed:
- Python 3.8 or higher - Download Python
- pip - Python package manager (comes with Python)
- Git (optional) - For cloning the repository
# If using Git
git clone <your-repository-url>
cd recipe_unit_normalizer
# Or download and extract the ZIP file# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtThe requirements.txt includes:
- fastapi==0.104.1
- uvicorn==0.24.0
- httpx==0.25.1
- python-dotenv==1.0.0
- google-generativeai==0.3.1
- requests==2.31.0
- pydantic==2.5.0
Create a .env file in the project root directory:
# Windows
copy .env.example .env
# macOS/Linux
cp .env.example .envEdit the .env file and add your API keys:
GEMINI_API_KEY=your_google_gemini_api_key_here
PEXELS_API_KEY=your_pexels_api_key_hereGoogle Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy and paste it into the
.envfile
Pexels API Key:
- Visit Pexels API
- Sign up for a free account
- Generate an API key
- Copy and paste it into the
.envfile
python app.pyThe server will start on http://localhost:8001
You should see output similar to:
INFO: Started server process
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8001
Open your web browser and navigate to:
http://localhost:8001
-
By Dish Name:
- Click on "New Recipe" mode
- Enter a dish name (e.g., "Chicken Biryani", "Vegan Buddha Bowl")
- Click the search button
- View detailed recipe with ingredients, instructions, and nutrition
-
By Ingredients:
- Click on "Parse Text" mode
- Enter available ingredients separated by commas
- Choose filter: Tasty, Healthy, or Quick
- Click search to get matching recipes
- Navigate to "Unit Normalizer" in the top menu
- Enter the value to convert
- Select the source unit (From)
- Select the target unit (To)
- Click "CONVERT" - the result appears instantly
- Click the heart icon on any recipe to save it
- Access saved recipes from "My Recipes" in the top menu
- Click on any saved recipe to view it again
- On any recipe, use the +/- buttons next to servings
- Ingredient quantities automatically scale
- Click "Replace" next to any ingredient
- View AI-suggested alternatives and substitution notes
recipe_unit_normalizer/
β
βββ app.py # FastAPI backend server
βββ index.html # Main HTML file
βββ style.css # Styling and animations
βββ script.js # Frontend JavaScript logic
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (create this)
βββ .env.example # Example environment file
βββ README.md # This file
To change the server port, edit app.py:
if __name__ == "__main__":
uvicorn.run(app, host="127.0.0.1", port=8001) # Change port hereCORS is configured to allow all origins. To restrict, edit in app.py:
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:8001"], # Specify allowed origins
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)Error: Address already in use
- Solution: Change the port in
app.pyor kill the process using port 8001
Error: No module named 'fastapi'
- Solution: Ensure you've activated the virtual environment and run
pip install -r requirements.txt
Error: Invalid API key
- Solution: Check that your
.envfile has valid API keys with no extra spaces
Error: Rate limit exceeded
- Solution: Wait a few minutes or upgrade your API plan
- Check browser console (F12) for JavaScript errors
- Ensure
style.cssandscript.jsare in the same directory asindex.html - Clear browser cache (Ctrl+Shift+R)
- Check server logs for API errors
- Verify internet connection
- Ensure backend is running on
http://localhost:8001
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is open source and available under the MIT License.
- Google Gemini AI - Recipe generation
- TheMealDB - Recipe database
- Pexels - Food photography
- FastAPI - Web framework
- Unsplash - Additional food images
For issues or questions, please open an issue on the repository or contact the maintainer.
Made with β€οΈ and AI