Skip to content

MealMind.ai is a full-stack AI-powered meal inspiration web app designed to generate smart, creative recipe ideas using AI and you can also save, share and download the recipes. This repository contains both the server and client code.

Notifications You must be signed in to change notification settings

Hammad005/MealMind.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MealMind.ai 🧠🍽️

Demo App

MealMind.ai is a full-stack AI-powered meal inspiration web app designed to generate smart, creative recipe ideas using AI and you can also save, share and download the recipes. This repository contains both the server and client code.


📁 Project Structure

MealMind.ai/
├── server/  # Node.js + Express backend
└── client/  # Vite + React frontend

📄 Clone the Repository

git clone https://github.com/Hammad005/MealMind.ai.git

🔧 Server Setup (/server)

1. 📦 Install Dependencies

cd server
npm install

2. ⚙️ Environment Variables

Create a .env file in the server directory and add the following variables:
PORT=                       # Port number (e.g., 5000)

MONGO_URI=                  # Your MongoDB connection string
CLIENT_URL=                 # Your frontend URL (e.g., http://localhost:5173)
JWT_SECRET=                 # Secret key for JWT authentication

CLOUDINARY_CLOUD_NAME=      # Cloudinary cloud name
CLOUDINARY_API_KEY=         # Cloudinary API key
CLOUDINARY_API_SECRET=      # Cloudinary API secret

GOOGLE_CLIENT_ID=           # Google Client Id (for google authentication)
GOOGLE_CLIENT_SECRET=       # Google CLient Secret (for google authentication)
GOOGLE_CALLBACK_URL=        # http://localhost:(PORT)/api/auth/google/callback (Make sure add the same url that you gave on google cloud platform)

GEMINI_API_KEY=             # Gemini AI API key

3.📡 API Endpoints

🔐 User Endpoints:

✅Craeting A New User:

  • URL: /api/auth/signup
  • Method: POST
  • Body: username, name, email, password
  • Credentials: True
  • Auth required: No

🔓Login Existing User:

  • URL: /api/auth/login
  • Method: POST
  • Body: usernameOrEmail, password
  • Credentials: True
  • Auth required: No

🚪Logout User:

  • URL: /api/auth/logout
  • Method: POST
  • Body: Null
  • Credentials: True
  • Auth required: (Optional)

✏️Update Existing User:

  • URL: /api/auth/updateProfile
  • Method: PUT
  • Body: username(Optional), name(Optional), profile(Optional
  • Credentials: True
  • Auth required: Yes

👥Get All Users:

  • URL: /api/auth/allUsers
  • Method: GET
  • Body: Null
  • Credentials: True
  • Auth required: Yes

👤Get Logged-In User Profile:

  • URL: /api/auth/getProfile
  • Method: GET
  • Body: Null
  • Credentials: True
  • Auth required: Yes

🕘 History (Recipes):

📝Create a Recipe (Adds to History):

  • URL: /api/history/createRescipe
  • Method: POST
  • Body: text (This can be whatever is on your mind.)
  • Credentials: True
  • Auth required: Yes

📄Get Logged-In User's Recipe History:

  • URL: /api/history/getHistory
  • Method: GET
  • Body: Null
  • Credentials: True
  • Auth required: Yes

❌Clear All Recipe History:

  • URL: /api/history/clearHistory
  • Method: DELETE
  • Body: Null
  • Credentials: True
  • Auth required: Yes

🗑️Delete Specific Recipe from History:

  • URL: /api/history/clearSingleHistory/:id (It Requires Id Of History That You Want To Delete)
  • Method: DELETE
  • Body: Null
  • Credentials: True
  • Auth required: Yes

💾 Saved Recipes:

💾Save Recipe from History ID:

  • URL: /api/saved/saveRescipe/:id (It Requires Id Of History That You Want To Saved)
  • Method: POST
  • Body: Null
  • Credentials: True
  • Auth required: Yes

💾Save Recipe from Share ID:

  • URL: /api/saved/saveSharedRescipe/:id (It Requires Id Of Share That You Want To Saved)
  • Method: POST
  • Body: Null
  • Credentials: True
  • Auth required: Yes

🔓Unsave Recipe by Save ID:

  • URL: /api/saved/unsaveRescipe/:id (It Requires Id Of Save That You Want To Unsave)
  • Method: DELETE
  • Body: Null
  • Credentials: True
  • Auth required: Yes

📋Get Saved Recipes for Logged-In User:

  • URL: /api/saved/getSavedRecipe
  • Method: GET
  • Body: Null
  • Credentials: True
  • Auth required: Yes

🔗 Shared Recipes:

📤Share Recipe from History:

  • URL: /api/shareRecipe/shareHistoryRecipe/:receiverId (It Requires Id Of User That You Want To Send The Recipe)
  • Method: POST
  • Body: historyId (Id Of History(Recipe) That You Want To Send)
  • Credentials: True
  • Auth required: Yes

📤Share Recipe from Saved Recipes:

  • URL: /api/shareRecipe/shareSavedRecipe/:receiverId (It Requires Id Of User That You Want To Send The Recipe)
  • Method: POST
  • Body: savedId (Id Of Saved(Recipe) That You Want To Send)
  • Credentials: True
  • Auth required: Yes

📤Share Recipe from Shared Recipes:

  • URL: /api/shareRecipe/shareSharedRecipe/:receiverId (It Requires Id Of User That You Want To Send The Recipe)
  • Method: POST
  • Body: sharedId (Id Of Shared(Recipe) That You Want To Send)
  • Credentials: True
  • Auth required: Yes

📬Get Shared Recipes Received by Logged-In User:

  • URL: /api/shareRecipe/getSharedRecipe
  • Method: GET
  • Body: null
  • Credentials: True
  • Auth required: Yes

📤Get Recipes Sent by Logged-In User:

  • URL: /api/shareRecipe/getSendedRecipe
  • Method: GET
  • Body: null
  • Credentials: True
  • Auth required: Yes

❌Delete a Shared Recipe:

  • URL: /api/shareRecipe/deleteSharedRecipe/:id (It Requires Id Of Share That You Want To Delete)
  • Method: DELETE
  • Body: null
  • Credentials: True
  • Auth required: Yes

4. 🧪 Run Server

# For development
npm run dev

# For production
npm start

The server should now be running at: http://localhost:(PORT)


💻 Client Setup (/client)

1. 📦 Install Dependencies

cd client
npm install

2. ⚙️ Environment Variables

Create a .env file in the client directory and add the following variables:
VITE_API_URL=                    # Your backend API base URL (e.g., http://localhost:5000)
VITE_GOOGLE_CLIENT_ID=           # Google Client Id (for google authentication)
VITE_GOOGLE_CLIENT_SECRET=       # Google CLient Secret (for google authentication)
VITE_GOOGLE_CALLBACK_URL=        # http://localhost:(PORT)/api/auth/google/callback (Make sure add the same url that you gave on google cloud platform)

3. 🧪 Run Client

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

The client will be available at: http://localhost:5173 (default Vite port)


🛠️ Tech Stack

  • Frontend: React, Vite, TailwindCSS, Shadcn
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • Authentication: JWT (JSON Web Tokens)
  • APIs Used: Gemini AI, Pexels API, Cloudinary

📌 Important Notes

  • Ensure that .env files are properly configured in both the client and server folders.
  • All external APIs and services (MongoDB, Gemini, Cloudinary) must be active and authorized.
  • The application will not function correctly without valid API credentials.

🙌 Acknowledgements

Special thanks to the APIs and services that made this project possible:

Made with ❤️ by Hammad Khatri

About

MealMind.ai is a full-stack AI-powered meal inspiration web app designed to generate smart, creative recipe ideas using AI and you can also save, share and download the recipes. This repository contains both the server and client code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published