# aryanjha256/duaarr architecture

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

## Overview

duaarr is a small Rust disk-usage analyzer. It prints a banner, repeatedly reads user input, and lists entries in the current directory until the user enters `q`; directories are measured recursively and results are printed. The excerpts show the main call flow and filesystem operations. They do not establish additional product capabilities or integrations.

Main entry points: [`src/list.rs`](https://github.com/aryanjha256/duaarr/blob/master/src/list.rs) (Directory listing), [`src/main.rs`](https://github.com/aryanjha256/duaarr/blob/master/src/main.rs) (Program loop), [`src/user_input.rs`](https://github.com/aryanjha256/duaarr/blob/master/src/user_input.rs) (Input handler), [`src/utils/message.rs`](https://github.com/aryanjha256/duaarr/blob/master/src/utils/message.rs) (Banner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction"]
  node_main["Program loop<br/>[main.rs]"]
  node_input["Input handler<br/>[user_input.rs]"]
  node_message["Banner<br/>[message.rs]"]
end

subgraph group_analysis["Directory analysis"]
  node_listing["Directory listing<br/>[list.rs]"]
  node_size["Recursive size<br/>[dir_size.rs]"]
end

node_user(("User"))
node_filesystem[("Filesystem")]
node_terminal["Terminal"]

node_main -->|"prints banner"| node_message
node_main -->|"reads input"| node_input
node_input -->|"returns continue"| node_main
node_main -->|"lists entries"| node_listing
node_user -->|"enters command"| node_input
node_input -->|"prints response"| node_terminal
node_message -->|"prints title"| node_terminal
node_listing -->|"reads entries"| node_filesystem
node_listing -->|"calculates directory size"| node_size
node_size -->|"reads recursively"| node_filesystem
node_listing -->|"prints results"| node_terminal

click node_main "https://github.com/aryanjha256/duaarr/blob/master/src/main.rs"
click node_input "https://github.com/aryanjha256/duaarr/blob/master/src/user_input.rs"
click node_message "https://github.com/aryanjha256/duaarr/blob/master/src/utils/message.rs"
click node_listing "https://github.com/aryanjha256/duaarr/blob/master/src/list.rs"
click node_size "https://github.com/aryanjha256/duaarr/blob/master/src/libs/dir_size.rs"

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_input,node_message,node_user toneBlue
class node_listing,node_size,node_filesystem toneAmber
class node_terminal toneIndigo
```

## Components

### Interaction

- [Program loop](https://github.com/aryanjha256/duaarr/blob/master/src/main.rs): `src/main.rs`
- [Input handler](https://github.com/aryanjha256/duaarr/blob/master/src/user_input.rs): `src/user_input.rs`
- [Banner](https://github.com/aryanjha256/duaarr/blob/master/src/utils/message.rs): `src/utils/message.rs`

### Directory analysis

- [Directory listing](https://github.com/aryanjha256/duaarr/blob/master/src/list.rs): `src/list.rs`
- [Recursive size](https://github.com/aryanjha256/duaarr/blob/master/src/libs/dir_size.rs): `src/libs/dir_size.rs`

### Other components

- **User**
- **Filesystem**
- **Terminal**

## Connections

- Program loop → Banner: prints banner (evidence: `src/main.rs`)
- Program loop → Input handler: reads input (evidence: `src/main.rs`)
- Input handler → Program loop: returns continue (evidence: `src/main.rs`)
- Program loop → Directory listing: lists entries (evidence: `src/main.rs`)
- User → Input handler: enters command (evidence: `src/user_input.rs`)
- Input handler → Terminal: prints response (evidence: `src/user_input.rs`)
- Banner → Terminal: prints title (evidence: `src/utils/message.rs`)
- Directory listing → Filesystem: reads entries (evidence: `src/list.rs`)
- Directory listing → Recursive size: calculates directory size (evidence: `src/list.rs`)
- Recursive size → Filesystem: reads recursively (evidence: `src/libs/dir_size.rs`)
- Directory listing → Terminal: prints results (evidence: `src/list.rs`)
