# saranglab/qdte-project architecture

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

- Interactive diagram: https://gitdiagram.com/saranglab/qdte-project
- Repository: https://github.com/saranglab/qdte-project

## Overview

Sarang QDTE is a native terminal text editor. Users launch it with an optional file, edit through a selected keybinding profile, and save or quit through editor commands; the app coordinates file I/O, editor state, search, and themes, while the terminal layer handles input and rendering. The README documents additional capabilities such as tutorials, setup, and syntax highlighting. Some runtime wiring is unsampled, so those documented branches are shown without inferred call edges.

Main entry points: [`src/editor/mod.rs`](https://github.com/saranglab/qdte-project/blob/main/src/editor/mod.rs) (Editing operations), [`src/app.rs`](https://github.com/saranglab/qdte-project/blob/main/src/app.rs) (App coordinator), [`src/terminal/renderer.rs`](https://github.com/saranglab/qdte-project/blob/main/src/terminal/renderer.rs) (Screen renderer), [`src/theme/mod.rs`](https://github.com/saranglab/qdte-project/blob/main/src/theme/mod.rs) (Theme manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch and configuration"]
  node_cli["CLI arguments<br/>[args.rs]"]
  node_main["Startup and tutorials<br/>[main.rs]"]
  node_config["User configuration<br/>[config.rs]"]
end

subgraph group_interaction["Terminal interaction"]
  node_app["App coordinator<br/>[app.rs]"]
  node_terminal_input["Terminal input<br/>[input.rs]"]
  node_dispatcher["Keymap dispatcher<br/>[dispatcher.rs]"]
  node_normal_map["Normal keymap<br/>[normal.rs]"]
  node_vim_map["Vim keymap<br/>[vim.rs]"]
end

subgraph group_editing["Editing engine"]
  node_editor["Editing operations<br/>[mod.rs]"]
  node_actions["Editor actions<br/>[action.rs]"]
  node_buffer["Text buffer<br/>[buffer.rs]"]
  node_cursor["Cursor movement<br/>[cursor.rs]"]
  node_history["Undo history<br/>[history.rs]"]
  node_mode["Editing modes<br/>[mode.rs]"]
  node_register["Yank register<br/>[register.rs]"]
end

subgraph group_files["File persistence"]
  node_reader["File reader<br/>[reader.rs]"]
  node_writer["File writer<br/>[writer.rs]"]
  node_io_types["I/O conventions<br/>[mod.rs]"]
end

subgraph group_appearance["Rendering and themes"]
  node_renderer["Screen renderer<br/>[renderer.rs]"]
  node_highlight["Syntax highlighting<br/>[highlight.rs]"]
  node_theme_manager["Theme manager<br/>[mod.rs]"]
  node_theme_schema["Theme schema<br/>[schema.rs]"]
  node_builtin_theme["Built-in theme<br/>[builtin.rs]"]
end

node_user(("Editor user"))

node_user -->|"launches"| node_cli
node_cli -.->|"starts editor"| node_main
node_main -.->|"runs"| node_app
node_app -->|"uses settings"| node_config
node_app -->|"applies edits"| node_editor
node_app -->|"loads file"| node_reader
node_app -.->|"saves file"| node_writer
node_app -->|"loads theme"| node_theme_manager
node_user -->|"types keys"| node_terminal_input
node_terminal_input -->|"moves cursor"| node_editor
node_dispatcher -->|"dispatches"| node_normal_map
node_dispatcher -->|"dispatches"| node_vim_map
node_dispatcher -->|"produces actions"| node_editor
node_user -->|"chooses profile"| node_normal_map
node_user -->|"chooses profile"| node_vim_map
node_app -.->|"supplies view state"| node_renderer
node_renderer -->|"highlights lines"| node_highlight
node_renderer -->|"uses active theme"| node_theme_manager
node_renderer -->|"renders text"| node_buffer
node_theme_manager -->|"parses themes"| node_theme_schema
node_theme_manager -->|"loads default"| node_builtin_theme
node_editor -->|"handles actions"| node_actions
node_editor -->|"edits text"| node_buffer
node_editor -->|"updates position"| node_cursor
node_editor -->|"records changes"| node_history
node_editor -->|"stores yanks"| node_register
node_editor -->|"tracks mode"| node_mode
node_reader -.->|"uses conventions"| node_io_types
node_writer -.->|"uses conventions"| node_io_types

click node_cli "https://github.com/saranglab/qdte-project/blob/main/src/cli/args.rs"
click node_main "https://github.com/saranglab/qdte-project/blob/main/src/main.rs"
click node_config "https://github.com/saranglab/qdte-project/blob/main/src/config.rs"
click node_app "https://github.com/saranglab/qdte-project/blob/main/src/app.rs"
click node_terminal_input "https://github.com/saranglab/qdte-project/blob/main/src/terminal/input.rs"
click node_dispatcher "https://github.com/saranglab/qdte-project/blob/main/src/keymap/dispatcher.rs"
click node_normal_map "https://github.com/saranglab/qdte-project/blob/main/src/keymap/normal.rs"
click node_vim_map "https://github.com/saranglab/qdte-project/blob/main/src/keymap/vim.rs"
click node_renderer "https://github.com/saranglab/qdte-project/blob/main/src/terminal/renderer.rs"
click node_highlight "https://github.com/saranglab/qdte-project/blob/main/src/terminal/highlight.rs"
click node_theme_manager "https://github.com/saranglab/qdte-project/blob/main/src/theme/mod.rs"
click node_theme_schema "https://github.com/saranglab/qdte-project/blob/main/src/theme/schema.rs"
click node_builtin_theme "https://github.com/saranglab/qdte-project/blob/main/src/theme/builtin.rs"
click node_editor "https://github.com/saranglab/qdte-project/blob/main/src/editor/mod.rs"
click node_actions "https://github.com/saranglab/qdte-project/blob/main/src/editor/action.rs"
click node_buffer "https://github.com/saranglab/qdte-project/blob/main/src/editor/buffer.rs"
click node_cursor "https://github.com/saranglab/qdte-project/blob/main/src/editor/cursor.rs"
click node_history "https://github.com/saranglab/qdte-project/blob/main/src/editor/history.rs"
click node_mode "https://github.com/saranglab/qdte-project/blob/main/src/editor/mode.rs"
click node_register "https://github.com/saranglab/qdte-project/blob/main/src/editor/register.rs"
click node_reader "https://github.com/saranglab/qdte-project/blob/main/src/io/reader.rs"
click node_writer "https://github.com/saranglab/qdte-project/blob/main/src/io/writer.rs"
click node_io_types "https://github.com/saranglab/qdte-project/blob/main/src/io/mod.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_cli,node_main,node_config,node_user toneBlue
class node_app,node_terminal_input,node_dispatcher,node_normal_map,node_vim_map toneAmber
class node_editor,node_actions,node_buffer,node_cursor,node_history,node_mode,node_register toneMint
class node_reader,node_writer,node_io_types toneRose
class node_renderer,node_highlight,node_theme_manager,node_theme_schema,node_builtin_theme toneIndigo
```

## Components

### Launch and configuration

- [CLI arguments](https://github.com/saranglab/qdte-project/blob/main/src/cli/args.rs): `src/cli/args.rs`
- [Startup and tutorials](https://github.com/saranglab/qdte-project/blob/main/src/main.rs): `src/main.rs`
- [User configuration](https://github.com/saranglab/qdte-project/blob/main/src/config.rs): `src/config.rs`

### Terminal interaction

- [App coordinator](https://github.com/saranglab/qdte-project/blob/main/src/app.rs): `src/app.rs`
- [Terminal input](https://github.com/saranglab/qdte-project/blob/main/src/terminal/input.rs): `src/terminal/input.rs`
- [Keymap dispatcher](https://github.com/saranglab/qdte-project/blob/main/src/keymap/dispatcher.rs): `src/keymap/dispatcher.rs`
- [Normal keymap](https://github.com/saranglab/qdte-project/blob/main/src/keymap/normal.rs): `src/keymap/normal.rs`
- [Vim keymap](https://github.com/saranglab/qdte-project/blob/main/src/keymap/vim.rs): `src/keymap/vim.rs`

### Editing engine

- [Editing operations](https://github.com/saranglab/qdte-project/blob/main/src/editor/mod.rs): `src/editor/mod.rs`
- [Editor actions](https://github.com/saranglab/qdte-project/blob/main/src/editor/action.rs): `src/editor/action.rs`
- [Text buffer](https://github.com/saranglab/qdte-project/blob/main/src/editor/buffer.rs): `src/editor/buffer.rs`
- [Cursor movement](https://github.com/saranglab/qdte-project/blob/main/src/editor/cursor.rs): `src/editor/cursor.rs`
- [Undo history](https://github.com/saranglab/qdte-project/blob/main/src/editor/history.rs): `src/editor/history.rs`
- [Editing modes](https://github.com/saranglab/qdte-project/blob/main/src/editor/mode.rs): `src/editor/mode.rs`
- [Yank register](https://github.com/saranglab/qdte-project/blob/main/src/editor/register.rs): `src/editor/register.rs`

### File persistence

- [File reader](https://github.com/saranglab/qdte-project/blob/main/src/io/reader.rs): `src/io/reader.rs`
- [File writer](https://github.com/saranglab/qdte-project/blob/main/src/io/writer.rs): `src/io/writer.rs`
- [I/O conventions](https://github.com/saranglab/qdte-project/blob/main/src/io/mod.rs): `src/io/mod.rs`

### Rendering and themes

- [Screen renderer](https://github.com/saranglab/qdte-project/blob/main/src/terminal/renderer.rs): `src/terminal/renderer.rs`
- [Syntax highlighting](https://github.com/saranglab/qdte-project/blob/main/src/terminal/highlight.rs): `src/terminal/highlight.rs`
- [Theme manager](https://github.com/saranglab/qdte-project/blob/main/src/theme/mod.rs): `src/theme/mod.rs`
- [Theme schema](https://github.com/saranglab/qdte-project/blob/main/src/theme/schema.rs): `src/theme/schema.rs`
- [Built-in theme](https://github.com/saranglab/qdte-project/blob/main/src/theme/builtin.rs): `src/theme/builtin.rs`

### Other components

- **Editor user**

## Connections

- Editor user → CLI arguments: launches (evidence: `README.md`)
- CLI arguments → Startup and tutorials: starts editor
- Startup and tutorials → App coordinator: runs
- App coordinator → User configuration: uses settings (evidence: `src/app.rs`)
- App coordinator → Editing operations: applies edits (evidence: `src/app.rs`)
- App coordinator → File reader: loads file (evidence: `src/app.rs`)
- App coordinator → File writer: saves file
- App coordinator → Theme manager: loads theme (evidence: `src/app.rs`)
- Editor user → Terminal input: types keys (evidence: `README.md`)
- Terminal input → Editing operations: moves cursor (evidence: `src/terminal/input.rs`)
- Keymap dispatcher → Normal keymap: dispatches (evidence: `src/keymap/dispatcher.rs`)
- Keymap dispatcher → Vim keymap: dispatches (evidence: `src/keymap/dispatcher.rs`)
- Keymap dispatcher → Editing operations: produces actions (evidence: `src/keymap/dispatcher.rs`)
- Editor user → Normal keymap: chooses profile (evidence: `README.md`)
- Editor user → Vim keymap: chooses profile (evidence: `README.md`)
- App coordinator → Screen renderer: supplies view state (evidence: `src/terminal/renderer.rs`)
- Screen renderer → Syntax highlighting: highlights lines (evidence: `src/terminal/renderer.rs`)
- Screen renderer → Theme manager: uses active theme (evidence: `src/terminal/renderer.rs`)
- Screen renderer → Text buffer: renders text (evidence: `src/terminal/renderer.rs`)
- Theme manager → Theme schema: parses themes (evidence: `src/theme/mod.rs`)
- Theme manager → Built-in theme: loads default (evidence: `src/theme/mod.rs`)
- Editing operations → Editor actions: handles actions (evidence: `src/editor/mod.rs`)
- Editing operations → Text buffer: edits text (evidence: `src/editor/mod.rs`)
- Editing operations → Cursor movement: updates position (evidence: `src/editor/mod.rs`)
- Editing operations → Undo history: records changes (evidence: `src/editor/mod.rs`)
- Editing operations → Yank register: stores yanks (evidence: `src/editor/mod.rs`)
- Editing operations → Editing modes: tracks mode (evidence: `src/editor/mod.rs`)
- File reader → I/O conventions: uses conventions (evidence: `src/io/mod.rs`)
- File writer → I/O conventions: uses conventions (evidence: `src/io/mod.rs`)
