A smart cooking assistant application built with React, TypeScript, and Supabase that helps users manage ingredients, discover recipes, and get AI-powered recommendations.
- Ingredient Management: Track your available ingredients with quantities, units, and expiry dates
- Recipe Collection: Create, edit, and manage your personal recipe collection
- Weekly Meal Planning: Plan your meals for the week and generate shopping lists
- AI Recipe Suggestions: Get personalized recipe suggestions using Google's Gemini AI
- Dataset Recommendations: Discover popular recipes from a curated dataset
- RAG (Retrieval-Augmented Generation): Advanced semantic search using vector embeddings
- Semantic Search: Find recipes based on meaning, not just keywords
- Vector Similarity: Uses pgvector for efficient similarity search
- Background Sync: Embeddings are generated and updated automatically via cron jobs
- Frontend: React 18, TypeScript, Tailwind CSS
- Backend: Supabase (PostgreSQL + Edge Functions)
- AI/ML: Google Gemini AI, pgvector for embeddings
- Icons: Lucide React
- Build Tool: Vite
ingredients- User's ingredient inventoryrecipes- User's personal recipesrecipe_ingredients- Recipe ingredient relationshipsweekly_plans- Weekly meal planningdaily_meals- Daily meal assignments
dataset_recipes- Curated recipe datasetrecipe_embeddings- Vector embeddings for semantic search
- Node.js 18+
- Supabase account
- Google AI API key (for Gemini)
Create a .env file with:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_GOOGLE_AI_API_KEY=your_google_ai_api_key# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run buildThe application includes Supabase migrations that will:
- Create all necessary tables
- Set up Row Level Security (RLS) policies
- Enable pgvector extension
- Create vector similarity functions
The application uses a background cron job to generate and sync recipe embeddings:
- Processes recipes without embeddings
- Generates vector embeddings for semantic search
- Runs automatically via cron job
- Can be triggered manually for testing
Set up a cron job to call the sync function regularly:
# Run every 6 hours
0 */6 * * * curl -X POST "https://your-project.supabase.co/functions/v1/sync-embeddings" \
-H "Authorization: Bearer YOUR_ANON_KEY"- Add ingredients with quantities, units, and categories
- Track expiry dates
- Organize by categories (vegetables, meat, dairy, etc.)
- Create detailed recipes with ingredients and instructions
- Set cooking times, difficulty levels, and serving sizes
- Add tags for easy categorization
- Uses Google Gemini AI to generate recipes based on available ingredients
- Provides Indonesian-style recipes with local ingredients
- Saves generated recipes to your collection
- Recommends recipes from a curated dataset of popular recipes
- Filters by ingredient availability and popularity
- Shows match scores and reasons for recommendations
- Advanced semantic search using vector embeddings
- Understands context and meaning beyond keyword matching
- Background processing ensures fast response times
- Confidence scoring for recommendation quality
- Plan meals for the entire week
- Automatically generate shopping lists
- Track what ingredients you already have
- Uses pgvector extension for efficient similarity search
- 384-dimensional embeddings for recipe content
- Cosine similarity for finding related recipes
- Background sync prevents user-facing delays
- Comprehensive RLS policies for data protection
- Users can only access their own data
- Service role for background operations
- Public access for dataset recipes
- Background embedding generation
- Efficient vector indexing
- Caching strategies for embeddings
- Fallback mechanisms for reliability
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.