Skip to content

Sajidcodecrack/System-Analysis-Design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

<<<<<<< HEAD

System-Analysis-Design

Budget-Based AI Meal Recommendation System

πŸ“Œ Overview

This project is an AI-powered meal recommendation system that suggests budget-friendly, healthy meals based on user inputs such as BMI, dietary preferences, and monthly budget. The system leverages the MERN stack (MongoDB, Express.js, React.js, Node.js) and integrates Retrieval-Augmented Generation (RAG) with Generative AI (Gemini API) for personalized recommendations.


πŸ›  Tech Stack

  • Frontend: React.js (Tailwind CSS for styling)
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • AI Integration: Gemini API (Generative AI), RAG-based Retrieval System
  • Deployment: Vercel (Frontend), Render/Heroku (Backend), MongoDB Atlas

πŸš€ Features

βœ… User Input Form (BMI, allergies, budget, meal preferences)
βœ… Budget-Friendly Meal Suggestions (AI-powered recommendations)
βœ… Personalized Diet Planning (Based on health metrics)
βœ… Smart Data Retrieval (MongoDB stores food data & pricing)
βœ… AI Chatbot for Meal Queries (Real-time food recommendations)
βœ… Email-Based Weekly Progress Reports
βœ… Wearable Device Syncing (Smartwatch integration for health tracking)


πŸ“‚ Project Structure

πŸ“¦ Budget-Meal-Recommendation
β”œβ”€β”€ πŸ“ backend  # Node.js + Express.js Backend
β”‚   β”œβ”€β”€ πŸ“ models  # MongoDB Schemas
β”‚   β”œβ”€β”€ πŸ“ routes  # API Endpoints
β”‚   β”œβ”€β”€ πŸ“ controllers  # Business Logic
β”‚   β”œβ”€β”€ server.js  # Main Server File
β”‚
β”œβ”€β”€ πŸ“ frontend  # React.js Frontend
β”‚   β”œβ”€β”€ πŸ“ src
β”‚   β”‚   β”œβ”€β”€ πŸ“ components  # UI Components
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages  # Pages (Home, Dashboard, etc.)
β”‚   β”‚   β”œβ”€β”€ App.js  # Main App Component
β”‚
β”œβ”€β”€ πŸ“ data  # Food Dataset (MongoDB JSON Import)
β”‚
β”œβ”€β”€ .env  # API Keys & Configuration
β”œβ”€β”€ package.json  # Dependencies
β”œβ”€β”€ README.md  # Documentation

βš™οΈ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/yourusername/Budget-Meal-Recommendation.git
cd Budget-Meal-Recommendation

2️⃣ Backend Setup

cd backend
npm install

Create a .env file in the backend directory:

PORT=5000
MONGO_URI=your_mongodb_connection_string
GEMINI_API_KEY=your_gemini_api_key

Start the server:

npm run dev

3️⃣ Frontend Setup

cd frontend
npm install
npm start

πŸ“Œ API Endpoints

πŸ”Ή User Meal Recommendation API

Endpoint: /api/generate-meal
Method: POST
Description: Suggests a budget-friendly meal based on user input.

πŸ“₯ Request Body:

{
  "budget": 400,
  "taste": "Spicy",
  "allergies": ["Peanuts"],
  "bmi": 22
}

πŸ“€ Response:

{
  "mealPlan": "Grilled Chicken Salad with Brown Rice and Vegetables under 400 BDT"
}

πŸ”Ή Fetch All Available Meals

Endpoint: /api/meals
Method: GET
Description: Retrieves all meals stored in MongoDB.

πŸ“€ Response:

[
  {
    "name": "Vegetable Khichuri",
    "price": 150,
    "calories": 400,
    "type": "Vegetarian"
  },
  {
    "name": "Grilled Chicken Salad",
    "price": 350,
    "calories": 500,
    "type": "Protein-Rich"
  }
]

πŸ€– How AI & RAG Work in This System

1️⃣ User inputs budget, taste preference, and dietary needs.
2️⃣ MongoDB retrieves meals within the budget.
3️⃣ Backend augments meal data and sends it to Gemini API.
4️⃣ Gemini generates a personalized meal plan.
5️⃣ Frontend displays AI-powered meal suggestions.


πŸ“Œ Contribution Guidelines

1️⃣ Fork the repository.
2️⃣ Create a new branch: git checkout -b feature-branch.
3️⃣ Commit changes: git commit -m "Added new feature".
4️⃣ Push to GitHub: git push origin feature-branch.
5️⃣ Submit a Pull Request.


πŸ›  Future Enhancements

  • βœ… AI-powered grocery list generation based on meals.
  • βœ… Voice command support for chatbot.
  • βœ… Smartwatch calorie tracking integration.

πŸ“Œ License

This project is licensed under the MIT License.


=======

BMI & Meal Suggestion App - README

Overview

This is a MERN stack application that calculates BMI and provides personalized meal suggestions using Google's Generative AI. The application takes user inputs such as name, age, gender, height, weight, and budget to calculate BMI and generate customized meal suggestions for Bengali and English cuisine.

Features

  • BMI calculation based on height and weight
  • Personalized meal suggestions based on BMI, gender, and budget
  • Responsive design for both desktop and mobile devices
  • Integration with Google's Generative AI for intelligent meal recommendations

Tech Stack

  • MongoDB: Database for storing user information (optional)
  • Express: Backend server framework
  • React: Frontend library with Vite for fast development
  • Node.js: JavaScript runtime for the backend
  • Google Generative AI: For generating personalized meal suggestions

Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)
  • MongoDB (local or Atlas connection)

Setup Instructions

  1. Clone the repository
git clone <repository-url>
cd bmi-meal-app
  1. Install backend dependencies
cd backend
npm install
  1. Configure environment variables Create a .env file in the backend directory with the following variables:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/bmi-meal-app
GOOGLE_API_KEY=your_google_api_key
  1. Install frontend dependencies
cd ../frontend
npm install
  1. Start the application

Backend:

cd backend
npm run dev

Frontend:

cd frontend
npm run dev
  1. Access the application Open your browser and navigate to http://localhost:5173

Usage

  1. Fill in your personal details in the form
  2. Click "Get Meal Suggestions"
  3. View your BMI results and personalized meal suggestions

API Endpoints

BMI Calculation

  • POST /api/bmi/calculate
    • Request body: { heightFeet, heightInches, weightKg }
    • Response: { bmi, category }

Meal Suggestions

  • POST /api/meal/suggestions
    • Request body: { name, age, gender, heightFeet, heightInches, weightKg, budget }
    • Response: { bmi, bmiCategory, mealSuggestions }

Project Structure

bmi-meal-app/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ node_modules/
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ bmi.js
β”‚   β”‚   └── meal.js
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js
└── frontend/
    β”œβ”€β”€ node_modules/
    β”œβ”€β”€ public/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ BMIResult.jsx
    β”‚   β”‚   β”œβ”€β”€ MealSuggestions.jsx
    β”‚   β”‚   └── UserForm.jsx
    β”‚   β”œβ”€β”€ services/
    β”‚   β”‚   └── api.js
    β”‚   β”œβ”€β”€ App.css
    β”‚   β”œβ”€β”€ App.jsx
    β”‚   └── main.jsx
    β”œβ”€β”€ index.html
    β”œβ”€β”€ package.json
    └── vite.config.js

Notes

  • The Google API key included in the code is for demonstration purposes only. Replace it with your own API key for production use.
  • The application uses the Gemini AI model for generating meal suggestions.

5b113d4 (Initial commit)

About

Budget-Based AI Meal Recommendation with RAG & Generative AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published