# krystofslama/repostudio architecture

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

- Interactive diagram: https://gitdiagram.com/krystofslama/repostudio
- Repository: https://github.com/krystofslama/repostudio

## Overview

RepoStudio is a macOS app for browsing local repositories and working with Markdown. Users open a repository, inspect its files and Git changes, select a file, then edit Markdown or review a diff and preview; the app also exposes branch, commit, and remote operations through its Git service. The README establishes the main editing, preview, filtering, and diff capabilities; the service protocol documents additional Git operations. Some UI wiring and service internals are unsampled, so only documented or indexed relationships are shown.

Main entry points: [`macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift) (Git and file operations), [`macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift`](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift) (Markdown editor), [`macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift) (Dashboard components), [`macOS/RepoStudio/RepoStudio/RepoStudioApp.swift`](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/RepoStudioApp.swift) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and workspace"]
  node_app_entry["App entry"]
  node_workspace["Workspace"]
  node_dashboard["Repository dashboard"]
  node_dashboard_helpers["Dashboard components"]
  node_dashboard_vm["Dashboard state"]
end

subgraph group_repository["Repository and Git"]
  node_repo_service["Repository service"]
  node_git_service["Git and file operations"]
  node_status_parser["Status parser"]
  node_diff_parser["Diff parser"]
  node_repository_context["Repository context"]
  node_changed_file["Changed files<br/>[ChangedFile.swift]"]
  node_repository_file["Repository files"]
  node_change_type["Change and stage status"]
  node_diff_line["Diff lines<br/>[DiffLine.swift]"]
  node_dashboard_error["Repository errors"]
end

subgraph group_writing["Markdown workflow"]
  node_markdown_editor["Markdown editor"]
  node_editor_appearance["Editor appearance"]
  node_markdown_commands["Formatting commands"]
  node_markdown_preview["Markdown preview"]
  node_preview_helpers["Preview rendering helpers"]
end

subgraph group_support["Shared presentation"]
  node_split_view["Split layout"]
  node_editor_settings["Editor settings"]
  node_commands_settings["Command settings"]
  node_about["About view"]
end

node_user(("User"))
node_git["Git executable"]

node_user -->|"opens"| node_app_entry
node_app_entry -->|"shows"| node_workspace
node_workspace -->|"displays"| node_dashboard
node_workspace -->|"uses"| node_dashboard_vm
node_dashboard -->|"observes"| node_dashboard_vm
node_dashboard_helpers -->|"supports"| node_dashboard
node_dashboard_helpers -->|"renders"| node_markdown_editor
node_dashboard_helpers -->|"renders"| node_markdown_preview
node_dashboard_helpers -->|"uses"| node_split_view
node_dashboard_vm -->|"requests repository data"| node_repo_service
node_repo_service -->|"implemented by"| node_git_service
node_git_service -->|"runs commands"| node_git
node_git_service -->|"parses status"| node_status_parser
node_git_service -->|"parses diffs"| node_diff_parser
node_status_parser -->|"creates"| node_changed_file
node_status_parser -->|"uses"| node_change_type
node_diff_parser -->|"creates"| node_diff_line
node_git_service -->|"returns"| node_repository_context
node_git_service -->|"returns"| node_repository_file
node_git_service -->|"reports"| node_dashboard_error
node_changed_file -->|"uses"| node_change_type
node_repository_context -->|"uses"| node_change_type
node_repository_context -->|"uses"| node_diff_line
node_markdown_editor -->|"applies"| node_editor_appearance
node_markdown_editor -->|"supports"| node_markdown_commands
node_markdown_preview -->|"uses"| node_preview_helpers
node_editor_settings -->|"configures"| node_editor_appearance
node_editor_settings -->|"configures"| node_markdown_editor
node_commands_settings -->|"configures"| node_markdown_editor
node_app_entry -->|"presents"| node_about

click node_app_entry "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/RepoStudioApp.swift"
click node_workspace "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Workspace/WorkspaceView.swift"
click node_dashboard "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardView.swift"
click node_dashboard_helpers "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift"
click node_dashboard_vm "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/ViewModels/Dashboard/DashboardViewModel.swift"
click node_repo_service "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/RepositoryService.swift"
click node_git_service "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift"
click node_status_parser "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitStatusParser.swift"
click node_diff_parser "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitUnifiedDiffParser.swift"
click node_repository_context "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryContext.swift"
click node_changed_file "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/ChangedFile.swift"
click node_repository_file "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryFile.swift"
click node_change_type "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/GitChangeType.swift"
click node_diff_line "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/DiffLine.swift"
click node_dashboard_error "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/DashboardError.swift"
click node_markdown_editor "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift"
click node_editor_appearance "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/EditorAppearance.swift"
click node_markdown_commands "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownCommands.swift"
click node_markdown_preview "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewView.swift"
click node_preview_helpers "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewHelpers.swift"
click node_split_view "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Shared/BalancedSplitView.swift"
click node_editor_settings "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Settings/EditorSettingsView.swift"
click node_commands_settings "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Settings/CommandsSettingsView.swift"
click node_about "https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/About/AboutRepoStudioView.swift"

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_app_entry,node_workspace,node_dashboard,node_dashboard_helpers,node_dashboard_vm,node_user toneBlue
class node_repo_service,node_git_service,node_status_parser,node_diff_parser,node_repository_context,node_changed_file,node_repository_file,node_change_type,node_diff_line,node_dashboard_error toneAmber
class node_markdown_editor,node_editor_appearance,node_markdown_commands,node_markdown_preview,node_preview_helpers toneMint
class node_split_view,node_editor_settings,node_commands_settings,node_about toneRose
class node_git toneIndigo
```

## Components

### App and workspace

- [App entry](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/RepoStudioApp.swift): `macOS/RepoStudio/RepoStudio/RepoStudioApp.swift`
- [Workspace](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Workspace/WorkspaceView.swift): `macOS/RepoStudio/RepoStudio/Views/Workspace/WorkspaceView.swift`
- [Repository dashboard](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardView.swift): `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardView.swift`
- [Dashboard components](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift): `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`
- [Dashboard state](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/ViewModels/Dashboard/DashboardViewModel.swift): `macOS/RepoStudio/RepoStudio/ViewModels/Dashboard/DashboardViewModel.swift`

### Repository and Git

- [Repository service](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/RepositoryService.swift): `macOS/RepoStudio/RepoStudio/Services/Repository/RepositoryService.swift`
- [Git and file operations](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift): `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`
- [Status parser](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitStatusParser.swift): `macOS/RepoStudio/RepoStudio/Services/Repository/GitStatusParser.swift`
- [Diff parser](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Services/Repository/GitUnifiedDiffParser.swift): `macOS/RepoStudio/RepoStudio/Services/Repository/GitUnifiedDiffParser.swift`
- [Repository context](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryContext.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryContext.swift`
- [Changed files](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/ChangedFile.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/ChangedFile.swift`
- [Repository files](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryFile.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryFile.swift`
- [Change and stage status](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/GitChangeType.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/GitChangeType.swift`
- [Diff lines](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/DiffLine.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/DiffLine.swift`
- [Repository errors](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Models/Repository/DashboardError.swift): `macOS/RepoStudio/RepoStudio/Models/Repository/DashboardError.swift`

### Markdown workflow

- [Markdown editor](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift): `macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift`
- [Editor appearance](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/EditorAppearance.swift): `macOS/RepoStudio/RepoStudio/Views/Editor/EditorAppearance.swift`
- [Formatting commands](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownCommands.swift): `macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownCommands.swift`
- [Markdown preview](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewView.swift): `macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewView.swift`
- [Preview rendering helpers](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewHelpers.swift): `macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewHelpers.swift`

### Shared presentation

- [Split layout](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Shared/BalancedSplitView.swift): `macOS/RepoStudio/RepoStudio/Views/Shared/BalancedSplitView.swift`
- [Editor settings](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Settings/EditorSettingsView.swift): `macOS/RepoStudio/RepoStudio/Views/Settings/EditorSettingsView.swift`
- [Command settings](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/Settings/CommandsSettingsView.swift): `macOS/RepoStudio/RepoStudio/Views/Settings/CommandsSettingsView.swift`
- [About view](https://github.com/krystofslama/repostudio/blob/main/macOS/RepoStudio/RepoStudio/Views/About/AboutRepoStudioView.swift): `macOS/RepoStudio/RepoStudio/Views/About/AboutRepoStudioView.swift`

### Other components

- **User**
- **Git executable**

## Connections

- User → App entry: opens (evidence: `README.md`)
- App entry → Workspace: shows (evidence: `macOS/RepoStudio/RepoStudio/RepoStudioApp.swift`)
- Workspace → Repository dashboard: displays (evidence: `macOS/RepoStudio/RepoStudio/Views/Workspace/WorkspaceHelpers.swift`)
- Workspace → Dashboard state: uses (evidence: `macOS/RepoStudio/RepoStudio/Views/Workspace/WorkspaceView.swift`)
- Repository dashboard → Dashboard state: observes (evidence: `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardView.swift`)
- Dashboard components → Repository dashboard: supports (evidence: `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`)
- Dashboard components → Markdown editor: renders (evidence: `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`)
- Dashboard components → Markdown preview: renders (evidence: `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`)
- Dashboard components → Split layout: uses (evidence: `macOS/RepoStudio/RepoStudio/Views/Dashboard/DashboardHelpers.swift`)
- Dashboard state → Repository service: requests repository data (evidence: `macOS/RepoStudio/RepoStudio/ViewModels/Dashboard/DashboardViewModel.swift`)
- Repository service → Git and file operations: implemented by (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Git and file operations → Git executable: runs commands (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Git and file operations → Status parser: parses status (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Git and file operations → Diff parser: parses diffs (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Status parser → Changed files: creates (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitStatusParser.swift`)
- Status parser → Change and stage status: uses (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitStatusParser.swift`)
- Diff parser → Diff lines: creates (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitUnifiedDiffParser.swift`)
- Git and file operations → Repository context: returns (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Git and file operations → Repository files: returns (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Git and file operations → Repository errors: reports (evidence: `macOS/RepoStudio/RepoStudio/Services/Repository/GitCLIRepositoryService.swift`)
- Changed files → Change and stage status: uses (evidence: `macOS/RepoStudio/RepoStudio/Models/Repository/ChangedFile.swift`)
- Repository context → Change and stage status: uses (evidence: `macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryContext.swift`)
- Repository context → Diff lines: uses (evidence: `macOS/RepoStudio/RepoStudio/Models/Repository/RepositoryContext.swift`)
- Markdown editor → Editor appearance: applies (evidence: `macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownEditorView.swift`)
- Markdown editor → Formatting commands: supports (evidence: `macOS/RepoStudio/RepoStudio/Views/Editor/MarkdownCommands.swift`)
- Markdown preview → Preview rendering helpers: uses (evidence: `macOS/RepoStudio/RepoStudio/Views/Preview/MarkdownPreviewHelpers.swift`)
- Editor settings → Editor appearance: configures (evidence: `macOS/RepoStudio/RepoStudio/Views/Settings/EditorSettingsView.swift`)
- Editor settings → Markdown editor: configures (evidence: `macOS/RepoStudio/RepoStudio/Views/Settings/EditorSettingsView.swift`)
- Command settings → Markdown editor: configures (evidence: `macOS/RepoStudio/RepoStudio/Views/Settings/CommandsSettingsView.swift`)
- App entry → About view: presents (evidence: `macOS/RepoStudio/RepoStudio/RepoStudioApp.swift`)
