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.
MealMind.ai/
├── server/ # Node.js + Express backend
└── client/ # Vite + React frontendgit clone https://github.com/Hammad005/MealMind.ai.gitcd server
npm installPORT= # 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✅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
📝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
💾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
📤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
# For development
npm run dev
# For production
npm startcd client
npm installVITE_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)# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview- Frontend: React, Vite, TailwindCSS, Shadcn
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
- APIs Used: Gemini AI, Pexels API, Cloudinary
- Ensure that
.envfiles 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.
