# lusingander/serie architecture

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

- Interactive diagram: https://gitdiagram.com/lusingander/serie
- Repository: https://github.com/lusingander/serie

## Overview

Serie is a terminal Git-history browser: users launch it in a repository, inspect an ordered commit graph and refs, search and open commit details, and optionally run configured commands. Git metadata feeds graph layout and terminal-image rendering; the TUI presents browsing modes and routes keyboard events. Configuration controls graph appearance, keybindings, search, and user commands. The graph reflects README capabilities as well as sampled code; several internal UI connections are omitted where excerpts do not establish callers.

Main entry points: [`src/main.rs`](https://github.com/lusingander/serie/blob/master/src/main.rs) (CLI startup), [`src/app.rs`](https://github.com/lusingander/serie/blob/master/src/app.rs) (Application state), [`src/view/views.rs`](https://github.com/lusingander/serie/blob/master/src/view/views.rs) (View coordination), [`src/graph/image.rs`](https://github.com/lusingander/serie/blob/master/src/graph/image.rs) (Graph image rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and settings"]
  node_main["CLI startup<br/>[main.rs]"]
  node_config["Configuration<br/>[config.rs]"]
  node_color["Color themes<br/>[color.rs]"]
end

subgraph group_history["Git history and graph"]
  node_git["Git repository data<br/>[git.rs]"]
  node_calc["Graph layout<br/>[calc.rs]"]
  node_geometry["Graph geometry<br/>[geometry.rs]"]
  node_image["Graph image rendering<br/>[image.rs]"]
  node_graph["Graph facade<br/>[graph.rs]"]
end

subgraph group_interface["Terminal interface"]
  node_app["Application state<br/>[app.rs]"]
  node_events["Event processing<br/>[event.rs]"]
  node_keybind["Keybindings<br/>[keybind.rs]"]
  node_views["View coordination<br/>[views.rs]"]
  node_list["Commit list view<br/>[list.rs]"]
  node_detail["Commit detail view<br/>[detail.rs]"]
  node_refs["Refs view<br/>[refs.rs]"]
  node_help["Help view<br/>[help.rs]"]
  node_usercmdview["User command view<br/>[user_command.rs]"]
  node_commitlist["Commit list widget<br/>[commit_list.rs]"]
  node_commitdetail["Commit detail widget<br/>[commit_detail.rs]"]
  node_refwidget["Ref list widget<br/>[ref_list.rs]"]
  node_userwidget["Command output widget"]
  node_search["Search options<br/>[search.rs]"]
end

subgraph group_extensions["Commands and protocol"]
  node_protocol["Image protocols<br/>[protocol.rs]"]
  node_external["External commands<br/>[external.rs]"]
end

node_user(("Repository user"))

node_user -->|"launches"| node_main
node_main -->|"loads"| node_config
node_main -->|"starts"| node_app
node_main -->|"configures"| node_git
node_main -->|"configures"| node_graph
node_main -->|"selects"| node_protocol
node_main -->|"creates"| node_keybind
node_main -->|"imports"| node_events
node_main -->|"imports"| node_color
node_main -->|"imports"| node_external
node_graph -->|"exposes"| node_calc
node_graph -->|"exposes"| node_image
node_calc -->|"reads metadata"| node_git
node_image -->|"prepares images"| node_protocol
node_image -->|"uses colors"| node_color
node_events -->|"uses refresh context"| node_views
node_keybind -->|"maps keys"| node_events
node_app -->|"opens detail"| node_detail
node_app -->|"opens command view"| node_usercmdview
node_app -->|"builds list state"| node_commitlist
node_refwidget -->|"uses refs"| node_git
node_refwidget -->|"references state"| node_app
node_userwidget -->|"supports commands"| node_app
node_user -->|"browses history"| node_app
node_user -->|"searches commits"| node_search
node_user -->|"runs configured commands"| node_external
node_git -.->|"provides history"| node_app
node_app -.->|"coordinates views"| node_views
node_views -.->|"selects view"| node_list
node_list -.->|"renders list"| node_commitlist
node_detail -.->|"renders detail"| node_commitdetail
node_views -.->|"selects view"| node_refs
node_views -.->|"selects view"| node_help
node_views -.->|"selects view"| node_usercmdview
node_usercmdview -.->|"renders output"| node_userwidget
node_commitlist -.->|"uses options"| node_search
node_image -.->|"uses geometry"| node_geometry

click node_main "https://github.com/lusingander/serie/blob/master/src/main.rs"
click node_config "https://github.com/lusingander/serie/blob/master/src/config.rs"
click node_color "https://github.com/lusingander/serie/blob/master/src/color.rs"
click node_git "https://github.com/lusingander/serie/blob/master/src/git.rs"
click node_calc "https://github.com/lusingander/serie/blob/master/src/graph/calc.rs"
click node_geometry "https://github.com/lusingander/serie/blob/master/src/graph/geometry.rs"
click node_image "https://github.com/lusingander/serie/blob/master/src/graph/image.rs"
click node_graph "https://github.com/lusingander/serie/blob/master/src/graph.rs"
click node_app "https://github.com/lusingander/serie/blob/master/src/app.rs"
click node_events "https://github.com/lusingander/serie/blob/master/src/event.rs"
click node_keybind "https://github.com/lusingander/serie/blob/master/src/keybind.rs"
click node_views "https://github.com/lusingander/serie/blob/master/src/view/views.rs"
click node_list "https://github.com/lusingander/serie/blob/master/src/view/list.rs"
click node_detail "https://github.com/lusingander/serie/blob/master/src/view/detail.rs"
click node_refs "https://github.com/lusingander/serie/blob/master/src/view/refs.rs"
click node_help "https://github.com/lusingander/serie/blob/master/src/view/help.rs"
click node_usercmdview "https://github.com/lusingander/serie/blob/master/src/view/user_command.rs"
click node_commitlist "https://github.com/lusingander/serie/blob/master/src/widget/commit_list.rs"
click node_commitdetail "https://github.com/lusingander/serie/blob/master/src/widget/commit_detail.rs"
click node_refwidget "https://github.com/lusingander/serie/blob/master/src/widget/ref_list.rs"
click node_userwidget "https://github.com/lusingander/serie/blob/master/src/widget/commit_user_command.rs"
click node_search "https://github.com/lusingander/serie/blob/master/src/search.rs"
click node_protocol "https://github.com/lusingander/serie/blob/master/src/protocol.rs"
click node_external "https://github.com/lusingander/serie/blob/master/src/external.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_config,node_color,node_user toneBlue
class node_git,node_calc,node_geometry,node_image,node_graph toneAmber
class node_app,node_events,node_keybind,node_views,node_list,node_detail,node_refs,node_help,node_usercmdview,node_commitlist,node_commitdetail,node_refwidget,node_userwidget,node_search toneMint
class node_protocol,node_external toneRose
```

## Components

### Startup and settings

- [CLI startup](https://github.com/lusingander/serie/blob/master/src/main.rs): `src/main.rs`
- [Configuration](https://github.com/lusingander/serie/blob/master/src/config.rs): `src/config.rs`
- [Color themes](https://github.com/lusingander/serie/blob/master/src/color.rs): `src/color.rs`

### Git history and graph

- [Git repository data](https://github.com/lusingander/serie/blob/master/src/git.rs): `src/git.rs`
- [Graph layout](https://github.com/lusingander/serie/blob/master/src/graph/calc.rs): `src/graph/calc.rs`
- [Graph geometry](https://github.com/lusingander/serie/blob/master/src/graph/geometry.rs): `src/graph/geometry.rs`
- [Graph image rendering](https://github.com/lusingander/serie/blob/master/src/graph/image.rs): `src/graph/image.rs`
- [Graph facade](https://github.com/lusingander/serie/blob/master/src/graph.rs): `src/graph.rs`

### Terminal interface

- [Application state](https://github.com/lusingander/serie/blob/master/src/app.rs): `src/app.rs`
- [Event processing](https://github.com/lusingander/serie/blob/master/src/event.rs): `src/event.rs`
- [Keybindings](https://github.com/lusingander/serie/blob/master/src/keybind.rs): `src/keybind.rs`
- [View coordination](https://github.com/lusingander/serie/blob/master/src/view/views.rs): `src/view/views.rs`
- [Commit list view](https://github.com/lusingander/serie/blob/master/src/view/list.rs): `src/view/list.rs`
- [Commit detail view](https://github.com/lusingander/serie/blob/master/src/view/detail.rs): `src/view/detail.rs`
- [Refs view](https://github.com/lusingander/serie/blob/master/src/view/refs.rs): `src/view/refs.rs`
- [Help view](https://github.com/lusingander/serie/blob/master/src/view/help.rs): `src/view/help.rs`
- [User command view](https://github.com/lusingander/serie/blob/master/src/view/user_command.rs): `src/view/user_command.rs`
- [Commit list widget](https://github.com/lusingander/serie/blob/master/src/widget/commit_list.rs): `src/widget/commit_list.rs`
- [Commit detail widget](https://github.com/lusingander/serie/blob/master/src/widget/commit_detail.rs): `src/widget/commit_detail.rs`
- [Ref list widget](https://github.com/lusingander/serie/blob/master/src/widget/ref_list.rs): `src/widget/ref_list.rs`
- [Command output widget](https://github.com/lusingander/serie/blob/master/src/widget/commit_user_command.rs): `src/widget/commit_user_command.rs`
- [Search options](https://github.com/lusingander/serie/blob/master/src/search.rs): `src/search.rs`

### Commands and protocol

- [Image protocols](https://github.com/lusingander/serie/blob/master/src/protocol.rs): `src/protocol.rs`
- [External commands](https://github.com/lusingander/serie/blob/master/src/external.rs): `src/external.rs`

### Other components

- **Repository user**

## Connections

- Repository user → CLI startup: launches (evidence: `README.md`)
- CLI startup → Configuration: loads (evidence: `src/main.rs`)
- CLI startup → Application state: starts (evidence: `src/main.rs`)
- CLI startup → Git repository data: configures (evidence: `src/main.rs`)
- CLI startup → Graph facade: configures (evidence: `src/main.rs`)
- CLI startup → Image protocols: selects (evidence: `src/main.rs`)
- CLI startup → Keybindings: creates (evidence: `src/main.rs`)
- CLI startup → Event processing: imports (evidence: `src/main.rs`)
- CLI startup → Color themes: imports (evidence: `src/main.rs`)
- CLI startup → External commands: imports (evidence: `src/main.rs`)
- Graph facade → Graph layout: exposes (evidence: `src/graph.rs`)
- Graph facade → Graph image rendering: exposes (evidence: `src/graph.rs`)
- Graph layout → Git repository data: reads metadata (evidence: `src/graph/calc.rs`)
- Graph image rendering → Image protocols: prepares images (evidence: `src/graph/image.rs`)
- Graph image rendering → Color themes: uses colors (evidence: `src/graph/image.rs`)
- Event processing → View coordination: uses refresh context (evidence: `src/event.rs`)
- Keybindings → Event processing: maps keys (evidence: `src/keybind.rs`)
- Application state → Commit detail view: opens detail (evidence: `src/app.rs`)
- Application state → User command view: opens command view (evidence: `src/app.rs`)
- Application state → Commit list widget: builds list state (evidence: `src/app.rs`)
- Ref list widget → Git repository data: uses refs (evidence: `src/widget/ref_list.rs`)
- Ref list widget → Application state: references state (evidence: `src/widget/ref_list.rs`)
- Command output widget → Application state: supports commands (evidence: `src/widget/commit_user_command.rs`)
- Repository user → Application state: browses history (evidence: `README.md`)
- Repository user → Search options: searches commits (evidence: `README.md`)
- Repository user → External commands: runs configured commands (evidence: `README.md`)
- Git repository data → Application state: provides history
- Application state → View coordination: coordinates views
- View coordination → Commit list view: selects view
- Commit list view → Commit list widget: renders list
- Commit detail view → Commit detail widget: renders detail
- View coordination → Refs view: selects view
- View coordination → Help view: selects view
- View coordination → User command view: selects view
- User command view → Command output widget: renders output
- Commit list widget → Search options: uses options
- Graph image rendering → Graph geometry: uses geometry
