# julianomachados/t1_alest2 architecture

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

- Interactive diagram: https://gitdiagram.com/julianomachados/t1_alest2
- Repository: https://github.com/julianomachados/t1_alest2

## Overview

Pennywise is a command-line application that reads Derry region files and maintains the ten lowest-scoring children in a bounded max-heap. The user selects a region to load, can display the sorted ranking, clear it, request help, or exit. The heap performs insertion and eviction and creates a sorted result on demand. The region inputs are documented and referenced in Main; only the three runtime classes were sampled.

Main entry points: [`src/main/java/pennywise/Main.java`](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Main.java) (CLI and file reader), [`src/main/java/pennywise/Top10Heap.java`](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Top10Heap.java) (Top-10 heap), [`src/main/java/pennywise/Crianca.java`](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Crianca.java) (Child record), [`docs/arquovosTexto`](https://github.com/julianomachados/t1_alest2/tree/main/docs/arquovosTexto) (Region files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_main["CLI and file reader<br/>[Main.java]"]
  node_regions["Region files"]
end

subgraph group_ranking["Ranking core"]
  node_heap["Top-10 heap<br/>[Top10Heap.java]"]
  node_child["Child record<br/>[Crianca.java]"]
end

node_user(("User"))

node_user -->|"sends commands"| node_main
node_main -->|"reads lines"| node_regions
node_main -->|"creates records"| node_child
node_main -->|"inserts records"| node_heap
node_main -->|"requests ranking"| node_heap
node_heap -->|"returns sorted list"| node_main
node_main -->|"clears state"| node_heap
node_main -->|"displays results"| node_user
node_heap -->|"compares records"| node_child

click node_main "https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Main.java"
click node_regions "https://github.com/julianomachados/t1_alest2/tree/main/docs/arquovosTexto"
click node_heap "https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Top10Heap.java"
click node_child "https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Crianca.java"

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_regions,node_user toneBlue
class node_heap,node_child toneAmber
```

## Components

### CLI workflow

- [CLI and file reader](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Main.java): `src/main/java/pennywise/Main.java`
- [Region files](https://github.com/julianomachados/t1_alest2/tree/main/docs/arquovosTexto): `docs/arquovosTexto`

### Ranking core

- [Top-10 heap](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Top10Heap.java): `src/main/java/pennywise/Top10Heap.java`
- [Child record](https://github.com/julianomachados/t1_alest2/blob/main/src/main/java/pennywise/Crianca.java): `src/main/java/pennywise/Crianca.java`

### Other components

- **User**

## Connections

- User → CLI and file reader: sends commands
- CLI and file reader → Region files: reads lines
- CLI and file reader → Child record: creates records
- CLI and file reader → Top-10 heap: inserts records
- CLI and file reader → Top-10 heap: requests ranking
- Top-10 heap → CLI and file reader: returns sorted list
- CLI and file reader → Top-10 heap: clears state
- CLI and file reader → User: displays results
- Top-10 heap → Child record: compares records
