A React + Vite app for AI-powered recipe discovery and personalized recipe collections.
🔗 Live Demo: https://recipe-finder-gamma-ten.vercel.app
Topics: recipes · react · vite · firebase · openai · gpt-4 · ai · food · vercel · image-recognition
An intelligent recipe discovery app that uses AI to analyze food images and generate personalized recipes. Upload a photo of any dish or explore trending recipes to get detailed cooking instructions tailored to your dietary preferences.
Many people face the challenge of cooking for multiple household members with varying dietary restrictions and preferences. Home cooks often struggle to create meals that accommodate everyone's needs while working within their own cooking skill limitations. Recipe Finder addresses this problem by providing an intelligent solution that generates personalized recipes based on visual inputs and customizable dietary filters, making it easy for anyone to cook delicious meals that satisfy everyone at the table.
- ✨ Features
- 🚀 Getting Started
- 🏗️ Architecture
- 🎮 Usage
- 🔧 Configuration
- 🚀 Deployment
- 🤝 Contributing
- 📝 License
- 🙋♂️ Support
- 🎯 Future Enhancements
- AI-Powered Recipe Generation: Upload an image of any dish and get detailed recipes generated by OpenAI's GPT-4
- Image Analysis: Advanced computer vision to identify ingredients and cooking methods from photos
- Trending Recipes Carousel: Discover popular recipes with auto-cycling display and manual navigation
- Interactive Recipe Cards: Click on trending recipes to get AI-generated cooking instructions
- Smart Filters: Vegetarian, Vegan, Gluten-Free options with custom filter support
- Personalized Results: Recipes adapted to your specific dietary restrictions and preferences
- Filter Memory: Your preferences are remembered across sessions
- Google Authentication: Secure sign-in with Google accounts via Firebase Auth
- User Profiles: Customizable profiles with Google profile picture integration
- Profile Management: Add bio, cooking utensils, and personal information
- Secure Sign-out: Complete data clearing on logout
- Recent Recipes: Automatic tracking of your last 3 generated recipes
- Saved Recipes: Heart/favorite system to save recipes for later
- Recipe History: Browse through your cooking journey
- Duplicate Prevention: Smart detection to avoid saving identical recipes
- Drag & Drop Upload: Intuitive file upload with visual feedback
- Loading Animations: Engaging loading screens with cooking tips
- Responsive Design: Works seamlessly across desktop and mobile devices
- Error Handling: Graceful fallbacks and user-friendly error messages
- Recipe Sharing: Share your favorite recipes with others
- Similar Recipe Detection: Finds existing recipes that match your filters before generating new ones
- Recipe Deduplication: Prevents duplicate entries in your saved and recent recipes
- Automatic Image Optimization: Handles various image formats and sizes
- Context Preservation: Maintains state across page navigation
- Node.js (v16 or higher)
- npm
- OpenAI API key
- Firebase project (for authentication)
-
Clone the repository
git clone https://github.com/bmidd0170-sys/Recipe-Finder.git cd "Recipe Finder"
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:VITE_OPENAI_API_KEY=your_openai_api_key_here VITE_FIREBASE_API_KEY=your_firebase_api_key VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
-
Configure Firebase
- Create a Firebase project at https://console.firebase.google.com
- Enable Authentication with Google provider
- Add your domain to authorized domains
- Update the Firebase config in
src/config/firebase.js
-
Run the application
npm run dev
- Frontend: React 18 with Vite
- Routing: React Router v6
- State Management: React Context API
- Authentication: Firebase Auth
- AI Integration: OpenAI GPT-4 Vision API
- HTTP Client: Fetch API with React Query
- Styling: CSS3 with custom properties
- Build Tool: Vite
src/
├── components/ # Reusable UI components
│ ├── TrendingCarousel.jsx
│ ├── LoadingScreen.jsx
│ ├── ProfileContext.jsx
│ └── ...
├── Context/ # React Context providers
│ ├── AuthContext.jsx
│ ├── RecipeSaves.jsx
│ └── RecentRecipesContext.jsx
├── pages/ # Main page components
│ ├── MainPage.jsx
│ ├── Profile.jsx
│ ├── ResultsPage.jsx
│ └── ...
├── hook/ # Custom React hooks
│ └── useGenerateRecipe.js
├── data/ # Mock data and constants
│ └── mockData.js
├── config/ # Configuration files
│ └── firebase.js
└── utils/ # Utility functions
- Uses OpenAI's GPT-4 Vision model for image analysis
- Converts images to base64 for API transmission
- Implements retry logic and error handling
- Optimizes prompts for cooking-specific responses
- Context API for global state (auth, recipes, profile)
- Local storage for data persistence
- Automatic cleanup on sign-out
- State synchronization across components
- Firebase Google OAuth integration
- Protected routes for authenticated features
- Automatic profile creation from Google account
- Secure token management
-
Upload a Recipe Image
- Drag and drop or click to select an image
- Apply dietary filters if needed
- Wait for AI analysis and recipe generation
-
Explore Trending Recipes
- Browse the auto-cycling carousel
- Click on any trending recipe for instant AI-generated instructions
- View detailed ingredients and cooking steps
-
Manage Your Recipes
- Save favorite recipes with the heart icon
- View recent recipe history in your profile
- Organize and revisit your cooking discoveries
-
Customize Your Profile
- Sign in with Google for personalized experience
- Add profile information and cooking preferences
- Upload custom profile pictures
Update src/config/firebase.js with your Firebase project configuration:
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-auth-domain",
projectId: "your-project-id",
// ... other config
};The app uses OpenAI's GPT-4 Vision API. Ensure your API key has access to:
- GPT-4 Vision model
- Sufficient usage quotas
- Proper rate limiting setup
npm run build- Connect your repository
- Set environment variables in the deployment platform
- Configure build settings (build command:
npm run build, output directory:dist)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or run into issues:
- Create an issue in this repository
- Check the documentation above
- Review the code comments for implementation details
- Recipe rating and review system
- Social sharing capabilities
- Advanced dietary restriction support
- Recipe video generation
- Cooking time estimation
- Nutritional information display
- Recipe scaling (serving size adjustment)
- Shopping list generation
- Ai Video follow along
- Chatbot that helps awnser anyquestions and helps modify the recipe
Built with ❤️ using React, OpenAI, and Firebase