🧠 MediBro - Disease Prediction & Recommendation Web App

MediBro is a full-stack Machine Learning-powered web application that predicts diseases based on symptoms entered by the user and provides medically relevant recommendations including medications, workouts, precautions, and diets.


šŸš€ Features

  • Predicts disease based on entered symptoms
  • Provides:
    • Disease description
    • Medications and diet tips
    • Workouts and precautions
  • Fast ML inference using pre-trained models
  • Clean and responsive UI (Next.js + Tailwind CSS)
  • Express.js backend with Python integration

🧩 Tech Stack

Area Tech
Frontend Next.js, TypeScript, Tailwind CSS
Backend Node.js, Express.js
ML Model Python, scikit-learn, XGBoost
Data Tools Pandas, NumPy
Deployment Localhost (dev mode)

šŸ“ Project Structure

project-root/
ā”œā”€ā”€ backend/                             # Backend logic for disease prediction and recommendations
│   ā”œā”€ā”€ datasets/                        # Contains all CSV datasets used for prediction and recommendations
│   │   ā”œā”€ā”€ description.csv              # Description of diseases
│   │   ā”œā”€ā”€ diets.csv                    # Recommended diets per disease
│   │   ā”œā”€ā”€ medications.csv              # Medications per disease
│   │   ā”œā”€ā”€ precautions.csv              # Precautions for each disease
│   │   ā”œā”€ā”€ symtoms.csv                  # List of symptoms
│   │   ā”œā”€ā”€ training.csv                 # Training data for the ML model
│   │   └── workout.csv                  # Workout recommendations per disease
│   ā”œā”€ā”€ model/
│   │   └── xgb_regressor.pkl            # Trained XGBoost model for disease prediction
│   ā”œā”€ā”€ .gitignore                       # Git ignore rules for backend
│   ā”œā”€ā”€ diseaseInfo.py                  # Returns detailed disease info based on prediction
│   ā”œā”€ā”€ disease_prediction.ipynb        # Jupyter Notebook for model development and training
│   ā”œā”€ā”€ package-lock.json               # Auto-generated for locking dependencies
│   ā”œā”€ā”€ package.json                    # Backend dependencies and scripts
│   ā”œā”€ā”€ recomended.py                   # Returns diet, medication, workout, precautions for a disease
│   └── server.js                       # Express.js server handling API requests
│
ā”œā”€ā”€ public/                             # Public assets like images and icons for frontend
│   ā”œā”€ā”€ 24.avif                          # Various images used in the frontend UI
│   ā”œā”€ā”€ favicon-32x32.png                # Favicon for the website
│   ā”œā”€ā”€ favicon.ico                      # Favicon
│   ā”œā”€ā”€ img1.avif                        # General UI image
│   ā”œā”€ā”€ img2.jpg                         # General UI image
│   ā”œā”€ā”€ img3.jpg                         # General UI image
│   ā”œā”€ā”€ img4.jpg                         # General UI image
│   ā”œā”€ā”€ logo.jpg                         # Logo image
│   ā”œā”€ā”€ logo2.png                        # Alternate logo
│   ā”œā”€ā”€ logo5.png                        # Alternate logo
│   ā”œā”€ā”€ logonew1.png                     # Final/updated logo
│   ā”œā”€ā”€ meds rec.jpg                     # Image representing medical recommendations
│   ā”œā”€ā”€ sec.jpeg                         # Security-related image
│   ā”œā”€ā”€ symp.jpg                         # Symptoms-related illustration
│   ā”œā”€ā”€ trust.png                        # Trust-related icon
│   └── user frie.png                    # User-friendly design image
│
ā”œā”€ā”€ src/                                # Frontend (Next.js) source files
│   ā”œā”€ā”€ app/                             # App routing and pages
│   │   ā”œā”€ā”€ about/
│   │   │   └── page.tsx                # About page component
│   │   ā”œā”€ā”€ contact/
│   │   │   └── page.tsx                # Contact page component
│   │   ā”œā”€ā”€ workplace/
│   │   │   └── page.tsx                # Workplace-related page
│   │   ā”œā”€ā”€ NavBar.tsx                  # Navigation bar component
│   │   ā”œā”€ā”€ globals.css                 # Global styles
│   │   ā”œā”€ā”€ layout.tsx                  # Layout file wrapping all pages
│   │   ā”œā”€ā”€ not-found.tsx               # Custom 404 error page
│   │   └── page.tsx                    # Main (home) page
│   ā”œā”€ā”€ lib/
│   │   └── utils.ts                    # Utility functions used across frontend
│
ā”œā”€ā”€ .gitignore                          # Ignore rules for the entire project
ā”œā”€ā”€ README.md                           # Project documentation
ā”œā”€ā”€ components.json                     # UI components configuration
ā”œā”€ā”€ eslint.config.mjs                   # ESLint config for code linting
ā”œā”€ā”€ next.config.ts                      # Next.js configuration
ā”œā”€ā”€ package-lock.json                   # Lock file for frontend dependencies
ā”œā”€ā”€ package.json                        # Frontend project dependencies
ā”œā”€ā”€ postcss.config.mjs                  # PostCSS configuration for styling
└── tsconfig.json                       # TypeScript configuration

šŸ› ļø Installation & Usage

1. Fork the repository

Fork the repository to your GitHub account by clicking the "Fork" button at the top right of the original repo.

2. Clone the repository

git clone https://github.com/YOUR-USERNAME/MedBro-Minor.git
cd MedBro-Minor

3. Install frontend dependencies

npm install

4. Run the frontend (Next.js)

npm run dev

5. Set up backend

In a separate terminal:

cd backend
npm install
node server.js

Make sure your Python model is already trained and exported to model.joblib.

5. Access the app

Go to http://localhost:3000 in your browser.


šŸ“Š ML Model Info

  • Input: User symptoms
  • Output: Disease classification (multi-class)
  • Algorithms used: Random Forest, XGBoost
  • Exported with joblib and used via an API bridge

šŸ“¬ API Endpoint

POST /predict

Body:

{
  "symptoms": ["headache", "fever", "nausea"]
}

Response:

{
  "disease": "Typhoid",
  "description": "...",
  "medications": [...],
  "workout": [...],
  "diet": [...],
  "precautions": [...]
}

šŸ“Œ Notes

  • This project is for educational purposes.
  • It should not be considered a substitute for real medical consultation.

Top categories

Loading Svelte Themes