# anubhabmondal496-coder/aiims-dholakpur architecture

> Architecture diagram of the GitHub repository anubhabmondal496-coder/aiims-dholakpur, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anubhabmondal496-coder/aiims-dholakpur
- Repository: https://github.com/anubhabmondal496-coder/aiims-dholakpur

## Overview

This Django app serves a form and two linear-regression predictions: calorie burn and medical cost. Requests reach the corresponding view, which converts submitted fields into model features, runs a saved model, and returns an HTML result; medical cost additionally exponentiates the prediction. The README confirms the ML focus, while the sampled views establish these specific flows. The saved model files are present, but their training and feature provenance are not shown.

Main entry points: [`Hospital/medical/urls.py`](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/urls.py) (Medical routes), [`Hospital/medical/views.py`](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py) (HTTP result), [`Hospital/Hospital/urls.py`](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/Hospital/urls.py) (Project routes), [`Hospital/savedmodels/model1.pkl`](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/savedmodels/model1.pkl) (Calorie model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_project_routes["Project routes<br/>[urls.py]"]
  node_medical_routes["Medical routes<br/>[urls.py]"]
  node_home["Home view<br/>[views.py]"]
  node_page["Input page<br/>[index.html]"]
  node_result["HTTP result<br/>[views.py]"]
end

subgraph group_predict["Prediction flows"]
  node_calorie_features["Calorie features<br/>[views.py]"]
  node_calorie_model["Calorie prediction<br/>[views.py]"]
  node_cost_features["Cost features<br/>[views.py]"]
  node_cost_model["Cost prediction<br/>[views.py]"]
  node_cost_transform["Cost transform<br/>[views.py]"]
end

subgraph group_artifacts["Model assets"]
  node_model1["Calorie model<br/>[model1.pkl]"]
  node_model2["Cost model<br/>[model2.pkl]"]
end

node_visitor(("User"))

node_visitor -->|"sends request"| node_project_routes
node_project_routes -->|"includes routes"| node_medical_routes
node_medical_routes -->|"dispatches home"| node_home
node_medical_routes -->|"dispatches POST"| node_calorie_features
node_medical_routes -->|"dispatches POST"| node_cost_features
node_home -->|"renders"| node_page
node_visitor -->|"submits fields"| node_calorie_features
node_visitor -->|"submits fields"| node_cost_features
node_model1 -->|"loaded at startup"| node_calorie_model
node_model2 -->|"loaded at startup"| node_cost_model
node_calorie_features -->|"predicts"| node_calorie_model
node_cost_features -->|"predicts"| node_cost_model
node_cost_model -->|"exponentiates"| node_cost_transform
node_calorie_model -->|"formats result"| node_result
node_cost_transform -->|"formats result"| node_result
node_result -->|"returns response"| node_visitor

click node_project_routes "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/Hospital/urls.py"
click node_medical_routes "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/urls.py"
click node_home "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_page "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/templates/index.html"
click node_calorie_features "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_calorie_model "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_cost_features "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_cost_model "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_cost_transform "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_result "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py"
click node_model1 "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/savedmodels/model1.pkl"
click node_model2 "https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/savedmodels/model2.pkl"

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_project_routes,node_medical_routes,node_home,node_page,node_result,node_visitor toneBlue
class node_calorie_features,node_calorie_model,node_cost_features,node_cost_model,node_cost_transform toneAmber
class node_model1,node_model2 toneMint
```

## Components

### Web entry

- [Project routes](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/Hospital/urls.py): `Hospital/Hospital/urls.py`
- [Medical routes](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/urls.py): `Hospital/medical/urls.py`
- [Home view](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`
- [Input page](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/templates/index.html): `Hospital/templates/index.html`
- [HTTP result](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`

### Prediction flows

- [Calorie features](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`
- [Calorie prediction](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`
- [Cost features](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`
- [Cost prediction](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`
- [Cost transform](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/medical/views.py): `Hospital/medical/views.py`

### Model assets

- [Calorie model](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/savedmodels/model1.pkl): `Hospital/savedmodels/model1.pkl`
- [Cost model](https://github.com/anubhabmondal496-coder/aiims-dholakpur/blob/main/Hospital/savedmodels/model2.pkl): `Hospital/savedmodels/model2.pkl`

### Other components

- **User**

## Connections

- User → Project routes: sends request
- Project routes → Medical routes: includes routes
- Medical routes → Home view: dispatches home
- Medical routes → Calorie features: dispatches POST
- Medical routes → Cost features: dispatches POST
- Home view → Input page: renders
- User → Calorie features: submits fields
- User → Cost features: submits fields
- Calorie model → Calorie prediction: loaded at startup
- Cost model → Cost prediction: loaded at startup
- Calorie features → Calorie prediction: predicts
- Cost features → Cost prediction: predicts
- Cost prediction → Cost transform: exponentiates
- Calorie prediction → HTTP result: formats result
- Cost transform → HTTP result: formats result
- HTTP result → User: returns response
