Initial Release
π« Heart Disease Diagnosis System
An intelligent health application that predicts the likelihood of heart disease based on patient medical data.
This system integrates a Spring Boot backend, a Python-based machine learning model, and an InterSystems IRIS database, all running seamlessly via Docker Compose.
π§© Architecture Overview
heart_diagnosis/
β
βββ backend/ # Spring Boot backend
β βββ src/β¦
β βββ pom.xml
β βββ Dockerfile
β
βββ python-model/ # Python Flask microservice (ML model)
β βββ app.py
β βββ requirements.txt
β βββ random_forest_hrt_diag
β βββ Dockerfile
β
βββ docker-compose.yml # Docker orchestration file
βββ README.md
π Features
Spring Boot Backend β exposes REST APIs for managing patients and medical records.
Machine Learning Microservice (Python) β predicts heart disease risk using a trained Random Forest model.
InterSystems IRIS Database β stores patient and medical records securely.
Dockerized Setup β one-command startup for all services.
Seamless Communication between backend and ML model through REST.
βοΈ Technologies Used
Component Technology
Backend Java 17, Spring Boot 3, Hibernate ORM
Database InterSystems IRIS Community Edition
Machine Learning Python 3.11, Flask, scikit-learn, joblib
Containerization Docker, Docker Compose
Build Tool Maven 3.9
Communication RESTful APIs (JSON)
π§ ML Model
The Random Forest Classifier was trained using clinical features (e.g., blood pressure, cholesterol, heart rate, etc.).
The model is serialized with joblib and served via Flask API:
Endpoint:
POST /predict
Request Example:
{
βfeaturesβ: [63, 1, 145, 233, 1, 150, 0, 2.3, 0, 0, 1]
}
Response Example:
{
βpredictionβ: βPositiveβ
}
π³ Docker Setup
Prerequisites
Docker Desktop
Docker Compose
Build and Run All Containers
docker-compose up βbuild
Access the Services
Service URL Description
Spring Boot API http://localhost:8080
Backend REST API
Python ML Model http://localhost:5000
Flask prediction API
InterSystems IRIS http://localhost:52773/csp/sys/UtilHome.csp
IRIS Management Portal
π§Ύ Environment Variables
You can modify database credentials and other environment variables inside docker-compose.yml:
environment:
π¦ Building Individual Services
Backend (Spring Boot)
cd backend
docker build -t heart-backend:latest .
docker run -p 8080:8080 heart-backend
Python Model
cd python-model
docker build -t python-model:latest .
docker run -p 5000:5000 python-model
π§° API Integration Flow
Frontend or Postman sends patient data to the Spring Boot API.
The backend stores the data in IRIS Database.
The backend then calls the Python Flask model to predict heart disease.
The prediction is returned and stored in the patientβs record.
π§βπ» Author
Joseph Martins
Software Developer | AI Researcher | Project Management Expert
π§ Email: joeyekpe@gmail.com
π GitHub