# affrin-19005/teamcity-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/affrin-19005/teamcity-calculator
- Repository: https://github.com/affrin-19005/teamcity-calculator

## Overview

This is a small Flask calculator: a browser submits two numbers and an operation, the server validates and calculates, and the browser displays the result or an error. The runtime has a UI template, browser-side interaction, a Flask endpoint, and arithmetic logic. The template and styles were not excerpted, so their implementation details and their connection to the browser script are not assumed.

Main entry points: [`app.py`](https://github.com/affrin-19005/teamcity-calculator/blob/main/app.py) (Calculation endpoint), [`static/script.js`](https://github.com/affrin-19005/teamcity-calculator/blob/main/static/script.js) (Browser interaction), [`templates/index.html`](https://github.com/affrin-19005/teamcity-calculator/blob/main/templates/index.html) (Calculator page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser"]
  node_page["Calculator page<br/>[index.html]"]
  node_interaction["Browser interaction<br/>[script.js]"]
end

subgraph group_server["Flask server"]
  node_endpoint["Calculation endpoint<br/>[app.py]"]
  node_arithmetic["Arithmetic logic<br/>[app.py]"]
end

node_user(("User"))

node_endpoint -->|"renders"| node_page
node_user -.->|"uses"| node_interaction
node_interaction -->|"POSTs calculation"| node_endpoint
node_endpoint -->|"calculates"| node_arithmetic
node_endpoint -->|"returns JSON"| node_interaction

click node_page "https://github.com/affrin-19005/teamcity-calculator/blob/main/templates/index.html"
click node_interaction "https://github.com/affrin-19005/teamcity-calculator/blob/main/static/script.js"
click node_endpoint "https://github.com/affrin-19005/teamcity-calculator/blob/main/app.py"
click node_arithmetic "https://github.com/affrin-19005/teamcity-calculator/blob/main/app.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_page,node_interaction,node_user toneBlue
class node_endpoint,node_arithmetic toneAmber
```

## Components

### Browser

- [Calculator page](https://github.com/affrin-19005/teamcity-calculator/blob/main/templates/index.html): `templates/index.html`
- [Browser interaction](https://github.com/affrin-19005/teamcity-calculator/blob/main/static/script.js): `static/script.js`

### Flask server

- [Calculation endpoint](https://github.com/affrin-19005/teamcity-calculator/blob/main/app.py): `app.py`
- [Arithmetic logic](https://github.com/affrin-19005/teamcity-calculator/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- Calculation endpoint → Calculator page: renders (evidence: `app.py`)
- User → Browser interaction: uses
- Browser interaction → Calculation endpoint: POSTs calculation (evidence: `static/script.js`)
- Calculation endpoint → Arithmetic logic: calculates (evidence: `app.py`)
- Calculation endpoint → Browser interaction: returns JSON (evidence: `static/script.js`)
