# harsha33983/liver-disease-detection architecture

> Architecture diagram of the GitHub repository harsha33983/liver-disease-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsha33983/liver-disease-detection
- Repository: https://github.com/harsha33983/liver-disease-detection

## Overview

LiverCare is a Django web application for submitting liver-disease risk assessments, viewing assessment results, and managing clinician history. Its main workflow validates ten clinical inputs, runs a saved machine-learning pipeline, persists a record, and presents the result. A separate model-development path builds and saves that pipeline; a management command evaluates it. The README is empty, so capabilities and relationships here rely on the source index and excerpts; links to unsampled runtime components are omitted where not established.

Main entry points: [`liver_disease_prediction/predictor/views.py`](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/views.py) (Assessment views), [`liver_disease_prediction/train_model.py`](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/train_model.py) (Model training), [`liver_disease_prediction/predictor/models.py`](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/models.py) (Assessment record), [`liver_disease_prediction/models`](https://github.com/harsha33983/liver-disease-detection/tree/main/liver_disease_prediction/models) (Trained model artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Assessment web app"]
  node_routes["Web routes<br/>[urls.py]"]
  node_views["Assessment views<br/>[views.py]"]
  node_form["Clinical input form<br/>[forms.py]"]
end

subgraph group_ml["Prediction runtime"]
  node_service["Prediction service"]
  node_artifact["Trained model artifact"]
end

subgraph group_training["Model development"]
  node_training["Model training<br/>[train_model.py]"]
  node_mlutils["ML pipeline utilities<br/>[model_utils.py]"]
  node_dataset["Training dataset"]
  node_tuning["Dataset tuning<br/>[tune_data.py]"]
end

subgraph group_ops["Evaluation and records"]
  node_record["Assessment record<br/>[models.py]"]
  node_database[("Application database<br/>[models.py]")]
  node_evaluation["Model evaluation<br/>[evaluate_model.py]"]
  node_admin["Record administration<br/>[admin.py]"]
end

node_clinician(("Clinician or visitor"))

node_clinician -->|"requests"| node_routes
node_routes -->|"dispatches"| node_views
node_views -->|"validates"| node_form
node_views -->|"requests prediction"| node_service
node_views -->|"creates and reads"| node_record
node_record -->|"persists records"| node_database
node_service -->|"loads model"| node_artifact
node_training -->|"builds pipeline"| node_mlutils
node_training -->|"loads data"| node_dataset
node_training -->|"saves pipeline"| node_artifact
node_tuning -->|"uses pipeline tools"| node_mlutils
node_tuning -->|"writes tuned data"| node_dataset
node_evaluation -->|"loads model"| node_artifact
node_evaluation -->|"reads data"| node_dataset
node_admin -->|"administers"| node_record

click node_routes "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/urls.py"
click node_views "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/views.py"
click node_form "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/forms.py"
click node_record "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/models.py"
click node_database "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/models.py"
click node_service "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/services/prediction_service.py"
click node_artifact "https://github.com/harsha33983/liver-disease-detection/tree/main/liver_disease_prediction/models"
click node_training "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/train_model.py"
click node_mlutils "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/model_utils.py"
click node_dataset "https://github.com/harsha33983/liver-disease-detection/tree/main/liver_disease_prediction/data"
click node_tuning "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/tune_data.py"
click node_evaluation "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/management/commands/evaluate_model.py"
click node_admin "https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/admin.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_views,node_form toneBlue
class node_service,node_artifact toneAmber
class node_training,node_mlutils,node_dataset,node_tuning toneMint
class node_record,node_database,node_evaluation,node_admin toneRose
class node_clinician toneIndigo
```

## Components

### Assessment web app

- [Web routes](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/urls.py): `liver_disease_prediction/predictor/urls.py`
- [Assessment views](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/views.py): `liver_disease_prediction/predictor/views.py`
- [Clinical input form](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/forms.py): `liver_disease_prediction/predictor/forms.py`

### Prediction runtime

- [Prediction service](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/services/prediction_service.py): `liver_disease_prediction/predictor/services/prediction_service.py`
- [Trained model artifact](https://github.com/harsha33983/liver-disease-detection/tree/main/liver_disease_prediction/models): `liver_disease_prediction/models`

### Model development

- [Model training](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/train_model.py): `liver_disease_prediction/train_model.py`
- [ML pipeline utilities](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/model_utils.py): `liver_disease_prediction/model_utils.py`
- [Training dataset](https://github.com/harsha33983/liver-disease-detection/tree/main/liver_disease_prediction/data): `liver_disease_prediction/data`
- [Dataset tuning](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/tune_data.py): `liver_disease_prediction/tune_data.py`

### Evaluation and records

- [Assessment record](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/models.py): `liver_disease_prediction/predictor/models.py`
- [Application database](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/models.py): `liver_disease_prediction/predictor/models.py`
- [Model evaluation](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/management/commands/evaluate_model.py): `liver_disease_prediction/predictor/management/commands/evaluate_model.py`
- [Record administration](https://github.com/harsha33983/liver-disease-detection/blob/main/liver_disease_prediction/predictor/admin.py): `liver_disease_prediction/predictor/admin.py`

### Other components

- **Clinician or visitor**

## Connections

- Clinician or visitor → Web routes: requests (evidence: `liver_disease_prediction/predictor/urls.py`)
- Web routes → Assessment views: dispatches (evidence: `liver_disease_prediction/predictor/urls.py`)
- Assessment views → Clinical input form: validates (evidence: `liver_disease_prediction/predictor/views.py`)
- Assessment views → Prediction service: requests prediction (evidence: `liver_disease_prediction/predictor/views.py`)
- Assessment views → Assessment record: creates and reads (evidence: `liver_disease_prediction/predictor/views.py`)
- Assessment record → Application database: persists records (evidence: `liver_disease_prediction/predictor/models.py`)
- Prediction service → Trained model artifact: loads model (evidence: `liver_disease_prediction/predictor/services/prediction_service.py`)
- Model training → ML pipeline utilities: builds pipeline (evidence: `liver_disease_prediction/train_model.py`)
- Model training → Training dataset: loads data
- Model training → Trained model artifact: saves pipeline (evidence: `liver_disease_prediction/train_model.py`)
- Dataset tuning → ML pipeline utilities: uses pipeline tools (evidence: `liver_disease_prediction/tune_data.py`)
- Dataset tuning → Training dataset: writes tuned data (evidence: `liver_disease_prediction/tune_data.py`)
- Model evaluation → Trained model artifact: loads model (evidence: `liver_disease_prediction/predictor/management/commands/evaluate_model.py`)
- Model evaluation → Training dataset: reads data (evidence: `liver_disease_prediction/predictor/management/commands/evaluate_model.py`)
- Record administration → Assessment record: administers (evidence: `liver_disease_prediction/predictor/admin.py`)
