# azusalina/filex architecture

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

- Interactive diagram: https://gitdiagram.com/azusalina/filex
- Repository: https://github.com/azusalina/filex

## Overview

fileX is a Rust terminal file manager for browsing a filesystem as an expandable horizontal tree. The main workflow is to launch it at a chosen root, navigate or search the tree, inspect a selection, then open or operate on it. The graph emphasizes the current Rust TUI described by the README; Python modules are omitted because the README says the current version only provides the Rust TUI. Several capabilities and integrations are documented but their implementation excerpts were not shown, so those links cite the README.

Main entry points: [`src/tui.rs`](https://github.com/azusalina/filex/blob/master/src/tui.rs) (Rust TUI), [`src/model.rs`](https://github.com/azusalina/filex/blob/master/src/model.rs) (Tree model), [`src/main.rs`](https://github.com/azusalina/filex/blob/master/src/main.rs) (CLI entry), [`src`](https://github.com/azusalina/filex/tree/master/src) (Open and execute)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch and setup"]
  node_main["CLI entry<br/>[main.rs]"]
  node_configuration["Configuration<br/>[config.rs]"]
end

subgraph group_browse["Tree browsing"]
  node_tui["Rust TUI<br/>[tui.rs]"]
  node_tree["Tree model<br/>[model.rs]"]
  node_tree_layout["Tree layout<br/>[model.rs]"]
  node_directory_io["Directory I/O<br/>[files.rs]"]
  node_search["Tree search<br/>[model.rs]"]
end

subgraph group_inspect["Inspection and actions"]
  node_file_details["File details<br/>[files.rs]"]
  node_link_details["Link details<br/>[links.rs]"]
  node_file_operations["File operations<br/>[files.rs]"]
  node_openers["Open and execute"]
  node_markdown["Markdown preview"]
  node_external_apps["External programs"]
end

subgraph group_runtime["Terminal runtime"]
  node_input["Input handling<br/>[input.rs]"]
  node_terminal_host["Terminal adaptation<br/>[terminal_host.rs]"]
  node_tmux["tmux integration<br/>[tmux.rs]"]
end

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

node_user -->|"launches"| node_main
node_main -->|"loads settings"| node_configuration
node_main -->|"starts"| node_tui
node_tui -->|"navigates"| node_tree
node_tui -->|"renders layout"| node_tree_layout
node_tree -->|"loads entries"| node_directory_io
node_tree -->|"searches tree"| node_search
node_tree -->|"reads directories"| node_filesystem
node_tui -->|"shows dashboard"| node_file_details
node_tui -->|"shows link info"| node_link_details
node_tui -.->|"invokes operations"| node_file_operations
node_tui -.->|"selects opener"| node_openers
node_openers -->|"runs program"| node_external_apps
node_openers -->|"starts preview"| node_markdown
node_markdown -->|"opens in Firefox"| node_external_apps
node_file_operations -->|"changes files"| node_filesystem
node_tui -->|"reads keys"| node_input
node_tui -.->|"adapts terminal"| node_terminal_host
node_tui -->|"configures keys"| node_tmux

click node_main "https://github.com/azusalina/filex/blob/master/src/main.rs"
click node_configuration "https://github.com/azusalina/filex/blob/master/src/config.rs"
click node_tui "https://github.com/azusalina/filex/blob/master/src/tui.rs"
click node_tree "https://github.com/azusalina/filex/blob/master/src/model.rs"
click node_tree_layout "https://github.com/azusalina/filex/blob/master/src/model.rs"
click node_directory_io "https://github.com/azusalina/filex/blob/master/src/files.rs"
click node_search "https://github.com/azusalina/filex/blob/master/src/model.rs"
click node_file_details "https://github.com/azusalina/filex/blob/master/src/files.rs"
click node_link_details "https://github.com/azusalina/filex/blob/master/src/links.rs"
click node_file_operations "https://github.com/azusalina/filex/blob/master/src/files.rs"
click node_openers "https://github.com/azusalina/filex/tree/master/src"
click node_markdown "https://github.com/azusalina/filex/tree/master/src"
click node_input "https://github.com/azusalina/filex/blob/master/src/input.rs"
click node_terminal_host "https://github.com/azusalina/filex/blob/master/src/terminal_host.rs"
click node_tmux "https://github.com/azusalina/filex/blob/master/src/tmux.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_configuration,node_user toneBlue
class node_tui,node_tree,node_tree_layout,node_directory_io,node_search,node_filesystem toneAmber
class node_file_details,node_link_details,node_file_operations,node_openers,node_markdown,node_external_apps toneMint
class node_input,node_terminal_host,node_tmux toneRose
```

## Components

### Launch and setup

- [CLI entry](https://github.com/azusalina/filex/blob/master/src/main.rs): `src/main.rs`
- [Configuration](https://github.com/azusalina/filex/blob/master/src/config.rs): `src/config.rs`

### Tree browsing

- [Rust TUI](https://github.com/azusalina/filex/blob/master/src/tui.rs): `src/tui.rs`
- [Tree model](https://github.com/azusalina/filex/blob/master/src/model.rs): `src/model.rs`
- [Tree layout](https://github.com/azusalina/filex/blob/master/src/model.rs): `src/model.rs`
- [Directory I/O](https://github.com/azusalina/filex/blob/master/src/files.rs): `src/files.rs`
- [Tree search](https://github.com/azusalina/filex/blob/master/src/model.rs): `src/model.rs`

### Inspection and actions

- [File details](https://github.com/azusalina/filex/blob/master/src/files.rs): `src/files.rs`
- [Link details](https://github.com/azusalina/filex/blob/master/src/links.rs): `src/links.rs`
- [File operations](https://github.com/azusalina/filex/blob/master/src/files.rs): `src/files.rs`
- [Open and execute](https://github.com/azusalina/filex/tree/master/src): `src`
- [Markdown preview](https://github.com/azusalina/filex/tree/master/src): `src`
- **External programs**

### Terminal runtime

- [Input handling](https://github.com/azusalina/filex/blob/master/src/input.rs): `src/input.rs`
- [Terminal adaptation](https://github.com/azusalina/filex/blob/master/src/terminal_host.rs): `src/terminal_host.rs`
- [tmux integration](https://github.com/azusalina/filex/blob/master/src/tmux.rs): `src/tmux.rs`

### Other components

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

## Connections

- User → CLI entry: launches (evidence: `README.md`)
- CLI entry → Configuration: loads settings (evidence: `src/main.rs`)
- CLI entry → Rust TUI: starts (evidence: `src/main.rs`)
- Rust TUI → Tree model: navigates (evidence: `src/tui.rs`)
- Rust TUI → Tree layout: renders layout (evidence: `src/tui.rs`)
- Tree model → Directory I/O: loads entries (evidence: `src/model.rs`)
- Tree model → Tree search: searches tree (evidence: `README.md`)
- Tree model → Filesystem: reads directories (evidence: `src/model.rs`)
- Rust TUI → File details: shows dashboard (evidence: `src/tui.rs`)
- Rust TUI → Link details: shows link info (evidence: `README.md`)
- Rust TUI → File operations: invokes operations
- Rust TUI → Open and execute: selects opener (evidence: `src/tui.rs`)
- Open and execute → External programs: runs program (evidence: `README.md`)
- Open and execute → Markdown preview: starts preview (evidence: `README.md`)
- Markdown preview → External programs: opens in Firefox (evidence: `README.md`)
- File operations → Filesystem: changes files (evidence: `README.md`)
- Rust TUI → Input handling: reads keys (evidence: `src/tui.rs`)
- Rust TUI → Terminal adaptation: adapts terminal (evidence: `src/tui.rs`)
- Rust TUI → tmux integration: configures keys (evidence: `src/tui.rs`)
