Skip to content

Smart Recipe Generator is an AI-powered web app that creates unique recipes based on user-selected ingredients and dietary preferences. Built with Next.js and MongoDB, and deployed on Vercel.

Notifications You must be signed in to change notification settings

Dereje1/smart-recipe-generator

Repository files navigation

Smart Recipe Generator

Smart Recipe Generator is an AI-powered web application that generates unique and delicious recipes based on user-selected ingredients and dietary preferences. It uses OpenAI for recipe generation and DALL-E for creating appetizing images of the recipes. The application is built using a MERN stack (MongoDB, React, Node.js) and deployed on Vercel.

Features

  • User Authentication: Secure login using Google OAuth with next-auth.
  • AI-Powered Recipe Generation: Generate recipes based on selected ingredients and dietary preferences.
  • Recipe Image Generation: Generate images of the recipes using DALL-E.
  • User Profiles: View and manage your own recipes.
  • Likes System: Like your favorite recipes.
  • Responsive Design: Mobile-friendly and responsive UI.

Tech Stack

  • Frontend: React, Next.js, Tailwind CSS
  • Backend: Node.js, MongoDB
  • Authentication: NextAuth.js with Google OAuth
  • AI Integration: OpenAI for recipe generation, DALL-E for image generation
  • Image Hosting: AWS S3
  • Hosting: Vercel

Installation

Prerequisites

Tool Version Required
Node.js / npm ~20.15.0 / ~10.7.0
Git ~2
Docker Desktop ~4.4.2
MongoDB Compass ~1.0.0
  1. Clone the Repository:

    git clone https://github.com/Dereje1/smart-recipe-generator.git
    cd smart-recipe-generator
  2. Install Dependencies:

    npm install
  3. Set Up Environment Variables: Create a .env.local file in the root directory and add the following environment variables:

    NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
    NEXTAUTH_URL=http://localhost:3000
    NEXTAUTH_SECRET=your-secret
    GOOGLE_CLIENT_ID=your-google-client-id
    GOOGLE_CLIENT_SECRET=your-google-client-secret
    OPENAI_API_KEY=your-openai-api-key
    AWS_ACCESS_KEY_ID=your-aws-access-key-id
    AWS_SECRET_ACCESS_KEY=your-aws-secret-key
    MONGO_URI=your-mongodb-uri
    S3_BUCKET_NAME=your-s3-bucket-name
    API_REQUEST_LIMIT=maximum-api-requests

    If you wish and have Docker, you can run MongoDB locally using:

    docker-compose up mongodb

    Point your MongoDB URI to:

    mongodb://root:123456@localhost:27018
  4. Run the Development Server:

    npm run dev

    The application will be available at http://localhost:3000.

Usage

  1. Sign In: Log in using your Google account.
  2. Select Ingredients: Choose ingredients from the list.
  3. Generate Recipes: Click the button to generate recipes.
  4. Select Recipes: Choose from the generated recipes to save into your account.
  5. View Recipes: See the generated recipes and their images on the homepage.
  6. Like Recipes: Like your favorite recipes.
  7. Profile: View and manage your recipes in your profile.

Deployment

The application is deployed on Vercel. Follow these steps to deploy:

  1. Login to Vercel: If you don't have an account, sign up at vercel.com.
  2. Import Project: Import your GitHub repository to Vercel.
  3. Configure Environment Variables: Set the environment variables in Vercel's dashboard.
  4. Deploy: Click on Deploy.

Live Demo

Check out the live application here.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

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

Acknowledgements

About

Smart Recipe Generator is an AI-powered web app that creates unique recipes based on user-selected ingredients and dietary preferences. Built with Next.js and MongoDB, and deployed on Vercel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages