Transforming leftover ingredients into culinary masterpieces through a synergistic algorithmic pipeline.
Features · Algorithms · Tech Stack · Local Setup · Deployment
PantryIQ is not just another recipe finder. It's an intelligent culinary assistant engineered to solve the "what can I make?" problem with computational precision. By leveraging a sophisticated blend of graph theory, backtracking, and greedy algorithms, PantryIQ models the complex relationships between ingredients to deliver optimal, context-aware recipe suggestions from what you already have in your kitchen.
Our vision is to minimize food waste and maximize culinary creativity, transforming the home cooking experience from a daily chore into a delightful exploration of flavors.
- Intelligent Recipe Suggestions: Dynamically generates recipes based on available ingredients, dietary needs, and cuisine preferences.
- Ingredient Gap Analysis: Identifies missing ingredients for a target recipe and provides the best available substitutions from your pantry.
- Graph-Powered Substitutions: Utilizes a complex ingredient relationship graph to find smart, context-aware ingredient alternatives.
- Optimal Meal Planning: Employs backtracking to find the best combination of recipes, maximizing ingredient usage and minimizing waste.
- Real-time Algorithm Metrics: A unique
/api/algorithms/demoendpoint showcases the performance and complexity of the underlying algorithms for academic and demonstration purposes.
PantryIQ's intelligence is powered by a three-stage pipeline that ensures both speed and optimality.
| Algorithm | Role | Time Complexity |
|---|---|---|
| 1. Greedy Algorithm | The Fast Filter: Rapidly scores and selects a pool of high-potential candidate recipes based on ingredient match ratios. | O(n log n) |
| 2. Graph Theory | The Relationship Expert: Analyzes the candidate pool using a NetworkX ingredient graph to find substitutions and complementary flavors. | O(V + E) |
| 3. Backtracking | The Optimizer: Performs an exhaustive, pruned search on the enhanced candidates to find the optimal recipe combination that satisfies all constraints. | O(2^n) worst-case (heavily optimized via pruning) |
This synergistic approach allows PantryIQ to navigate a vast combinatorial space efficiently, delivering human-like intuition at machine speed.
PantryIQ is built with a modern, high-performance technology stack designed for scalability and maintainability.
| Category | Technologies |
|---|---|
| Frontend | Next.js, React, TypeScript, Tailwind CSS, shadcn/ui |
| Backend | Python, FastAPI, Gunicorn, Uvicorn |
| Algorithms & Data | NetworkX (Graph Theory), Pydantic (Data Validation) |
| Auth & Database | Supabase (PostgreSQL, Auth) |
| Deployment | Render, GitHub |
# Navigate to the backend directory
cd backend
# Create and activate a Python virtual environment
python -m venv venv
source venv/bin/activate # For macOS/Linux
# venv\Scripts\activate # For Windows
# Install dependencies
pip install -r requirements.txt
# Run the development server
uvicorn main:app --reload
### 1. Backend Setup
# Navigate to the backend directory
cd backend
# Create and activate a Python virtual environment
python -m venv venv
source venv/bin/activate # For macOS/Linux
# venv\Scripts\activate # For Windows
# Install dependencies
pip install -r requirements.txt
# Run the development server
uvicorn main:app --reload