# teytra/my_first_calculator architecture

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

- Interactive diagram: https://gitdiagram.com/teytra/my_first_calculator
- Repository: https://github.com/teytra/my_first_calculator

## Overview

This is a small C# WinForms calculator. The user enters two integer operands, selects an operation, and requests a result; the form also exposes a clear action. Program starts the form, whose event handlers update the displayed operands and perform arithmetic. The README documents the four operations and clear; sampled code confirms the arithmetic and input behavior. The designer excerpt is incomplete, so links for controls not shown there are based on the documented UI and handler definitions.

Main entry points: [`Form1.Designer.cs`](https://github.com/teytra/my_first_calculator/blob/main/Form1.Designer.cs) (Calculator UI), [`Program.cs`](https://github.com/teytra/my_first_calculator/blob/main/Program.cs) (Application entry), [`Form1.cs`](https://github.com/teytra/my_first_calculator/blob/main/Form1.cs) (Operand entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Application startup"]
  node_program["Application entry<br/>[Program.cs]"]
end

subgraph group_calculator["Calculator form"]
  node_form["Calculator UI<br/>[Form1.Designer.cs]"]
  node_input["Operand entry<br/>[Form1.cs]"]
  node_operation["Operation selection<br/>[Form1.cs]"]
  node_arithmetic["Arithmetic result<br/>[Form1.cs]"]
  node_clear["Clear values<br/>[Form1.cs]"]
end

node_user(("Calculator user"))

node_program -->|"creates and runs"| node_form
node_user -->|"uses"| node_form
node_form -->|"dispatches digit clicks"| node_input
node_form -->|"dispatches operator clicks"| node_operation
node_form -->|"dispatches equals click"| node_arithmetic
node_form -->|"dispatches clear click"| node_clear

click node_program "https://github.com/teytra/my_first_calculator/blob/main/Program.cs"
click node_form "https://github.com/teytra/my_first_calculator/blob/main/Form1.Designer.cs"
click node_input "https://github.com/teytra/my_first_calculator/blob/main/Form1.cs"
click node_operation "https://github.com/teytra/my_first_calculator/blob/main/Form1.cs"
click node_arithmetic "https://github.com/teytra/my_first_calculator/blob/main/Form1.cs"
click node_clear "https://github.com/teytra/my_first_calculator/blob/main/Form1.cs"

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_program,node_user toneBlue
class node_form,node_input,node_operation,node_arithmetic,node_clear toneAmber
```

## Components

### Application startup

- [Application entry](https://github.com/teytra/my_first_calculator/blob/main/Program.cs): `Program.cs`

### Calculator form

- [Calculator UI](https://github.com/teytra/my_first_calculator/blob/main/Form1.Designer.cs): `Form1.Designer.cs`
- [Operand entry](https://github.com/teytra/my_first_calculator/blob/main/Form1.cs): `Form1.cs`
- [Operation selection](https://github.com/teytra/my_first_calculator/blob/main/Form1.cs): `Form1.cs`
- [Arithmetic result](https://github.com/teytra/my_first_calculator/blob/main/Form1.cs): `Form1.cs`
- [Clear values](https://github.com/teytra/my_first_calculator/blob/main/Form1.cs): `Form1.cs`

### Other components

- **Calculator user**

## Connections

- Application entry → Calculator UI: creates and runs
- Calculator user → Calculator UI: uses
- Calculator UI → Operand entry: dispatches digit clicks
- Calculator UI → Operation selection: dispatches operator clicks
- Calculator UI → Arithmetic result: dispatches equals click
- Calculator UI → Clear values: dispatches clear click
