🫀 Heart Disease Predictor
FULL STACK ML PROJECT
A machine learning-powered web application to predict the likelihood of heart disease based on patient health data. Built with FastAPI for the backend and Next.js for the frontend.
🚀 Live Demo
🔗 Site

🧠 Tech Stack
- Frontend: Next.js, Tailwind CSS, React
- Backend: FastAPI, joblib (for model loading)
- Model: Trained with Scikit-learn on a heart disease dataset
- Deployment: Vercel (frontend), Railway (backend)
📊 Features
- Input patient data like age, cholesterol, blood pressure, etc.
- Get instant prediction (0 = No heart disease, 1 = Potential heart disease)
📦 Backend Setup
Prerequisites
- Python 3.8+
pip install -r requirements.txt
Run locally
uvicorn main:app --reload
Deployment
- The backend is deployed using Railway.
- Ensure the following files are present:
model.pkl– Trained ML modelscaler.pkl– StandardScaler used during trainingcolumns.pkl– Feature column names used for prediction
CORS Setup
app.add_middleware( CORSMiddleware, allow_origins=["https://heart-disease-predictor-phi.vercel.app"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], )
API Endpoint
POST /predict
Request Body (JSON)
{ "age": 45, "sex": 1, "cp": 3, "trestbps": 130, "chol": 250, "fbs": 0, "restecg": 1, "thalach": 170, "exang": 0, "oldpeak": 1.5, "slope": 2, "ca": 0, "thal": 2 }
Response
{ "prediction": 1 }
Made with ❤️ by kishore-sv
