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.
- 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.
- 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
Tool | Version | Required |
---|---|---|
Node.js / npm | ~20.15.0 / ~10.7.0 | ✅ |
Git | ~2 | ✅ |
Docker Desktop | ~4.4.2 | |
MongoDB Compass | ~1.0.0 |
-
Clone the Repository:
git clone https://github.com/Dereje1/smart-recipe-generator.git cd smart-recipe-generator
-
Install Dependencies:
npm install
-
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
-
Run the Development Server:
npm run dev
The application will be available at
http://localhost:3000
.
- Sign In: Log in using your Google account.
- Select Ingredients: Choose ingredients from the list.
- Generate Recipes: Click the button to generate recipes.
- Select Recipes: Choose from the generated recipes to save into your account.
- View Recipes: See the generated recipes and their images on the homepage.
- Like Recipes: Like your favorite recipes.
- Profile: View and manage your recipes in your profile.
The application is deployed on Vercel. Follow these steps to deploy:
- Login to Vercel: If you don't have an account, sign up at vercel.com.
- Import Project: Import your GitHub repository to Vercel.
- Configure Environment Variables: Set the environment variables in Vercel's dashboard.
- Deploy: Click on Deploy.
Check out the live application here.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenAI
- Vercel
- Next.js
- MongoDB
- Hat tip to anyone whose code was used
- GPT-4o for acting as an assistant throughout the project