Thanks to visit codestin.com
Credit goes to github.com

Skip to content

D-Raj-Grg/AI-Recipe-Generator

Repository files navigation

🍳 ChefMate - AI Recipe Generator

Your AI Kitchen Companion. Transform ingredients into delicious meals in seconds.

Next.js TypeScript Tailwind CSS License: MIT

ChefMate is an intelligent recipe generator powered by AI that helps you create personalized recipes from ingredients you have on hand. Reduce food waste, save time meal planning, and discover new dishes tailored to your dietary preferences.

🌐 Live Demo: https://ai-recipe-generator-raj.vercel.app/


✨ Features

Core Features

  • πŸ€– AI-Powered Recipe Generation - Generate 3-5 personalized recipes in seconds using OpenAI
  • πŸ₯— Dietary Restrictions - Support for 10+ dietary preferences (vegan, keto, gluten-free, etc.)
  • 🌍 Multi-Cuisine Support - 13 cuisines from Italian to Vietnamese
  • ⚑ Smart Ingredient Matching - Works with partial lists and suggests missing ingredients
  • πŸ“± Mobile-First Design - Fully responsive with dedicated mobile navigation
  • πŸŒ™ Dark Mode - System-aware theme switching

User Experience

  • πŸ’Ύ Local Storage - Save recipes, history, and preferences (privacy-first, no server storage)
  • πŸ”– Bookmark System - Save your favorite recipes for quick access
  • πŸ“œ Recipe History - Track the last 20 recipes you've generated or viewed
  • πŸ” Search & Filter - Find recipes by name, cuisine, meal type, or difficulty
  • 🎲 Surprise Me - Random recipe generation for when you're feeling adventurous
  • πŸ–¨οΈ Print-Friendly - Clean print layouts optimized for A4 paper
  • πŸ”— Easy Sharing - Share recipes via Twitter, Facebook, WhatsApp, or copy link

Advanced Features

  • πŸ“Š Serving Size Adjuster - Scale recipes from 0.5x to 3x servings
  • πŸ“ˆ Nutritional Information - Estimated calories, protein, carbs, and fat per serving
  • ⏱️ Cooking Time Filters - Filter by prep time (15min, 30min, 60min+)
  • 🍽️ Occasion-Based Browsing - Quick weeknight dinners, meal prep, party appetizers
  • β™Ώ Full Accessibility - WCAG AA compliant with keyboard navigation and screen reader support
  • πŸš€ Performance Optimized - Server-side rendering, code splitting, and optimized bundles

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm
  • OpenAI API key (Get one here)

Installation

  1. Clone the repository

    git clone https://github.com/D-Raj-Grg/AI-Recipe-Generator.git
    cd AI-Recipe-Generator
  2. Install dependencies

    pnpm install
    # or
    npm install
  3. Set up environment variables

    cp .env.local.example .env.local

    Edit .env.local and add your OpenAI API key:

    OPENAI_API_KEY=sk-your-actual-api-key-here
    NEXT_PUBLIC_APP_URL=http://localhost:3000
  4. Run the development server

    pnpm dev
    # or
    npm run dev
  5. Open in browser Navigate to http://localhost:3000


πŸ› οΈ Tech Stack

Framework & Language

Styling & UI

State & Data

  • Zustand - Lightweight state management
  • localStorage - Client-side recipe persistence
  • OpenAI API - GPT-4o for recipe generation

Developer Experience

  • ESLint - Code linting
  • PostCSS - CSS processing
  • pnpm - Fast, disk space efficient package manager

Analytics & Performance


πŸ“ Project Structure

AI-Recipe-Generator/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   β”‚   └── recipe/
β”‚   β”‚   β”‚       └── generate/     # Recipe generation endpoint
β”‚   β”‚   β”œβ”€β”€ contact/              # Contact page
β”‚   β”‚   β”œβ”€β”€ explore/              # Recipe exploration page
β”‚   β”‚   β”œβ”€β”€ faq/                  # FAQ page
β”‚   β”‚   β”œβ”€β”€ generate/             # Main recipe generator
β”‚   β”‚   β”œβ”€β”€ history/              # Recipe history page
β”‚   β”‚   β”œβ”€β”€ preferences/          # User preferences page
β”‚   β”‚   β”œβ”€β”€ privacy/              # Privacy policy
β”‚   β”‚   β”œβ”€β”€ recipe/[id]/          # Recipe detail pages
β”‚   β”‚   β”œβ”€β”€ saved/                # Bookmarked recipes
β”‚   β”‚   β”œβ”€β”€ terms/                # Terms of service
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Landing page
β”‚   β”‚   β”œβ”€β”€ globals.css           # Global styles
β”‚   β”‚   β”œβ”€β”€ not-found.tsx         # 404 page
β”‚   β”‚   β”œβ”€β”€ error.tsx             # Error boundary
β”‚   β”‚   β”œβ”€β”€ sitemap.ts            # Sitemap generation
β”‚   β”‚   └── robots.ts             # Robots.txt
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ filters/              # Filter components
β”‚   β”‚   β”œβ”€β”€ navigation/           # Navigation components
β”‚   β”‚   β”œβ”€β”€ recipe/               # Recipe-related components
β”‚   β”‚   └── ui/                   # shadcn/ui components
β”‚   β”œβ”€β”€ lib/                      # Utility libraries
β”‚   β”‚   β”œβ”€β”€ analytics.ts          # Event tracking utilities
β”‚   β”‚   β”œβ”€β”€ openai.ts             # OpenAI client
β”‚   β”‚   β”œβ”€β”€ prompts.ts            # Recipe generation prompts
β”‚   β”‚   β”œβ”€β”€ types/                # TypeScript types
β”‚   β”‚   └── utils.ts              # Helper functions
β”‚   └── store/                    # State management
β”‚       └── useRecipeStore.ts     # Zustand store
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ icon.svg                  # Favicon
β”‚   └── manifest.json             # PWA manifest
β”œβ”€β”€ .env.local.example            # Environment variables template
β”œβ”€β”€ tailwind.config.ts            # Tailwind configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
β”œβ”€β”€ components.json               # shadcn/ui configuration
β”œβ”€β”€ CLAUDE.md                     # Development guide
β”œβ”€β”€ PRD.md                        # Product requirements
β”œβ”€β”€ PLANNING.md                   # Product planning
└── TASKS.md                      # Task tracker

🎨 Design System

Color Palette

  • Primary: Orange/Amber gradient (hsl(32 95% 44%)) - Appetizing warmth
  • Secondary: Emerald (hsl(160 84% 39%)) - Fresh, healthy
  • Accent: Rose (hsl(346 77% 50%)) - Spicy, exciting
  • Background (Light): Warm cream (hsl(33 100% 97%))
  • Background (Dark): Deep slate (hsl(222 47% 11%))

All colors use CSS variables with separate light/dark mode values. Components reference colors via Tailwind classes like bg-primary, text-muted-foreground.

Typography

  • System Fonts - Native font stack for optimal performance
  • Font Sizes - Minimum 16px for readability
  • Line Height - Optimized for reading recipes

πŸ“¦ Available Scripts

# Development
pnpm dev              # Start dev server (localhost:3000)
pnpm build            # Create production build
pnpm start            # Run production build locally
pnpm lint             # Run ESLint

# Testing
pnpm lint             # Check code quality

# Dependencies
pnpm install          # Install all dependencies
pnpm add <package>    # Add new dependency

🌐 Deployment

Deploy to Vercel (Recommended)

Deploy with Vercel

  1. Push your code to GitHub
  2. Import your repository on Vercel
  3. Add environment variables:
    • OPENAI_API_KEY - Your OpenAI API key
    • NEXT_PUBLIC_APP_URL - Your production URL
  4. Deploy!

Vercel automatically enables:

  • βœ… Analytics
  • βœ… Speed Insights
  • βœ… Automatic HTTPS
  • βœ… CDN distribution
  • βœ… Preview deployments

Other Platforms

  • Netlify: Use next build and deploy the .next folder
  • Docker: Dockerfile can be added for containerized deployment
  • Self-hosted: Run pnpm build && pnpm start on your server

πŸ”’ Privacy & Security

ChefMate follows a privacy-first approach:

  • βœ… No server-side storage - All recipes stored locally in your browser
  • βœ… Minimal data collection - Only anonymous analytics via Vercel
  • βœ… OpenAI API - Ingredient data sent temporarily for generation only
  • βœ… No tracking cookies - GDPR compliant by design
  • βœ… Open source - Full code transparency

See Privacy Policy for details.


πŸ’° Cost Estimates

OpenAI API Costs

  • GPT-4o: ~$0.005 per recipe generation (recommended)
  • GPT-4o-mini: ~$0.0001 per recipe generation (budget-friendly)

With 15 recipes/hour rate limiting:

  • GPT-4o: $0.075/hour max ($54/month at full capacity)
  • GPT-4o-mini: $0.0015/hour max ($1/month at full capacity)

Hosting (Vercel)

  • Hobby Plan: FREE (includes 100GB bandwidth, Analytics)
  • Pro Plan: $20/month (for production apps with custom domains)

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Quick start for contributors:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run pnpm lint and pnpm build to verify
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • OpenAI - For the amazing GPT-4o model
  • Vercel - For hosting and deployment platform
  • shadcn/ui - For the beautiful component library
  • Tailwind CSS - For the utility-first CSS framework

πŸ“§ Contact & Support


πŸ—ΊοΈ Roadmap

Phase 1: Core Features βœ…

  • Recipe generation
  • Ingredient input
  • Dietary restrictions
  • Recipe detail pages

Phase 2: Personalization βœ…

  • Bookmark system
  • Recipe history
  • Preferences management
  • Serving size adjustment

Phase 3: Discovery βœ…

  • Explore page
  • Search functionality
  • Print/share features
  • Mobile navigation

Phase 4: Polish πŸ”„ (Current)

  • Legal pages (Terms, Privacy, FAQ, Contact)
  • Footer with links
  • Analytics integration
  • Performance optimization
  • Cross-browser testing

Future Enhancements πŸš€

  • User accounts (optional cloud sync)
  • Shopping list generation
  • Meal planning calendar
  • Recipe ratings and reviews
  • Social features (share recipes with community)
  • Mobile app (React Native)
  • Recipe image generation (DALL-E)
  • Voice input for ingredients
  • Multi-language support

Made with ❀️ by the ChefMate Team

⭐ Star us on GitHub if you like ChefMate!

Website β€’ Report Bug β€’ Request Feature

About

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •