# amrhalim/3310-go architecture

> Architecture diagram of the GitHub repository amrhalim/3310-go, 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/amrhalim/3310-go
- Repository: https://github.com/amrhalim/3310-go

## Overview

3310-go is a small bidirectional parser between English text and classic phone-key sequences. The principal user-to-result path is an HTTP request reaching the API handler, which encodes its fixed example text and returns both forms as HTML; the exported encoder and decoder also provide the core conversion capabilities as package APIs. Encoding and decoding are distinct domain stages, supported by shared marker constants and rune helpers. The graph reflects shown calls; no request-driven conversion or decoder use by the HTTP handler is evidenced.

Main entry points: [`api/index.go`](https://github.com/amrhalim/3310-go/blob/main/api/index.go) (HTML handler), [`packages/encoder/encoder.go`](https://github.com/amrhalim/3310-go/blob/main/packages/encoder/encoder.go) (3310 encoder), [`packages/decoder/decoder.go`](https://github.com/amrhalim/3310-go/blob/main/packages/decoder/decoder.go) (3310 decoder), [`packages/utils/contants.go`](https://github.com/amrhalim/3310-go/blob/main/packages/utils/contants.go) (Format markers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP presentation"]
  node_handler["HTML handler<br/>[index.go]"]
end

subgraph group_conversion["Text conversion"]
  node_encoder["3310 encoder<br/>[encoder.go]"]
  node_decoder["3310 decoder<br/>[decoder.go]"]
end

subgraph group_shared["Shared utilities"]
  node_constants["Format markers<br/>[contants.go]"]
  node_helpers["Rune helpers<br/>[utils.go]"]
end

node_user(("HTTP client"))

node_user -->|"HTTP request"| node_handler
node_handler -->|"encodes example"| node_encoder
node_handler -->|"returns HTML"| node_user
node_encoder -->|"uses markers"| node_constants
node_encoder -->|"converts runes"| node_helpers
node_decoder -->|"uses markers"| node_constants
node_decoder -->|"converts runes"| node_helpers

click node_handler "https://github.com/amrhalim/3310-go/blob/main/api/index.go"
click node_encoder "https://github.com/amrhalim/3310-go/blob/main/packages/encoder/encoder.go"
click node_decoder "https://github.com/amrhalim/3310-go/blob/main/packages/decoder/decoder.go"
click node_constants "https://github.com/amrhalim/3310-go/blob/main/packages/utils/contants.go"
click node_helpers "https://github.com/amrhalim/3310-go/blob/main/packages/utils/utils.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_handler,node_user toneBlue
class node_encoder,node_decoder toneAmber
class node_constants,node_helpers toneMint
```

## Components

### HTTP presentation

- [HTML handler](https://github.com/amrhalim/3310-go/blob/main/api/index.go): `api/index.go`

### Text conversion

- [3310 encoder](https://github.com/amrhalim/3310-go/blob/main/packages/encoder/encoder.go): `packages/encoder/encoder.go`
- [3310 decoder](https://github.com/amrhalim/3310-go/blob/main/packages/decoder/decoder.go): `packages/decoder/decoder.go`

### Shared utilities

- [Format markers](https://github.com/amrhalim/3310-go/blob/main/packages/utils/contants.go): `packages/utils/contants.go`
- [Rune helpers](https://github.com/amrhalim/3310-go/blob/main/packages/utils/utils.go): `packages/utils/utils.go`

### Other components

- **HTTP client**

## Connections

- HTTP client → HTML handler: HTTP request (evidence: `api/index.go`)
- HTML handler → 3310 encoder: encodes example (evidence: `api/index.go`)
- HTML handler → HTTP client: returns HTML (evidence: `api/index.go`)
- 3310 encoder → Format markers: uses markers (evidence: `packages/encoder/encoder.go`)
- 3310 encoder → Rune helpers: converts runes (evidence: `packages/encoder/encoder.go`)
- 3310 decoder → Format markers: uses markers (evidence: `packages/decoder/decoder.go`)
- 3310 decoder → Rune helpers: converts runes (evidence: `packages/decoder/decoder.go`)
