An AI-powered, full-stack healthcare web application that predicts the risk of 8 major diseases using Machine Learning and provides intelligent medical document analysis powered by Large Language Models (LLMs).
| Feature | Description |
|---|---|
| π©Ί Multi-Disease Prediction | Risk assessment for Diabetes, Stroke, Parkinson's, Thyroid, Depression, Hepatitis, Heart Disease & Kidney Disease |
| π AI Medical Report Analysis | Upload medical PDFs for automatic extraction of diagnoses, medications & risk factors (Powered by Groq & Llama-3) |
| π€ Intelligent AI Summaries | Natural-language health summaries explaining results to patients (Powered by Google Gemini API) |
| π Secure Authentication | User registration & login with bcrypt-encrypted passwords |
| β‘ Modern UI/UX | Responsive, interactive interface built with Next.js & Tailwind CSS |
| π High-Performance API | FastAPI backend with async request handling and Swagger docs |
| Disease | Model Type |
|---|---|
| Diabetes | Scikit-learn |
| Stroke | Scikit-learn |
| Parkinson's | CatBoost |
| Thyroid | CatBoost |
| Depression | Scikit-learn |
| Hepatitis | Scikit-learn |
| Heart Disease | Scikit-learn |
| Chronic Kidney Disease | Scikit-learn |
| Layer | Technology |
|---|---|
| Frontend | Next.js, React, TypeScript, Tailwind CSS |
| Backend | FastAPI 0.135.1, Uvicorn 0.41.0, Python 3.12 |
| Database | SQLite via SQLAlchemy 2.0.48 |
| ML Models | Scikit-learn 1.3.2, CatBoost 1.2.10, LightGBM 4.6.0, XGBoost 3.2.0 |
| AI & Cloud | Google Gemini API, Groq API (Llama-3.3-70B) |
Medical-Disease-Risk-Assessment-System/
βββ Backend/
β βββ main.py # FastAPI entry point & API routes
β βββ database.py # SQLite database configuration
β βββ models.py # SQLAlchemy ORM models
β βββ schemas.py # Pydantic input schemas per disease
β βββ predictor.py # Disease prediction logic
β βββ predict_utils.py # Model loading utilities
β βββ utils.py # Password hashing helpers
β βββ auth.py # Authentication dependency
β βββ models/ # Pre-trained ML model files (.pkl)
β βββ requirements.txt # Python dependencies
βββ Frontend/
β βββ app/ # Next.js App Router (pages & API routes)
β βββ components/ # Reusable React components
β βββ context/ # Auth context provider
β βββ package.json # Node.js dependencies
βββ README.md
git clone https://github.com/rashedulalbab253/Medical-Multi-Disease-Risk-Assessment-System.git
cd Medical-Multi-Disease-Risk-Assessment-Systemcd Backend
# Create & activate virtual environment
py -3.12 -m venv venv
# Windows (PowerShell):
.\venv\Scripts\Activate.ps1
# Windows (CMD):
.\venv\Scripts\activate.bat
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file inside Backend/:
DATABASE_URL=sqlite:///./auth_db.db
SECRET_KEY=your_secret_key_here
ACCESS_TOKEN_EXPIRE_MINUTES=60
GEMINI_API_KEY=your_gemini_api_key_here # https://aistudio.google.com/
GROQ_API_KEY=your_groq_api_key_here # https://console.groq.com/.\venv\Scripts\python.exe -m uvicorn main:app --reloadBackend running at http://localhost:8000 | Swagger Docs at http://localhost:8000/docs
Open a new terminal:
cd Frontend
# Install dependencies
npm install --legacy-peer-deps
# Start the dev server
npm run devCreate a .env.local file inside Frontend/:
NEXT_PUBLIC_API_URL=http://localhost:8000Frontend running at http://localhost:3000
| Step | Command | Location |
|---|---|---|
| 1 | git clone <repo-url> |
β |
| 2 | cd Backend && py -3.12 -m venv venv |
Project root |
| 3 | .\venv\Scripts\Activate.ps1 |
Backend/ |
| 4 | pip install -r requirements.txt |
Backend/ |
| 5 | Create .env with API keys |
Backend/ |
| 6 | uvicorn main:app --reload |
Backend/ |
| 7 | cd Frontend && npm install --legacy-peer-deps |
Project root |
| 8 | npm run dev |
Frontend/ |
- Sign Up β Create a new account
- Log In β Authenticate with your email & password
- Select a Disease β Choose from 8 available risk assessments
- Fill the Form β Enter health data (age, BMI, blood pressure, etc.)
- Get Results β Receive instant High Risk / Low Risk prediction with AI-generated insights
- PDF Analysis β Upload a medical PDF for AI-powered document analysis
| Problem | Solution |
|---|---|
ModuleNotFoundError |
Activate your venv and run pip install -r requirements.txt |
Failed to fetch on frontend |
Ensure backend is running & NEXT_PUBLIC_API_URL is set |
scikit-learn unpickling errors |
Must use scikit-learn==1.3.2 (model training version) |
npm install errors |
Use npm install --legacy-peer-deps |
| Database issues | SQLite DB is auto-created on first run |
Contributions, issues, and feature requests are welcome! Feel free to open a pull request.
This project is intended for educational purposes.
Made with β€οΈ by Rashedul Albab