# aidan79225/gitcrisp architecture

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

- Interactive diagram: https://gitdiagram.com/aidan79225/gitcrisp
- Repository: https://github.com/aidan79225/gitcrisp

## Overview

GitCrisp is a PySide6 desktop Git client. Users open or switch repositories, inspect commit history and working-tree changes, then stage, commit, or perform Git operations through the UI; the app coordinates queries and commands against a repository adapter. Its major capabilities also include blame/file history, branch and remote management, conflict handling, tags, stashes, submodules, and worktrees. Several operation modules were not sampled, so those capability links are documented at subsystem level rather than inferred as internal call chains.

Main entry points: [`git_gui/presentation/main_window/repo_lifecycle.py`](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/repo_lifecycle.py) (Repository lifecycle), [`git_gui/presentation/main_window/main_window.py`](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/main_window.py) (Main window flows), [`git_gui/presentation/bus.py`](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/bus.py) (Query and command buses), [`git_gui/application/queries.py`](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/application/queries.py) (Repository queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Desktop interface"]
  node_startup["App startup<br/>[main.py]"]
  node_lifecycle["Repository lifecycle<br/>[repo_lifecycle.py]"]
  node_window["Main window flows<br/>[main_window.py]"]
  node_history_ui["History and graph<br/>[graph.py]"]
  node_working_ui["Working tree and diff<br/>[working_tree.py]"]
  node_dialogs["Git operation dialogs"]
  node_worktree_dialog["Worktree dialog"]
end

subgraph group_application["Application coordination"]
  node_bus["Query and command buses<br/>[bus.py]"]
  node_queries["Repository queries<br/>[queries.py]"]
  node_commands["Repository commands<br/>[commands.py]"]
end

subgraph group_domain["Git domain"]
  node_entities["Git entities<br/>[entities.py]"]
  node_ports["Repository ports<br/>[ports.py]"]
end

subgraph group_infrastructure["Git infrastructure"]
  node_repository["Pygit2 repository<br/>[repository.py]"]
  node_git_ops["Git operation adapters"]
  node_file_history["File history adapter"]
  node_git_process["Git process utilities<br/>[git_process.py]"]
  node_repo_store[("Repository list store<br/>[repo_store.py]")]
end

subgraph group_support["Presentation support"]
  node_theme["Theme system"]
  node_background["Widget background<br/>[background.py]"]
  node_change_detector["Repository change monitor"]
end

node_user(("Git user"))

node_user -->|"opens app"| node_startup
node_startup -->|"opens window"| node_lifecycle
node_lifecycle -->|"coordinates operations"| node_bus
node_window -.->|"presents history"| node_history_ui
node_window -.->|"presents changes"| node_working_ui
node_window -.->|"offers Git actions"| node_dialogs
node_lifecycle -->|"opens worktree flow"| node_worktree_dialog
node_worktree_dialog -->|"uses widget"| node_background
node_bus -->|"constructs commands"| node_commands
node_bus -->|"constructs queries"| node_queries
node_commands -->|"writes through"| node_ports
node_queries -->|"reads through"| node_ports
node_commands -->|"uses domain types"| node_entities
node_queries -->|"uses domain types"| node_entities
node_repository -->|"composes adapters"| node_git_ops
node_repository -->|"constructs adapter"| node_file_history
node_git_ops -.->|"uses process utilities"| node_git_process
node_file_history -->|"runs Git commands"| node_git_process
node_lifecycle -.->|"loads repository state"| node_repo_store
node_lifecycle -->|"starts monitoring"| node_change_detector
node_theme -.->|"styles widgets"| node_background

click node_startup "https://github.com/aidan79225/gitcrisp/blob/master/main.py"
click node_lifecycle "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/repo_lifecycle.py"
click node_window "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/main_window.py"
click node_history_ui "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/graph.py"
click node_working_ui "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/working_tree.py"
click node_dialogs "https://github.com/aidan79225/gitcrisp/tree/master/git_gui/presentation/dialogs"
click node_worktree_dialog "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/dialogs/add_worktree_dialog.py"
click node_theme "https://github.com/aidan79225/gitcrisp/tree/master/git_gui/presentation/theme"
click node_background "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/background.py"
click node_bus "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/bus.py"
click node_queries "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/application/queries.py"
click node_commands "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/application/commands.py"
click node_entities "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/domain/entities.py"
click node_ports "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/domain/ports.py"
click node_repository "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/pygit2/repository.py"
click node_git_ops "https://github.com/aidan79225/gitcrisp/tree/master/git_gui/infrastructure/pygit2"
click node_file_history "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/file_history_cli.py"
click node_git_process "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/git_process.py"
click node_repo_store "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/repo_store.py"
click node_change_detector "https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/services/repo_change_detector.py"

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_startup,node_lifecycle,node_window,node_history_ui,node_working_ui,node_dialogs,node_worktree_dialog,node_user toneBlue
class node_bus,node_queries,node_commands toneAmber
class node_entities,node_ports toneMint
class node_repository,node_git_ops,node_file_history,node_git_process,node_repo_store toneRose
class node_theme,node_background,node_change_detector toneIndigo
```

## Components

### Desktop interface

- [App startup](https://github.com/aidan79225/gitcrisp/blob/master/main.py): `main.py`
- [Repository lifecycle](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/repo_lifecycle.py): `git_gui/presentation/main_window/repo_lifecycle.py`
- [Main window flows](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/main_window/main_window.py): `git_gui/presentation/main_window/main_window.py`
- [History and graph](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/graph.py): `git_gui/presentation/widgets/graph.py`
- [Working tree and diff](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/working_tree.py): `git_gui/presentation/widgets/working_tree.py`
- [Git operation dialogs](https://github.com/aidan79225/gitcrisp/tree/master/git_gui/presentation/dialogs): `git_gui/presentation/dialogs`
- [Worktree dialog](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/dialogs/add_worktree_dialog.py): `git_gui/presentation/dialogs/add_worktree_dialog.py`

### Application coordination

- [Query and command buses](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/bus.py): `git_gui/presentation/bus.py`
- [Repository queries](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/application/queries.py): `git_gui/application/queries.py`
- [Repository commands](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/application/commands.py): `git_gui/application/commands.py`

### Git domain

- [Git entities](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/domain/entities.py): `git_gui/domain/entities.py`
- [Repository ports](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/domain/ports.py): `git_gui/domain/ports.py`

### Git infrastructure

- [Pygit2 repository](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/pygit2/repository.py): `git_gui/infrastructure/pygit2/repository.py`
- [Git operation adapters](https://github.com/aidan79225/gitcrisp/tree/master/git_gui/infrastructure/pygit2): `git_gui/infrastructure/pygit2`
- [File history adapter](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/file_history_cli.py): `git_gui/infrastructure/file_history_cli.py`
- [Git process utilities](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/git_process.py): `git_gui/infrastructure/git_process.py`
- [Repository list store](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/infrastructure/repo_store.py): `git_gui/infrastructure/repo_store.py`

### Presentation support

- [Theme system](https://github.com/aidan79225/gitcrisp/tree/master/git_gui/presentation/theme): `git_gui/presentation/theme`
- [Widget background](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/widgets/background.py): `git_gui/presentation/widgets/background.py`
- [Repository change monitor](https://github.com/aidan79225/gitcrisp/blob/master/git_gui/presentation/services/repo_change_detector.py): `git_gui/presentation/services/repo_change_detector.py`

### Other components

- **Git user**

## Connections

- Git user → App startup: opens app (evidence: `main.py`)
- App startup → Repository lifecycle: opens window (evidence: `main.py`)
- Repository lifecycle → Query and command buses: coordinates operations (evidence: `git_gui/presentation/main_window/repo_lifecycle.py`)
- Main window flows → History and graph: presents history
- Main window flows → Working tree and diff: presents changes
- Main window flows → Git operation dialogs: offers Git actions
- Repository lifecycle → Worktree dialog: opens worktree flow (evidence: `git_gui/presentation/main_window/repo_lifecycle.py`)
- Worktree dialog → Widget background: uses widget (evidence: `git_gui/presentation/dialogs/add_worktree_dialog.py`)
- Query and command buses → Repository commands: constructs commands (evidence: `git_gui/presentation/bus.py`)
- Query and command buses → Repository queries: constructs queries (evidence: `git_gui/presentation/bus.py`)
- Repository commands → Repository ports: writes through (evidence: `git_gui/application/commands.py`)
- Repository queries → Repository ports: reads through (evidence: `git_gui/application/queries.py`)
- Repository commands → Git entities: uses domain types (evidence: `git_gui/application/commands.py`)
- Repository queries → Git entities: uses domain types (evidence: `git_gui/application/queries.py`)
- Pygit2 repository → Git operation adapters: composes adapters (evidence: `git_gui/infrastructure/pygit2/repository.py`)
- Pygit2 repository → File history adapter: constructs adapter (evidence: `git_gui/infrastructure/pygit2/repository.py`)
- Git operation adapters → Git process utilities: uses process utilities (evidence: `git_gui/infrastructure/pygit2/repo_state_ops.py`)
- File history adapter → Git process utilities: runs Git commands (evidence: `git_gui/infrastructure/file_history_cli.py`)
- Repository lifecycle → Repository list store: loads repository state
- Repository lifecycle → Repository change monitor: starts monitoring (evidence: `git_gui/presentation/main_window/repo_lifecycle.py`)
- Theme system → Widget background: styles widgets
