# sohamroy20gaming/calculator-in-html-css-js architecture

> Architecture diagram of the GitHub repository sohamroy20gaming/calculator-in-html-css-js, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sohamroy20gaming/calculator-in-html-css-js
- Repository: https://github.com/sohamroy20gaming/calculator-in-html-css-js

## Overview

#### Purpose and Entry Point
A static browser calculator implemented with plain HTML, CSS, and JavaScript. It is intended for direct hosting (including GitHub Pages), with `index.html` as the application entry point.

Paths: `index.html`, `README.md`

#### UI Structure
`index.html` defines the calculator’s display and input controls. The document loads the stylesheet and client-side script, so browser parsing establishes the application before any calculator behavior runs.

Paths: `index.html`, `styles.css`, `script.js`

#### Interaction and Calculation Controller
`script.js` is the primary runtime component. It receives button/input events from the HTML UI, updates displayed operands or expressions, and performs calculator operations in the browser. Its boundary is the DOM: it reads user actions and writes display state back to page elements.

Paths: `script.js`, `index.html`

#### Presentation Layer
`styles.css` controls calculator layout, visual hierarchy, button appearance, and responsive/browser-facing presentation. It is separated from calculation logic, allowing UI styling changes without changing arithmetic behavior.

Paths: `styles.css`, `index.html`

#### Runtime and Deployment Model
The application has no server, database, package runtime, or API dependency evident in the repository. It runs entirely in a user’s browser using standard HTML/CSS/JavaScript and can be served as static files through GitHub Pages.

Paths: `index.html`, `.github/workflows/static.yml`

#### Automation Boundary
GitHub Actions configuration provides repository automation for the static site, likely supporting validation or deployment. It is outside the browser application runtime and should not contain calculator-domain behavior.

Paths: `.github/workflows/static.yml`, `.github`

Main entry points: [`index.html`](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/index.html) (Calculator page), [`script.js`](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/script.js) (Calculator controller), [`.github/workflows/static.yml`](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/.github/workflows/static.yml) (Static site workflow), [`styles.css`](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/styles.css) (Presentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser runtime"]
  node_index["Calculator page<br/>HTML entry point<br/>[index.html]"]
  node_styles["Presentation<br/>CSS stylesheet<br/>[styles.css]"]
  node_controller["Calculator controller<br/>Client JavaScript<br/>[script.js]"]
  node_dom["Calculator DOM<br/>UI boundary<br/>[index.html]"]
  node_browser(("Web browser<br/>Static host runtime"))
end

subgraph group_automation["Repository automation"]
  node_workflow{{"Static site workflow<br/>GitHub Actions<br/>[static.yml]"}}
  node_github["GitHub Pages<br/>Static hosting"]
end

node_readme["Project documentation<br/>README<br/>[README.md]"]

node_browser -->|"loads"| node_index
node_index -->|"links"| node_styles
node_index -->|"loads"| node_controller
node_index -->|"defines"| node_dom
node_controller -->|"reads events and updates display"| node_dom
node_workflow -->|"deploys static site"| node_github
node_github -.->|"serves files to"| node_browser

click node_index "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/index.html"
click node_styles "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/styles.css"
click node_controller "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/script.js"
click node_dom "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/index.html"
click node_workflow "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/.github/workflows/static.yml"
click node_readme "https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/README.md"

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_index,node_styles,node_controller,node_dom,node_browser toneBlue
class node_workflow,node_github toneAmber
class node_readme toneNeutral
```

## Components

### Browser runtime

Static calculator runs entirely in the user's browser.

- [Calculator page](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/index.html): HTML entry point · Defines the display and input controls. · `index.html`
- [Presentation](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/styles.css): CSS stylesheet · Controls layout, visual hierarchy, buttons, and responsive presentation. · `styles.css`
- [Calculator controller](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/script.js): Client JavaScript · Handles input, display state, and arithmetic operations through the DOM. · `script.js`
- [Calculator DOM](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/index.html): UI boundary · Connects page controls and display state to client logic. · `index.html`
- **Web browser**: Static host runtime · Parses and executes the static application without a server or API.

### Repository automation

GitHub Actions operates outside the browser runtime.

- [Static site workflow](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/.github/workflows/static.yml): GitHub Actions · Repository automation for validation or deployment. · `.github/workflows/static.yml`
- **GitHub Pages**: Static hosting · Serves the application as static files.

### Other components

- [Project documentation](https://github.com/sohamroy20gaming/calculator-in-html-css-js/blob/main/README.md): README · `README.md`

## Connections

- Web browser → Calculator page: loads
- Calculator page → Presentation: links
- Calculator page → Calculator controller: loads
- Calculator page → Calculator DOM: defines
- Calculator controller → Calculator DOM: reads events and updates display
- Static site workflow → GitHub Pages: deploys static site
- GitHub Pages → Web browser: serves files to
