# janecea/rusty-topic-manipulator architecture

> Architecture diagram of the GitHub repository janecea/rusty-topic-manipulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janecea/rusty-topic-manipulator
- Repository: https://github.com/janecea/rusty-topic-manipulator

## Overview

RustyTopicManipulator is a topic-list manager with both interactive and one-shot command-line modes. Startup loads settings, selects a list backend, reads topics, and creates the command controller; the user then views or changes topics, with updates written back when needed. Interactive commands also support random picks, list switching, refresh, and undo/redo. Settings persist list configuration, while interchangeable local, network, and GitHub Gist writers provide list storage. Writer implementations were read, but their internal transport and storage details are not shown in excerpts, so those integration links are not expanded.

Main entry points: [`src/controllers/master_controller.rs`](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/master_controller.rs) (Master controller), [`src/controllers/runtime_controller.rs`](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/runtime_controller.rs) (Runtime controller), [`src/controllers/arg_controller.rs`](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/arg_controller.rs) (Argument controller), [`src/main.rs`](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/main.rs) (Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["Startup<br/>[main.rs]"]
end

subgraph group_control["Command control"]
  node_master["Master controller"]
  node_factory["Controller factories"]
  node_argctl["Argument controller<br/>[arg_controller.rs]"]
  node_runtime["Runtime controller"]
  node_commands["Command definitions<br/>[commands.rs]"]
end

subgraph group_domain["Topic state"]
  node_model["List model<br/>[model.rs]"]
  node_topics["Topic handler<br/>[topic_handler.rs]"]
  node_history["Undo redo history"]
end

subgraph group_storage["List storage"]
  node_writer_trait["Topic writer interface<br/>[mod.rs]"]
  node_local["Local list writer"]
  node_network["Network list writer"]
  node_gist["GitHub Gist writer"]
end

subgraph group_config["Settings and views"]
  node_settings[("Settings and lists<br/>[settings.rs]")]
  node_argview["Argument console view<br/>[arg_view.rs]"]
  node_runtimeview["Interactive console view<br/>[runtime_view.rs]"]
  node_parsed["Parsed command<br/>[parsed_command.rs]"]
end

node_user(("User"))

node_user -->|"starts app"| node_main
node_main -->|"loads settings"| node_settings
node_main -->|"creates controller"| node_master
node_main -->|"selects one-shot view"| node_argview
node_main -->|"selects interactive view"| node_runtimeview
node_master -->|"selects list"| node_settings
node_master -->|"requests controller"| node_factory
node_factory -->|"constructs"| node_argctl
node_factory -->|"constructs"| node_runtime
node_master -->|"loads initial topics"| node_topics
node_master -->|"builds model"| node_model
node_master -->|"creates for local list"| node_local
node_master -->|"creates for network list"| node_network
node_master -->|"creates for Gist list"| node_gist
node_argctl -->|"dispatches commands"| node_commands
node_runtime -->|"dispatches commands"| node_commands
node_argctl -->|"changes or picks topics"| node_topics
node_runtime -->|"changes topic state"| node_topics
node_topics -->|"records and restores state"| node_history
node_argctl -->|"updates active list"| node_settings
node_runtime -->|"switches list"| node_settings
node_runtime -->|"creates for local list"| node_local
node_runtime -->|"creates for network list"| node_network
node_runtime -->|"creates for Gist list"| node_gist
node_runtime -->|"reads input and renders"| node_runtimeview
node_argctl -->|"reads input and displays"| node_argview
node_runtime -->|"uses parsed input"| node_parsed
node_argctl -->|"uses parsed input"| node_parsed
node_local -.->|"implements"| node_writer_trait
node_network -.->|"implements"| node_writer_trait
node_gist -.->|"implements"| node_writer_trait
node_master -->|"reads selected list"| node_writer_trait
node_runtime -->|"reads and writes list"| node_writer_trait
node_master -->|"saves on close"| node_settings

click node_main "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/main.rs"
click node_master "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/master_controller.rs"
click node_factory "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/controller_factory.rs"
click node_argctl "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/arg_controller.rs"
click node_runtime "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/runtime_controller.rs"
click node_commands "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/commands.rs"
click node_model "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/model.rs"
click node_topics "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/topic_handler.rs"
click node_history "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/undo_redo_handler.rs"
click node_writer_trait "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/mod.rs"
click node_local "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/local_topic_writer.rs"
click node_network "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/network_topic_writer.rs"
click node_gist "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/github_gist_topic_writer.rs"
click node_settings "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/settings.rs"
click node_argview "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/arg_view.rs"
click node_runtimeview "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/runtime_view.rs"
click node_parsed "https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/parsed_command.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_user toneBlue
class node_master,node_factory,node_argctl,node_runtime,node_commands toneAmber
class node_model,node_topics,node_history toneMint
class node_writer_trait,node_local,node_network,node_gist toneRose
class node_settings,node_argview,node_runtimeview,node_parsed toneIndigo
```

## Components

### Application entry

- [Startup](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/main.rs): `src/main.rs`

### Command control

- [Master controller](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/master_controller.rs): `src/controllers/master_controller.rs`
- [Controller factories](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/controller_factory.rs): `src/controllers/controller_factory.rs`
- [Argument controller](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/arg_controller.rs): `src/controllers/arg_controller.rs`
- [Runtime controller](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/runtime_controller.rs): `src/controllers/runtime_controller.rs`
- [Command definitions](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/controllers/commands.rs): `src/controllers/commands.rs`

### Topic state

- [List model](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/model.rs): `src/models/model.rs`
- [Topic handler](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/topic_handler.rs): `src/models/topic_handler.rs`
- [Undo redo history](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/undo_redo_handler.rs): `src/models/undo_redo_handler.rs`

### List storage

- [Topic writer interface](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/mod.rs): `src/models/mod.rs`
- [Local list writer](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/local_topic_writer.rs): `src/models/local_topic_writer.rs`
- [Network list writer](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/network_topic_writer.rs): `src/models/network_topic_writer.rs`
- [GitHub Gist writer](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/models/github_gist_topic_writer.rs): `src/models/github_gist_topic_writer.rs`

### Settings and views

- [Settings and lists](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/settings.rs): `src/settings.rs`
- [Argument console view](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/arg_view.rs): `src/views/arg_view.rs`
- [Interactive console view](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/runtime_view.rs): `src/views/runtime_view.rs`
- [Parsed command](https://github.com/janecea/rusty-topic-manipulator/blob/main/src/views/parsed_command.rs): `src/views/parsed_command.rs`

### Other components

- **User**

## Connections

- User → Startup: starts app (evidence: `src/main.rs`)
- Startup → Settings and lists: loads settings (evidence: `src/main.rs`)
- Startup → Master controller: creates controller (evidence: `src/main.rs`)
- Startup → Argument console view: selects one-shot view (evidence: `src/main.rs`)
- Startup → Interactive console view: selects interactive view (evidence: `src/main.rs`)
- Master controller → Settings and lists: selects list (evidence: `src/controllers/master_controller.rs`)
- Master controller → Controller factories: requests controller (evidence: `src/controllers/master_controller.rs`)
- Controller factories → Argument controller: constructs (evidence: `src/controllers/controller_factory.rs`)
- Controller factories → Runtime controller: constructs (evidence: `src/controllers/controller_factory.rs`)
- Master controller → Topic handler: loads initial topics (evidence: `src/controllers/master_controller.rs`)
- Master controller → List model: builds model (evidence: `src/controllers/master_controller.rs`)
- Master controller → Local list writer: creates for local list (evidence: `src/controllers/master_controller.rs`)
- Master controller → Network list writer: creates for network list (evidence: `src/controllers/master_controller.rs`)
- Master controller → GitHub Gist writer: creates for Gist list (evidence: `src/controllers/master_controller.rs`)
- Argument controller → Command definitions: dispatches commands (evidence: `src/controllers/arg_controller.rs`)
- Runtime controller → Command definitions: dispatches commands (evidence: `src/controllers/runtime_controller.rs`)
- Argument controller → Topic handler: changes or picks topics (evidence: `src/controllers/arg_controller.rs`)
- Runtime controller → Topic handler: changes topic state (evidence: `src/controllers/runtime_controller.rs`)
- Topic handler → Undo redo history: records and restores state (evidence: `src/models/topic_handler.rs`)
- Argument controller → Settings and lists: updates active list (evidence: `src/controllers/arg_controller.rs`)
- Runtime controller → Settings and lists: switches list (evidence: `src/controllers/runtime_controller.rs`)
- Runtime controller → Local list writer: creates for local list (evidence: `src/controllers/runtime_controller.rs`)
- Runtime controller → Network list writer: creates for network list (evidence: `src/controllers/runtime_controller.rs`)
- Runtime controller → GitHub Gist writer: creates for Gist list (evidence: `src/controllers/runtime_controller.rs`)
- Runtime controller → Interactive console view: reads input and renders (evidence: `src/controllers/runtime_controller.rs`)
- Argument controller → Argument console view: reads input and displays (evidence: `src/controllers/arg_controller.rs`)
- Runtime controller → Parsed command: uses parsed input (evidence: `src/controllers/runtime_controller.rs`)
- Argument controller → Parsed command: uses parsed input (evidence: `src/controllers/arg_controller.rs`)
- Local list writer → Topic writer interface: implements (evidence: `src/models/mod.rs`)
- Network list writer → Topic writer interface: implements (evidence: `src/models/mod.rs`)
- GitHub Gist writer → Topic writer interface: implements (evidence: `src/models/mod.rs`)
- Master controller → Topic writer interface: reads selected list (evidence: `src/controllers/master_controller.rs`)
- Runtime controller → Topic writer interface: reads and writes list (evidence: `src/controllers/runtime_controller.rs`)
- Master controller → Settings and lists: saves on close (evidence: `src/controllers/master_controller.rs`)
