Infinite Meals is a recipe search engine that uses OpenAI's GPT-3.5-Turbo-1106 Model through Open AI API to generate recipes for any given Food. It's a simple and easy way to find new recipes and get inspiration for your next meal.
You can Visit https://infinitemeals.vercel.app
You can find Recipes in multiple ways:
- You can search for any recipe by going on your dashboard and searching for a recipe.
Try Out
- You can find recipes by going to the categories page and selecting a category that you want to find recipes for.
Try Out
- You can find recipes by going to the all recipes page and selecting a recipe that you'd like.
Try Out
First, Fork and Clone the repository Locally:
git clone https://github.com/your-user/infinitemeals.git
Next, install the required Dependencies:
npm install
# or
yarn install
# or
pnpm install
Lastly, Get the required environment variable from the providers [ Reference: .env.example] :
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
Multiple Things Happen before the searched Recipe is returned to you.
- The recipe is Searched for in the Redis Cache against [when recipe is searched for the first time, it is cached]
- If unavailable in cache, it's looked for in the database.
- If the recipe is still unavailable, Text - Davinci - 003 is used to get the recipe for that item.
- The response from Text - Davinci - 003 is displayed to the user at this point of time.
- The response from the Database is then added into the Database and Cached for future use.
- Meanwhile, When Text - Davinci - 003 is used for fetching the recipe, the image is being looked for using Google Images Search from SERP API. The image fetched from the API is added to Cloudinary.
- The image added is displayed while the Image URL is added into the recipe Database and cache for future use.
- Upstash - Redis Caching & Rate Limiting
- Open AI API - AI Generated Recipes
- SERP API - Images
- Cloudinary - Image Storage
- Planet Scale - ServerLess MySQL DB
- Prisma - ORM
- Next Auth- Auth
- Next.js 13.4.9 - Project
- Vercel - Deployment
Method | Route | Description |
---|---|---|
POST | /api/v2/recipes/database | Looks for the recipe searched in Redis Cache and Main Database |
POST | /api/v2/recipes/completion | Uses Open AI API to generate recipes based on the search query |
POST | /api/v2/recipes/uid | Fetches Recipe based on the UID |
POST | /api/v2/recipes/update-recipe-by-ai | Adds the recipe generated by AI to the database and cache |
POST | /api/v2/images/database | Searches for the image in the cache and database for a recipe |
POST | /api/v2/images/search | Uses Serp API to search for images based on the search query using Google Images Search |
POST | /api/v2/images/completion | [unused] Uses DALL - E to create images for food Items based on the search query |
POST | /api/v2/images/update-image-db | Uploads Images to Cloudinary and updates the database inserting the imgURL, also caches the imgURL |
POST | /api/v2/tags/create | Creates A new Tag if not already present in the list of Tags in Database |
GET | /api/v2/tags/get-tags | Gets the list of all tags present in the database |
POST | /api/v2/tags/recipes | Gets the list of all recipes present in the database with the tag |
POST | /api/v2/tags/recipes/completion | Uses Open AI API to generate a recipe for the given tag |
Contributions are always welcome. Please refer to CONTRIBUTING.md for more info.