# atamaibi/golang-tax-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/atamaibi/golang-tax-calculator
- Repository: https://github.com/atamaibi/golang-tax-calculator

## Overview

This is a small Go tax calculator. Its main workflow runs the same input prices through four tax rates, writes each calculation as JSON, and prints a comparison table. The main program owns job setup and output presentation; each job loads prices, calculates tax-inclusive amounts, rounds them, and writes its result. The graph reflects only relationships shown in the excerpts; it does not assume behavior beyond them.

Main entry points: [`main.go`](https://github.com/atamaibi/golang-tax-calculator/blob/main/main.go) (Run tax jobs), [`prices/prices.go`](https://github.com/atamaibi/golang-tax-calculator/blob/main/prices/prices.go) (Tax price job), [`filemanager/filemanager.go`](https://github.com/atamaibi/golang-tax-calculator/blob/main/filemanager/filemanager.go) (File manager), [`printtable/printATable.go`](https://github.com/atamaibi/golang-tax-calculator/blob/main/printtable/printATable.go) (Comparison table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_main["Run tax jobs<br/>[main.go]"]
end

subgraph group_calculation["Price calculation"]
  node_price_job["Tax price job<br/>[prices.go]"]
  node_rounding["Price rounding<br/>[conversion.go]"]
end

subgraph group_io["File and display"]
  node_file_manager["File manager<br/>[filemanager.go]"]
  node_price_input["Price input<br/>[prices.txt]"]
  node_json_results["JSON results<br/>[result_0.json]"]
  node_table["Comparison table<br/>[printATable.go]"]
end

node_user(("User"))
node_stdout(("Terminal output"))

node_user -.->|"runs"| node_main
node_main -->|"creates jobs"| node_price_job
node_price_job -->|"reads prices"| node_file_manager
node_file_manager -->|"reads"| node_price_input
node_price_job -->|"rounds amounts"| node_rounding
node_price_job -->|"writes JSON"| node_file_manager
node_file_manager -->|"writes"| node_json_results
node_main -->|"prints records"| node_table
node_table -->|"prints table"| node_stdout
node_main -->|"prints details"| node_stdout

click node_main "https://github.com/atamaibi/golang-tax-calculator/blob/main/main.go"
click node_price_job "https://github.com/atamaibi/golang-tax-calculator/blob/main/prices/prices.go"
click node_rounding "https://github.com/atamaibi/golang-tax-calculator/blob/main/conversion/conversion.go"
click node_file_manager "https://github.com/atamaibi/golang-tax-calculator/blob/main/filemanager/filemanager.go"
click node_price_input "https://github.com/atamaibi/golang-tax-calculator/blob/main/prices.txt"
click node_json_results "https://github.com/atamaibi/golang-tax-calculator/blob/main/result_0.json"
click node_table "https://github.com/atamaibi/golang-tax-calculator/blob/main/printtable/printATable.go"

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_main,node_user toneBlue
class node_price_job,node_rounding toneAmber
class node_file_manager,node_price_input,node_json_results,node_table toneMint
class node_stdout toneIndigo
```

## Components

### Application workflow

- [Run tax jobs](https://github.com/atamaibi/golang-tax-calculator/blob/main/main.go): `main.go`

### Price calculation

- [Tax price job](https://github.com/atamaibi/golang-tax-calculator/blob/main/prices/prices.go): `prices/prices.go`
- [Price rounding](https://github.com/atamaibi/golang-tax-calculator/blob/main/conversion/conversion.go): `conversion/conversion.go`

### File and display

- [File manager](https://github.com/atamaibi/golang-tax-calculator/blob/main/filemanager/filemanager.go): `filemanager/filemanager.go`
- [Price input](https://github.com/atamaibi/golang-tax-calculator/blob/main/prices.txt): `prices.txt`
- [JSON results](https://github.com/atamaibi/golang-tax-calculator/blob/main/result_0.json): `result_0.json`
- [Comparison table](https://github.com/atamaibi/golang-tax-calculator/blob/main/printtable/printATable.go): `printtable/printATable.go`

### Other components

- **User**
- **Terminal output**

## Connections

- User → Run tax jobs: runs
- Run tax jobs → Tax price job: creates jobs (evidence: `main.go`)
- Tax price job → File manager: reads prices (evidence: `prices/prices.go`)
- File manager → Price input: reads (evidence: `filemanager/filemanager.go`)
- Tax price job → Price rounding: rounds amounts (evidence: `prices/prices.go`)
- Tax price job → File manager: writes JSON (evidence: `prices/prices.go`)
- File manager → JSON results: writes (evidence: `filemanager/filemanager.go`)
- Run tax jobs → Comparison table: prints records (evidence: `main.go`)
- Comparison table → Terminal output: prints table (evidence: `printtable/printATable.go`)
- Run tax jobs → Terminal output: prints details (evidence: `main.go`)
