# racka98/flattenizer architecture

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

- Interactive diagram: https://gitdiagram.com/racka98/flattenizer
- Repository: https://github.com/racka98/flattenizer

## Overview

Flattenizer is a native desktop utility for selecting a folder tree, configuring flattening and ignore rules, previewing eligible files, and copying them to a clean output folder with path-derived sanitized names. The main runtime path is the GUI in src/main.rs building options and invoking the planner or runner in src/core.rs. Project settings are persisted as .flattenizerrc. A separate optional update path checks GitHub Releases, downloads an installer, and launches it. The sampled excerpts show the main call points; detailed internal traversal and GUI wiring is only partially sampled.

Main entry points: [`src/main.rs`](https://github.com/racka98/flattenizer/blob/main/src/main.rs) (GUI and workflow), [`src/core.rs`](https://github.com/racka98/flattenizer/blob/main/src/core.rs) (Copy execution), [`src/update.rs`](https://github.com/racka98/flattenizer/blob/main/src/update.rs) (Release check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["GUI and workflow<br/>[main.rs]"]
  node_folder_picker["Folder picker<br/>[main.rs]"]
  node_settings["Flatten settings<br/>[main.rs]"]
end

subgraph group_flatten["Flattening engine"]
  node_config["Project config<br/>[core.rs]"]
  node_planner["Traversal and filtering<br/>[core.rs]"]
  node_naming["Filename generation<br/>[core.rs]"]
  node_runner["Copy execution<br/>[core.rs]"]
end

subgraph group_updates["Update service"]
  node_update_check["Release check<br/>[update.rs]"]
  node_installer_download["Installer download<br/>[update.rs]"]
  node_installer_launch["Installer launch<br/>[update.rs]"]
end

node_user(("User"))
node_source[("Source folder tree")]
node_output[("Flattened output folder")]
node_github["GitHub Releases"]

node_user -->|"operates"| node_gui
node_gui -->|"chooses folder"| node_folder_picker
node_folder_picker -->|"selects"| node_source
node_gui -->|"configures"| node_settings
node_settings -->|"loads or saves"| node_config
node_settings -->|"previews via"| node_planner
node_settings -->|"runs via"| node_runner
node_planner -->|"traverses"| node_source
node_planner -->|"creates names"| node_naming
node_runner -->|"plans files"| node_planner
node_runner -->|"copies from"| node_source
node_runner -->|"replaces and writes"| node_output
node_gui -->|"starts check"| node_update_check
node_update_check -->|"queries releases"| node_github
node_gui -->|"requests download"| node_installer_download
node_installer_download -->|"fetches asset"| node_github
node_gui -->|"launches installer"| node_installer_launch

click node_gui "https://github.com/racka98/flattenizer/blob/main/src/main.rs"
click node_folder_picker "https://github.com/racka98/flattenizer/blob/main/src/main.rs"
click node_settings "https://github.com/racka98/flattenizer/blob/main/src/main.rs"
click node_config "https://github.com/racka98/flattenizer/blob/main/src/core.rs"
click node_planner "https://github.com/racka98/flattenizer/blob/main/src/core.rs"
click node_naming "https://github.com/racka98/flattenizer/blob/main/src/core.rs"
click node_runner "https://github.com/racka98/flattenizer/blob/main/src/core.rs"
click node_update_check "https://github.com/racka98/flattenizer/blob/main/src/update.rs"
click node_installer_download "https://github.com/racka98/flattenizer/blob/main/src/update.rs"
click node_installer_launch "https://github.com/racka98/flattenizer/blob/main/src/update.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_gui,node_folder_picker,node_settings,node_user toneBlue
class node_config,node_planner,node_naming,node_runner,node_source,node_output toneAmber
class node_update_check,node_installer_download,node_installer_launch toneMint
class node_github toneIndigo
```

## Components

### Desktop interface

- [GUI and workflow](https://github.com/racka98/flattenizer/blob/main/src/main.rs): `src/main.rs`
- [Folder picker](https://github.com/racka98/flattenizer/blob/main/src/main.rs): `src/main.rs`
- [Flatten settings](https://github.com/racka98/flattenizer/blob/main/src/main.rs): `src/main.rs`

### Flattening engine

- [Project config](https://github.com/racka98/flattenizer/blob/main/src/core.rs): `src/core.rs`
- [Traversal and filtering](https://github.com/racka98/flattenizer/blob/main/src/core.rs): `src/core.rs`
- [Filename generation](https://github.com/racka98/flattenizer/blob/main/src/core.rs): `src/core.rs`
- [Copy execution](https://github.com/racka98/flattenizer/blob/main/src/core.rs): `src/core.rs`

### Update service

- [Release check](https://github.com/racka98/flattenizer/blob/main/src/update.rs): `src/update.rs`
- [Installer download](https://github.com/racka98/flattenizer/blob/main/src/update.rs): `src/update.rs`
- [Installer launch](https://github.com/racka98/flattenizer/blob/main/src/update.rs): `src/update.rs`

### Other components

- **User**
- **Source folder tree**
- **Flattened output folder**
- **GitHub Releases**

## Connections

- User → GUI and workflow: operates (evidence: `README.md`)
- GUI and workflow → Folder picker: chooses folder (evidence: `README.md`)
- Folder picker → Source folder tree: selects (evidence: `README.md`)
- GUI and workflow → Flatten settings: configures (evidence: `src/main.rs`)
- Flatten settings → Project config: loads or saves (evidence: `src/main.rs`)
- Flatten settings → Traversal and filtering: previews via (evidence: `src/main.rs`)
- Flatten settings → Copy execution: runs via (evidence: `src/main.rs`)
- Traversal and filtering → Source folder tree: traverses (evidence: `src/core.rs`)
- Traversal and filtering → Filename generation: creates names (evidence: `src/core.rs`)
- Copy execution → Traversal and filtering: plans files (evidence: `src/core.rs`)
- Copy execution → Source folder tree: copies from (evidence: `README.md`)
- Copy execution → Flattened output folder: replaces and writes (evidence: `README.md`)
- GUI and workflow → Release check: starts check (evidence: `src/main.rs`)
- Release check → GitHub Releases: queries releases (evidence: `src/update.rs`)
- GUI and workflow → Installer download: requests download (evidence: `src/main.rs`)
- Installer download → GitHub Releases: fetches asset (evidence: `src/update.rs`)
- GUI and workflow → Installer launch: launches installer (evidence: `src/main.rs`)
