# mohamedathif-web/bmi-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedathif-web/bmi-calculator
- Repository: https://github.com/mohamedathif-web/bmi-calculator

## Overview

This is a small, browser-based BMI calculator. The documented workflow is to enter weight and height, validate them, convert height to meters, calculate BMI, and display its value and category. The JavaScript excerpt confirms the calculation and result updates; the README documents the broader workflow and responsive design. The HTML and CSS were not excerpted, so their runtime wiring is not independently verified.

Main entry points: [`index.html`](https://github.com/mohamedathif-web/bmi-calculator/blob/main/index.html) (Calculator page), [`js/script.js`](https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js) (Input validation), [`css`](https://github.com/mohamedathif-web/bmi-calculator/tree/main/css) (Responsive styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_page["Calculator page<br/>[index.html]"]
  node_styles["Responsive styling"]
  node_results["Value and category<br/>[script.js]"]
end

subgraph group_logic["BMI logic"]
  node_validation["Input validation<br/>[script.js]"]
  node_calculation["BMI calculation<br/>[script.js]"]
end

node_user(("User"))

node_user -->|"enters measurements"| node_page
node_page -->|"validates input"| node_validation
node_validation -->|"then calculates"| node_calculation
node_calculation -->|"updates display"| node_results
node_page -.->|"styled by"| node_styles

click node_page "https://github.com/mohamedathif-web/bmi-calculator/blob/main/index.html"
click node_styles "https://github.com/mohamedathif-web/bmi-calculator/tree/main/css"
click node_validation "https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js"
click node_calculation "https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js"
click node_results "https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js"

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_page,node_styles,node_results,node_user toneBlue
class node_validation,node_calculation toneAmber
```

## Components

### User interface

- [Calculator page](https://github.com/mohamedathif-web/bmi-calculator/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/mohamedathif-web/bmi-calculator/tree/main/css): `css`
- [Value and category](https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js): `js/script.js`

### BMI logic

- [Input validation](https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js): `js/script.js`
- [BMI calculation](https://github.com/mohamedathif-web/bmi-calculator/blob/main/js/script.js): `js/script.js`

### Other components

- **User**

## Connections

- User → Calculator page: enters measurements (evidence: `README.md`)
- Calculator page → Input validation: validates input (evidence: `README.md`)
- Input validation → BMI calculation: then calculates (evidence: `README.md`)
- BMI calculation → Value and category: updates display (evidence: `js/script.js`)
- Calculator page → Responsive styling: styled by
