How mohamedelsayadd/al-shefaa-hospital-v1 works
Project type and purpose
• This is a full-stack, AI-powered disease-diagnosis web application built with Python (Flask), HTML/CSS/JavaScript on the front end, persisting results to a SQL Server database, and exposing endpoints that load pre-trained ML/DL models (.pkl and .h5 files) for inference.
• It offers four diagnostic services: diabetes, breast cancer, liver disease, and Alzheimer’s.
File structure
Top-level:
• app.py ← Flask entrypoint for diabetes, breast-cancer, liver routes
• breast_cancer.pkl
• diabetes.pkl
• hepatitis_c.pkl
• alzh_model1.h5 ← Alzheimer’s model artifact
• static/ ← shared CSS/JS/images
• templates/ ← shared HTML templates (index.html, result pages)
• uploads/ ← user-uploaded files (e.g., MRI scans)
• Alzheimer Diagnosis/ ← mini-Flask app for Alzheimer’s (alzh.py, separate static & templates, train/test datasets)
Configuration & docs:
• README.md
README for additional insights
• Confirms Flask/JS/CSS stack, SQL Server persistence, and four diagnosis features.
• Emphasizes user-friendly web interface.
a. Main components
1. Client Browser (UI)
2. Web Server (Flask app.py + Alzheimer’s alzh.py)
3. Model Service Layer
• DiabetesService (loads diabetes.pkl)
• CancerService (loads breast_cancer.pkl)
• LiverService (loads hepatitis_c.pkl)
• AlzheimerService (loads alzh_model1.h5, image-processing)
4. File System
• uploads/ (MRI scans for Alzheimer’s)
• static/ & Alzheimer Diagnosis/static/
• offline train/test data (under Alzheimer Diagnosis/)
5. Database (SQL Server)
6. Offline Training (datasets under Alzheimer Diagnosis/train & /test)
b. Relationships & interactions
• Browser ↔ HTTP(S) ↔ Flask routing
• Flask route handlers call respective ModelService
• ModelService loads artifact, runs inference
• Inference result → persisted to SQL Server
• Template renderer returns HTML with prediction
• For Alzheimer’s: client uploads image → AlzheimerService preprocesses image → inference
c. Architectural patterns & principles
• Monolithic MVC (views in templates/, controllers in app.py & alzh.py, models as ML artifacts)
• Separation of concerns: distinct service modules for each disease
• Layering: Presentation (HTML/CSS/JS), Application (Flask routes), Domain (ML models), Persistence (SQL Server)
d. Key technologies
• Python & Flask, HTML/CSS, JavaScript
• ML frameworks: scikit-learn (.pkl) and TensorFlow/Keras (.h5)
• SQL Server (via pyodbc or similar)
• File I/O for uploads & model artifacts