Skip to content

bravichandra12/Flavor-Fusion-PR201

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍳 Flavor Fusion

AI-Powered Recipe Generation Platform

Next.js React TypeScript Prisma NextAuth

Flavor Fusion is an innovative AI-powered recipe generation platform that helps users create delicious recipes based on their preferences, ingredients, and dietary requirements. Whether you're looking to use up leftovers or explore new culinary adventures, Flavor Fusion makes cooking accessible and exciting for everyone.

✨ Features

πŸ€– AI Recipe Generation

  • Smart Recipe Creation: Generate personalized recipes using advanced AI (Groq/OpenAI)
  • Ingredient-Based Recipes: Turn your available ingredients into delicious meals
  • Dietary Preferences: Support for vegetarian, vegan, gluten-free, and other dietary restrictions
  • Indian Cuisine Focus: Specialized in generating authentic Indian recipes with detailed instructions

πŸ“Έ Visual Recipe Discovery

  • Ingredient Photo Recognition: Upload photos of ingredients to get matching recipes
  • Recipe Gallery: Browse through curated recipe collections
  • Visual Recipe Cards: Beautiful presentation of generated recipes

πŸ‘€ User Management

  • Secure Authentication: Google OAuth integration via NextAuth.js
  • User Profiles: Personalized cooking preferences and dietary restrictions
  • Recipe Cookbook: Save and organize your favorite generated recipes
  • Password Recovery: Secure forgot password functionality

πŸ’³ Premium Features

  • Payment Integration: Subscription-based premium features
  • Advanced Recipe Options: Enhanced AI capabilities for premium users
  • Priority Support: Faster recipe generation for subscribers

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 15.1.6 with App Router
  • Language: TypeScript 5
  • Styling: Tailwind CSS with custom components
  • UI Components: Radix UI primitives
  • Icons: Lucide React & React Icons
  • Authentication: NextAuth.js with Google provider

Backend

  • Database: PostgreSQL with Prisma ORM
  • API Routes: Next.js API routes
  • Authentication: NextAuth.js with Prisma adapter
  • Password Hashing: bcrypt

AI Integration

  • Primary AI: Groq API (llama3-70b-8192 model)
  • Fallback: OpenAI API
  • Image Processing: Streamlit app for ingredient recognition

Development Tools

  • Linting: ESLint with Next.js configuration
  • Package Manager: npm
  • Version Control: Git

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database
  • Groq API key (or OpenAI API key)
  • Google OAuth credentials (for authentication)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd PR2012/pr201
  2. Install dependencies

    npm install
  3. Environment Setup

    Create a .env file in the pr201 directory:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/flavor_fusion"
    
    # NextAuth
    NEXTAUTH_SECRET="your-nextauth-secret"
    NEXTAUTH_URL="http://localhost:3000"
    
    # Google OAuth
    GOOGLE_CLIENT_ID="your-google-client-id"
    GOOGLE_CLIENT_SECRET="your-google-client-secret"
    
    # AI APIs (use one or both)
    NEXT_PUBLIC_GROQ_API_KEY="your-groq-api-key"
    OPENAI_API_KEY="your-openai-api-key"

    ⚠️ Security Note: Never commit API keys to version control. Use environment variables and add .env to .gitignore.

  4. Database Setup

    npx prisma generate
    npx prisma db push
  5. Start the development server

    npm run dev
  6. Access the application

Generating Recipes

  1. Text-Based Generation:

    • Enter a recipe idea or list of ingredients
    • Specify dietary preferences (vegetarian, vegan, etc.)
    • Click "Generate" to create personalized recipes
  2. Ingredient Photo Upload:

    • Use the "FIND INGREDIENT" feature
    • Upload photos of available ingredients
    • Get matching recipe suggestions
  3. Recipe Customization:

    • Specify serving sizes
    • Include cooking time preferences
    • Add allergy restrictions

User Account Features

  • Sign Up/Login: Use Google OAuth for secure authentication
  • Profile Management: Set dietary preferences and cooking skill level
  • Recipe Cookbook: Save and organize favorite recipes
  • Sharing: Share recipes with friends and family

πŸ”§ API Endpoints

Recipe Generation

POST /api/recipe
Body: { "prompt": "recipe description or ingredients" }
Response: { "recipe": "generated recipe content" }

User Management

POST /api/register          # User registration
POST /api/auth/[...nextauth] # Authentication (Google OAuth)
POST /api/forgot-password   # Password recovery

Payment

POST /api/payment           # Handle subscription payments

πŸ§ͺ Development

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

Database Operations

npx prisma studio           # Open Prisma Studio
npx prisma generate         # Generate Prisma client
npx prisma db push          # Push schema changes
npx prisma db pull          # Pull schema from database

πŸ”’ Security Considerations

  • API Key Management: Store all API keys in environment variables
  • Authentication: Secure OAuth implementation with NextAuth.js
  • Database Security: Use Prisma for safe database queries
  • Password Security: bcrypt hashing for user passwords
  • CORS: Proper CORS configuration for API endpoints

⚠️ Important: This project previously had hardcoded API keys in the codebase. Ensure all API keys are properly secured in environment variables and never committed to version control.

πŸš€ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Manual Deployment

  1. Build the application:

    npm run build
  2. Start the production server:

    npm start

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use Tailwind CSS for styling
  • Write meaningful commit messages
  • Test your changes thoroughly
  • Ensure API keys are never hardcoded

πŸ“ License

This project is licensed under the ISC License.

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the FAQ section in the app
  2. Review the troubleshooting guide below
  3. Open an issue on GitHub
  4. Contact the development team

Common Issues

Recipe generation fails:

  • Verify your Groq/OpenAI API key is valid
  • Check API rate limits
  • Ensure proper environment variable configuration

Authentication issues:

  • Verify Google OAuth credentials
  • Check NEXTAUTH_URL configuration
  • Ensure database connection is working

Database connection errors:

  • Verify PostgreSQL is running
  • Check DATABASE_URL format
  • Run npx prisma generate after schema changes

πŸŽ‰ Acknowledgments

  • Next.js Team for the amazing framework
  • Groq for powerful AI capabilities
  • Prisma for excellent database tooling
  • Tailwind CSS for beautiful styling
  • NextAuth.js for secure authentication

Made with ❀️ by the Flavor Fusion Team

Bringing AI-powered cooking to kitchens worldwide πŸŒπŸ‘¨β€πŸ³πŸ‘©β€πŸ³

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors