# mrperfectpandit/tech-health-lab- architecture

> Architecture diagram of the GitHub repository mrperfectpandit/tech-health-lab-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrperfectpandit/tech-health-lab-
- Repository: https://github.com/mrperfectpandit/tech-health-lab-

## Overview

##### Project Type and Purpose
- The project is a full-stack web application built with Flask. Its purpose is to provide predictive diagnosis systems (for diseases such as diabetes, cancer, heart disease, liver disease, kidney disease, malaria, pneumonia) and includes additional modules like an appointment section.
- The use of machine learning and deep learning is evident from saved models (.pkl and .h5 files in the models directory) as well as model training notebooks in the MODEL_CODE folder.
- The application also integrates standard web interface components (HTML templates, CSS, JavaScript) and backend business logic modules (found in package/) to manage hospital operations (doctor, patient, medication, etc.).

##### File Structure and Architectural Choices
- Frontend Components:
- The “templates” directory contains HTML files that render pages (e.g., index, cancer, diabetes, heart, etc.).
- The “static” directory further breaks down into CSS, JS, images, and even fonts to style and script the UI.
- Backend Components:
- The main Flask application is bootstrapped via app.py. This is the entry point through which HTTP requests are processed.
- The “package” directory contains modular Python files that represent different aspects of hospital management (doctor, patient, appointment, etc.). This is where your business logic and service orchestration live.
- The “config.json” file likely holds configurable parameters, and “data.db” is your database graph that likely stores persistent application data.
- Machine Learning and Model Components:
- The “models” folder has pretrained ML/DL prediction models to diagnose various diseases.
- The “MODEL_CODE” directory provides training notebooks for different prediction tasks, indicating an iterative development process for refining models.
- Auxiliary Components:
- Datasets under the “datasets” folder are used to train the models.
- Deployment files such as “Procfile” indicate that the application can be deployed in a production environment (Heroku-style deployment, for instance).
- Logs (debug.log, static/debug.log) and version control checkpoints (.ipynb_checkpoints) assist in development and troubleshooting.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        CB["Client Browser"]:::client
        T["Templates (HTML)"]:::client
        S["Static Files (CSS,JS,Images)"]:::client
    end

    %% Application Layer
    subgraph "Application Layer"
        FA["Flask App (app.py)"]:::app
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        BL["Business Logic Modules (package/)"]:::logic
    end

    %% ML Services Layer
    subgraph "ML Services Layer"
        ML["ML Prediction Engine (models/)"]:::ml
        MT["ML Model Training Notebooks (MODEL_CODE)"]:::ml
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["Database (data.db)"]:::data
        DS["Datasets (datasets/)"]:::data
    end

    %% Config & Deployment
    subgraph "Config & Deployment"
        CFG["Configuration (config.json)"]:::config
        PF["Deployment (Procfile)"]:::config
    end

    %% Data Flow & Interactions
    CB -->|"HTTP request"| FA
    FA -->|"callsBusinessLogic"| BL
    FA -->|"callsMLpredictions"| ML
    MT -->|"updatesModels"| ML
    BL -->|"readsWrites"| DB
    BL -->|"accessesData"| DS
    ML -->|"logsAccess"| DB
    FA -->|"renders"| T
    FA -->|"servesAssets"| S
    FA -->|"loadsConfig"| CFG
    FA -->|"deploymentConfig"| PF
    FA -->|"sendsResponse"| CB

    %% Click Events
    click T "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/templates/"
    click S "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/static/"
    click FA "https://github.com/mrperfectpandit/tech-health-lab-/blob/main/app.py"
    click BL "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/package/"
    click ML "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/models/"
    click MT "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/MODEL_CODE/"
    click DB "https://github.com/mrperfectpandit/tech-health-lab-/blob/main/data.db"
    click DS "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/datasets/"
    click CFG "https://github.com/mrperfectpandit/tech-health-lab-/blob/main/config.json"
    click PF "https://github.com/mrperfectpandit/tech-health-lab-/tree/main/Procfile"

    %% Styles
    classDef client fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef app fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef logic fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef ml fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef data fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef config fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
