# alexanderritola/go-unlock-code-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/alexanderritola/go-unlock-code-calculator
- Repository: https://github.com/alexanderritola/go-unlock-code-calculator

## Overview

This Go command-line calculator accepts a vendor/action and device identifiers, dispatches to vendor-specific unlock algorithms, and prints JSON-encoded results. Its branches cover BlackBerry MEP/PRD lookup and codes, older Huawei USB modem codes, three ZTE variants, and Alcatel C700-family codes. The BlackBerry lookup tables are a substantial internal data layer. Relationships are grounded in the shown main dispatch and function calls; README statements preserve documented capabilities where implementation details are not shown.

Main entry points: [`main.go`](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/main.go) (Command dispatch), [`Blackberry.go`](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Blackberry.go) (MEP and PRD codes), [`findMEP.go`](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/findMEP.go) (MEP and PRD tables), [`Huawei.go`](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Huawei.go) (Old modem codes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and output"]
  node_entry["Command dispatch<br/>[main.go]"]
  node_json["JSON output<br/>[main.go]"]
end

subgraph group_blackberry["BlackBerry codes"]
  node_bb["MEP and PRD codes<br/>[Blackberry.go]"]
  node_bbtable[("MEP and PRD tables<br/>[findMEP.go]")]
end

subgraph group_huawei["Huawei codes"]
  node_huawei["Old modem codes<br/>[Huawei.go]"]
end

subgraph group_zte["ZTE codes"]
  node_zteold["Legacy codes<br/>[ZTE.go]"]
  node_zte03["B03 codes<br/>[ZTE.go]"]
  node_zte04["B04 codes<br/>[ZTE.go]"]
end

subgraph group_alcatel["Alcatel codes"]
  node_alcatel["C700-family codes<br/>[Alcatel.go]"]
end

node_user(("CLI user"))

node_user -->|"provides arguments"| node_entry
node_entry -->|"dispatches unlock"| node_bb
node_entry -->|"queries support"| node_bbtable
node_bb -->|"looks up codes"| node_bbtable
node_entry -->|"dispatches unlock"| node_huawei
node_entry -->|"dispatches unlock"| node_zteold
node_entry -->|"dispatches unlock"| node_zte03
node_entry -->|"dispatches unlock"| node_zte04
node_entry -->|"dispatches unlock"| node_alcatel
node_entry -->|"encodes results"| node_json

click node_entry "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/main.go"
click node_json "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/main.go"
click node_bb "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Blackberry.go"
click node_bbtable "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/findMEP.go"
click node_huawei "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Huawei.go"
click node_zteold "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go"
click node_zte03 "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go"
click node_zte04 "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go"
click node_alcatel "https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Alcatel.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_entry,node_json,node_user toneBlue
class node_bb,node_bbtable toneAmber
class node_huawei toneMint
class node_zteold,node_zte03,node_zte04 toneRose
class node_alcatel toneIndigo
```

## Components

### CLI and output

- [Command dispatch](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/main.go): `main.go`
- [JSON output](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/main.go): `main.go`

### BlackBerry codes

- [MEP and PRD codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Blackberry.go): `Blackberry.go`
- [MEP and PRD tables](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/findMEP.go): `findMEP.go`

### Huawei codes

- [Old modem codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Huawei.go): `Huawei.go`

### ZTE codes

- [Legacy codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go): `ZTE.go`
- [B03 codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go): `ZTE.go`
- [B04 codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/ZTE.go): `ZTE.go`

### Alcatel codes

- [C700-family codes](https://github.com/alexanderritola/go-unlock-code-calculator/blob/master/Alcatel.go): `Alcatel.go`

### Other components

- **CLI user**

## Connections

- CLI user → Command dispatch: provides arguments (evidence: `main.go`)
- Command dispatch → MEP and PRD codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → MEP and PRD tables: queries support (evidence: `main.go`)
- MEP and PRD codes → MEP and PRD tables: looks up codes (evidence: `Blackberry.go`)
- Command dispatch → Old modem codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → Legacy codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → B03 codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → B04 codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → C700-family codes: dispatches unlock (evidence: `main.go`)
- Command dispatch → JSON output: encodes results (evidence: `main.go`)
