Skip to content

Cloudflare Pages React app for meal planning; integrates Supabase, Spoonacular, and Kroger for search, pricing, and lists.

License

Notifications You must be signed in to change notification settings

cyberdataint/Recipe_Wizard

🍳 Recipe Wizard

A modern, full-featured recipe management application built with React and Vite. Search recipes, manage your pantry, create shopping lists, and chat with an AI assistant powered by Google Gemini. Get real-time pricing from Kroger stores!

Live site

Hosted on Cloudflare Pages: https://recipe-wizard.pages.dev/

✨ Features

  • οΏ½ Recipe Search - Find recipes by name or ingredients using Spoonacular API
  • πŸ€– AI Chat Assistant - Natural language conversation with Gemini AI to find recipes, add items to pantry/shopping list
  • οΏ½ Pantry Management - Track ingredients you have at home
  • πŸ›’ Smart Shopping List - Create shopping lists with real-time Kroger pricing and availability
  • πŸ’° Price Estimation - See estimated cart totals from Kroger stores
  • πŸ” User Authentication - Secure sign-in with Supabase
  • πŸ’Ύ Persistent Storage - All data saved to your account
  • πŸ“± Responsive Design - Works on desktop and mobile

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Local Development

  1. Clone the repository
git clone https://github.com/cyberdataint/Recipe_Wizard.git
cd Recipe_Wizard
  1. Install dependencies
npm install
  1. Set up environment variables

    Create a .env file in the root directory:

    VITE_SUPABASE_URL=your_supabase_project_url
    VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
    VITE_SPOONACULAR_API_KEY=your_spoonacular_api_key
    VITE_GEMINI_API_KEY=your_google_gemini_api_key
    VITE_KROGER_CLIENT_ID=your_kroger_client_id
    VITE_KROGER_CLIENT_SECRET=your_kroger_client_secret
  2. Start the development server

npm run dev
  1. Open your browser to http://localhost:5173 (or the port shown in your terminal)

πŸš€ NPM Commands

Command Description
npm install Install all dependencies
npm run dev Start Vite development server (port 5173)

| npm run build | Build for production | | npm run preview | Preview production build |

Running the App

For full functionality, you need TWO terminals:

Terminal 1 - Frontend:

npm run dev

πŸ“– Usage

Recipe Search Tab

  • Search by recipe name: "chocolate cake"
  • Search by ingredients: "chicken, rice, broccoli"
  • Click any recipe to see full details and ingredients

Pantry Tab

  • Add ingredients you have at home
  • Track quantities and expiration dates
  • Organized by category

Shopping List Tab

  • Add items you need to buy
  • Click "Get Prices" to fetch real-time Kroger pricing
  • See estimated cart total
  • Check off items as you shop

Chat Tab

  • Ask the AI assistant for recipe suggestions
  • Natural language requests: "Add milk and eggs to my shopping list"
  • Get cooking tips and ingredient substitutions
  • Chat history is saved to your account

πŸ”Œ APIs Used

πŸ› οΈ Technologies Used

  • React 19.1.1 - UI framework
  • Vite 7.1.2 - Build tool and dev server
  • Supabase - Backend (PostgreSQL + Auth)
  • Google Gemini AI - LLM with function calling
  • Express - Proxy server for Kroger API
  • Spoonacular API - Recipe database
  • Kroger API - Product pricing

πŸ“ Project Structure

Recipe_Wizard/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.jsx                      # Main orchestrator - handles tab switching
β”‚   β”œβ”€β”€ main.jsx                     # React entry point
β”‚   β”œβ”€β”€ Supabase.jsx                 # Supabase client configuration
β”‚   β”œβ”€β”€ KrogerAPI.jsx                # Kroger API service with OAuth
β”‚   β”œβ”€β”€ FavoritesAPI.jsx             # Supabase helpers for favorites (recipes/ingredients)
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Recipes.jsx              # Recipe search (Spoonacular)
β”‚   β”‚   β”œβ”€β”€ Pantry.jsx               # Pantry management (Supabase)
β”‚   β”‚   β”œβ”€β”€ ShoppingList.jsx         # Shopping list with pricing (Supabase + Kroger)
β”‚   β”‚   β”œβ”€β”€ Chat.jsx                 # Gemini AI chatbot with function calling
β”‚   β”‚   β”œβ”€β”€ Auth.jsx                 # Sign in/up UI
β”‚   β”‚   └── TopNav.jsx               # Tab navigation bar
β”‚   └── contexts/
β”‚       └── AuthContext.jsx          # Supabase authentication provider
β”œβ”€β”€ kroger-proxy-server.js           # Express server for Kroger API (avoids CORS)
β”œβ”€β”€ supabase_chat_table.sql          # Database schema for chat messages
β”œβ”€β”€ test-kroger-auth.js              # Test script for Kroger credentials
β”œβ”€β”€ .env                             # Environment variables (create this)
└── package.json                     # Dependencies and scripts

⭐ Favorites (Recipes & Ingredients)

This app supports favoriting recipes and ingredients per user using Supabase. Add a star next to a recipe or shopping-list ingredient to save it.

πŸ“ Use My Location (Store Picker)

The Store Picker now supports a "Use my location" button. When clicked, your browser (Edge, Chrome, or Firefox) asks for permission to access your location. If granted, it finds nearby Kroger stores using latitude/longitude and fills the ZIP automatically from the nearest store. You can still search by ZIP manually.

Troubleshooting:

  • If your browser blocks location, allow it in site permissions.
  • On desktop, geolocation may use IP-based estimates; results can be broader than on mobile.

About

Cloudflare Pages React app for meal planning; integrates Supabase, Spoonacular, and Kroger for search, pricing, and lists.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 6