# sachinsulu/diabetes_predection architecture

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

- Interactive diagram: https://gitdiagram.com/sachinsulu/diabetes_predection
- Repository: https://github.com/sachinsulu/diabetes_predection

## Overview

This Django diabetes-prediction site serves authenticated pages, accepts patient measurements, standardizes them, and returns predictions from selectable SVM and logistic-regression models. It also provides a BMI calculator, account registration/login, and informational pages. The graph follows the sampled URL, view, form, and utility code; model artifacts and templates are included from the tree. The project-level URL wiring and template internals were not sampled, so those relationships are not inferred.

Main entry points: [`project_diabetes/home/views.py`](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py) (Request handlers), [`project_diabetes/home/urls.py`](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/urls.py) (App routes), [`project_diabetes/project_diabetes/settings.py`](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/project_diabetes/settings.py) (Django settings), [`project_diabetes/templates`](https://github.com/sachinsulu/diabetes_predection/tree/main/project_diabetes/templates) (Page templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_urls["App routes<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
  node_templates["Page templates"]
end

subgraph group_prediction["Prediction and BMI"]
  node_forms["BMI form<br/>[forms.py]"]
  node_utils["Prediction and BMI helpers<br/>[utils.py]"]
  node_dataset["Training dataset"]
  node_svm["SVM model"]
  node_logreg["Logistic model"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_register["Registration<br/>[views.py]"]
  node_login["Login and logout<br/>[views.py]"]
  node_doctor["Doctor profile<br/>[views.py]"]
end

subgraph group_persistence["Data and models"]
  node_sqlite[("SQLite database<br/>[db.sqlite3]")]
  node_settings["Django settings<br/>[settings.py]"]
end

node_visitor(("Site visitor"))

node_visitor -->|"requests pages"| node_urls
node_urls -->|"routes to"| node_views
node_views -->|"renders pages"| node_templates
node_views -->|"validates BMI"| node_forms
node_views -->|"calls helpers"| node_utils
node_views -->|"reads dataset"| node_dataset
node_views -->|"loads scaler"| node_scaler
node_views -->|"loads model"| node_svm
node_views -->|"loads model"| node_logreg
node_views -->|"handles registration"| node_register
node_views -->|"handles authentication"| node_login
node_views -->|"serves profile"| node_doctor
node_settings -->|"configures database"| node_sqlite

click node_urls "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/urls.py"
click node_views "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py"
click node_templates "https://github.com/sachinsulu/diabetes_predection/tree/main/project_diabetes/templates"
click node_forms "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/forms.py"
click node_utils "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/utils.py"
click node_dataset "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/diabetes_dataset.csv"
click node_svm "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/svc"
click node_logreg "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/LRmodel"
click node_scaler "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/scaler.pkl"
click node_register "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py"
click node_login "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py"
click node_doctor "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py"
click node_sqlite "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/db.sqlite3"
click node_settings "https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/project_diabetes/settings.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_urls,node_views,node_templates toneBlue
class node_forms,node_utils,node_dataset,node_svm,node_logreg,node_scaler toneAmber
class node_register,node_login,node_doctor toneMint
class node_sqlite,node_settings toneRose
class node_visitor toneIndigo
```

## Components

### Web interface

- [App routes](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/urls.py): `project_diabetes/home/urls.py`
- [Request handlers](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py): `project_diabetes/home/views.py`
- [Page templates](https://github.com/sachinsulu/diabetes_predection/tree/main/project_diabetes/templates): `project_diabetes/templates`

### Prediction and BMI

- [BMI form](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/forms.py): `project_diabetes/home/forms.py`
- [Prediction and BMI helpers](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/utils.py): `project_diabetes/home/utils.py`
- [Training dataset](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/diabetes_dataset.csv): `project_diabetes/static/diabetes_dataset.csv`
- [SVM model](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/svc): `project_diabetes/static/svc`
- [Logistic model](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/LRmodel): `project_diabetes/static/LRmodel`
- [Feature scaler](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/static/scaler.pkl): `project_diabetes/static/scaler.pkl`

### Accounts and profiles

- [Registration](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py): `project_diabetes/home/views.py`
- [Login and logout](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py): `project_diabetes/home/views.py`
- [Doctor profile](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/home/views.py): `project_diabetes/home/views.py`

### Data and models

- [SQLite database](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/db.sqlite3): `project_diabetes/db.sqlite3`
- [Django settings](https://github.com/sachinsulu/diabetes_predection/blob/main/project_diabetes/project_diabetes/settings.py): `project_diabetes/project_diabetes/settings.py`

### Other components

- **Site visitor**

## Connections

- Site visitor → App routes: requests pages (evidence: `project_diabetes/home/urls.py`)
- App routes → Request handlers: routes to (evidence: `project_diabetes/home/urls.py`)
- Request handlers → Page templates: renders pages (evidence: `project_diabetes/home/views.py`)
- Request handlers → BMI form: validates BMI (evidence: `project_diabetes/home/views.py`)
- Request handlers → Prediction and BMI helpers: calls helpers (evidence: `project_diabetes/home/views.py`)
- Request handlers → Training dataset: reads dataset (evidence: `project_diabetes/home/views.py`)
- Request handlers → Feature scaler: loads scaler (evidence: `project_diabetes/home/views.py`)
- Request handlers → SVM model: loads model (evidence: `project_diabetes/home/views.py`)
- Request handlers → Logistic model: loads model (evidence: `project_diabetes/home/views.py`)
- Request handlers → Registration: handles registration (evidence: `project_diabetes/home/urls.py`)
- Request handlers → Login and logout: handles authentication (evidence: `project_diabetes/home/urls.py`)
- Request handlers → Doctor profile: serves profile (evidence: `project_diabetes/home/urls.py`)
- Django settings → SQLite database: configures database (evidence: `project_diabetes/project_diabetes/settings.py`)
