# lms0806/tracedeck architecture

> Architecture diagram of the GitHub repository lms0806/tracedeck, 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/lms0806/tracedeck
- Repository: https://github.com/lms0806/tracedeck

## Overview

TraceDeck is a Tauri desktop workspace for SSH server sessions. Users save or select a profile, open a server tab, browse and manage remote files, preview and follow logs, and use an ANSI-capable terminal; a separate analyzer parses tracing records and aggregates them by level and target. The graph includes the documented system-status stream and workspace persistence. Sampled frontend calls and Tauri command registration support the UI-to-command links; where implementation details were not excerpted, links to backend subsystems are documented or left out.

Main entry points: [`src-tauri/src/lib.rs`](https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/lib.rs) (Tauri command router), [`src/components/Browser.tsx`](https://github.com/lms0806/tracedeck/blob/main/src/components/Browser.tsx) (Remote browser), [`src/components/browser/useTailStream.ts`](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useTailStream.ts) (Log preview and tail), [`src/main.tsx`](https://github.com/lms0806/tracedeck/blob/main/src/main.tsx) (Session controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Session workspace"]
  node_session_ui["Session controls<br/>[main.tsx]"]
  node_profile_ui["Profile sidebar<br/>[Sidebar.tsx]"]
  node_tabs["Server tabs<br/>[TabBar.tsx]"]
  node_workspace_state[("Workspace persistence<br/>[workspace.ts]")]
end

subgraph group_remote["Remote operations"]
  node_browser["Remote browser<br/>[Browser.tsx]"]
  node_directory["Directory navigation"]
  node_file_list["File listing<br/>[FileList.tsx]"]
  node_remote_ops["File operations<br/>[remote.rs]"]
end

subgraph group_observability["Logs and status"]
  node_logs["Log preview and tail<br/>[useTailStream.ts]"]
  node_log_dock["Log dock<br/>[LogDock.tsx]"]
  node_tracing_analyzer["Tracing analyzer<br/>[main.tsx]"]
  node_tracing_parser["Tracing parser<br/>[tracing.ts]"]
  node_system_status["System status stream<br/>[RemoteStatus.tsx]"]
end

subgraph group_terminal["Terminal access"]
  node_terminal_hook["Terminal sessions<br/>[useTerminal.ts]"]
  node_terminal_dock["Terminal dock<br/>[TerminalDock.tsx]"]
end

subgraph group_backend["Tauri and SSH backend"]
  node_sftp["SFTP operations<br/>[sftp.rs]"]
  node_connection["SSH connection<br/>[ssh.rs]"]
  node_profiles["Saved profiles<br/>[profiles.rs]"]
  node_log_backend["Remote log services<br/>[logs.rs]"]
  node_terminal_backend["PTY terminal<br/>[terminal.rs]"]
  node_tauri_commands["Tauri command router<br/>[lib.rs]"]
end

node_user(("Desktop user"))
node_openssh{{"OpenSSH client"}}
node_remote_server{{"Remote Linux server"}}

node_user -->|"opens sessions"| node_session_ui
node_session_ui -->|"manages profiles"| node_profile_ui
node_session_ui -->|"manages tabs"| node_tabs
node_session_ui -->|"loads and saves"| node_workspace_state
node_session_ui -->|"parses logs"| node_tracing_parser
node_user -->|"uses server workspace"| node_browser
node_browser -->|"loads directories"| node_directory
node_browser -->|"renders entries"| node_file_list
node_directory -->|"lists directory"| node_remote_ops
node_browser -->|"manages entries"| node_remote_ops
node_remote_ops -->|"routes commands"| node_tauri_commands
node_remote_ops -.->|"uses SFTP"| node_sftp
node_user -->|"opens log files"| node_logs
node_browser -->|"opens selected files"| node_logs
node_logs -->|"supplies log tabs"| node_log_dock
node_logs -->|"invokes log commands"| node_tauri_commands
node_log_dock -->|"renders log streams"| node_logs
node_logs -->|"starts remote tail"| node_log_backend
node_user -->|"analyzes log files"| node_tracing_analyzer
node_tracing_analyzer -->|"parses records"| node_tracing_parser
node_user -->|"views status"| node_system_status
node_browser -->|"shows remote status"| node_system_status
node_user -->|"opens terminal"| node_terminal_dock
node_terminal_dock -->|"renders sessions"| node_terminal_hook
node_terminal_hook -->|"starts and writes"| node_tauri_commands
node_terminal_hook -->|"stops sessions"| node_tauri_commands
node_tauri_commands -.->|"dispatches terminal commands"| node_terminal_backend
node_tauri_commands -->|"dispatches profile commands"| node_profiles
node_tauri_commands -->|"dispatches remote commands"| node_remote_ops
node_connection -->|"builds SSH commands"| node_openssh
node_sftp -->|"runs SFTP commands"| node_openssh
node_openssh -->|"connects over SSH"| node_remote_server
node_log_backend -->|"reads and tails logs"| node_remote_server
node_terminal_backend -->|"opens remote PTY"| node_remote_server

click node_session_ui "https://github.com/lms0806/tracedeck/blob/main/src/main.tsx"
click node_profile_ui "https://github.com/lms0806/tracedeck/blob/main/src/components/app/Sidebar.tsx"
click node_tabs "https://github.com/lms0806/tracedeck/blob/main/src/components/app/TabBar.tsx"
click node_workspace_state "https://github.com/lms0806/tracedeck/blob/main/src/app/workspace.ts"
click node_browser "https://github.com/lms0806/tracedeck/blob/main/src/components/Browser.tsx"
click node_directory "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useRemoteDirectory.ts"
click node_file_list "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/FileList.tsx"
click node_remote_ops "https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/remote.rs"
click node_sftp "https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/sftp.rs"
click node_connection "https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/ssh.rs"
click node_profiles "https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/profiles.rs"
click node_logs "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useTailStream.ts"
click node_log_dock "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/LogDock.tsx"
click node_log_backend "https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/logs.rs"
click node_tracing_analyzer "https://github.com/lms0806/tracedeck/blob/main/src/main.tsx"
click node_tracing_parser "https://github.com/lms0806/tracedeck/blob/main/src/logging/tracing.ts"
click node_system_status "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/RemoteStatus.tsx"
click node_terminal_hook "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useTerminal.ts"
click node_terminal_dock "https://github.com/lms0806/tracedeck/blob/main/src/components/browser/TerminalDock.tsx"
click node_terminal_backend "https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/terminal.rs"
click node_tauri_commands "https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/lib.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_session_ui,node_profile_ui,node_tabs,node_workspace_state,node_user,node_openssh toneBlue
class node_browser,node_directory,node_file_list,node_remote_ops toneAmber
class node_logs,node_log_dock,node_tracing_analyzer,node_tracing_parser,node_system_status,node_remote_server toneMint
class node_terminal_hook,node_terminal_dock toneRose
class node_sftp,node_connection,node_profiles,node_log_backend,node_terminal_backend,node_tauri_commands toneIndigo
```

## Components

### Session workspace

- [Session controls](https://github.com/lms0806/tracedeck/blob/main/src/main.tsx): `src/main.tsx`
- [Profile sidebar](https://github.com/lms0806/tracedeck/blob/main/src/components/app/Sidebar.tsx): `src/components/app/Sidebar.tsx`
- [Server tabs](https://github.com/lms0806/tracedeck/blob/main/src/components/app/TabBar.tsx): `src/components/app/TabBar.tsx`
- [Workspace persistence](https://github.com/lms0806/tracedeck/blob/main/src/app/workspace.ts): `src/app/workspace.ts`

### Remote operations

- [Remote browser](https://github.com/lms0806/tracedeck/blob/main/src/components/Browser.tsx): `src/components/Browser.tsx`
- [Directory navigation](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useRemoteDirectory.ts): `src/components/browser/useRemoteDirectory.ts`
- [File listing](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/FileList.tsx): `src/components/browser/FileList.tsx`
- [File operations](https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/remote.rs): `src-tauri/src/remote.rs`

### Logs and status

- [Log preview and tail](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useTailStream.ts): `src/components/browser/useTailStream.ts`
- [Log dock](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/LogDock.tsx): `src/components/browser/LogDock.tsx`
- [Tracing analyzer](https://github.com/lms0806/tracedeck/blob/main/src/main.tsx): `src/main.tsx`
- [Tracing parser](https://github.com/lms0806/tracedeck/blob/main/src/logging/tracing.ts): `src/logging/tracing.ts`
- [System status stream](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/RemoteStatus.tsx): `src/components/browser/RemoteStatus.tsx`

### Terminal access

- [Terminal sessions](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/useTerminal.ts): `src/components/browser/useTerminal.ts`
- [Terminal dock](https://github.com/lms0806/tracedeck/blob/main/src/components/browser/TerminalDock.tsx): `src/components/browser/TerminalDock.tsx`

### Tauri and SSH backend

- [SFTP operations](https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/sftp.rs): `src-tauri/core/src/sftp.rs`
- [SSH connection](https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/ssh.rs): `src-tauri/core/src/ssh.rs`
- [Saved profiles](https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/profiles.rs): `src-tauri/src/profiles.rs`
- [Remote log services](https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/logs.rs): `src-tauri/core/src/logs.rs`
- [PTY terminal](https://github.com/lms0806/tracedeck/blob/main/src-tauri/core/src/terminal.rs): `src-tauri/core/src/terminal.rs`
- [Tauri command router](https://github.com/lms0806/tracedeck/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Desktop user**
- **OpenSSH client**
- **Remote Linux server**

## Connections

- Desktop user → Session controls: opens sessions (evidence: `README.md`)
- Session controls → Profile sidebar: manages profiles (evidence: `src/main.tsx`)
- Session controls → Server tabs: manages tabs (evidence: `src/main.tsx`)
- Session controls → Workspace persistence: loads and saves (evidence: `src/main.tsx`)
- Session controls → Tracing parser: parses logs (evidence: `src/main.tsx`)
- Desktop user → Remote browser: uses server workspace (evidence: `README.md`)
- Remote browser → Directory navigation: loads directories (evidence: `src/components/Browser.tsx`)
- Remote browser → File listing: renders entries (evidence: `src/components/Browser.tsx`)
- Directory navigation → File operations: lists directory (evidence: `src/components/browser/useRemoteDirectory.ts`)
- Remote browser → File operations: manages entries (evidence: `src/components/Browser.tsx`)
- File operations → Tauri command router: routes commands (evidence: `src-tauri/src/lib.rs`)
- File operations → SFTP operations: uses SFTP
- Desktop user → Log preview and tail: opens log files (evidence: `README.md`)
- Remote browser → Log preview and tail: opens selected files (evidence: `README.md`)
- Log preview and tail → Log dock: supplies log tabs (evidence: `src/components/browser/LogDock.tsx`)
- Log preview and tail → Tauri command router: invokes log commands (evidence: `src/components/browser/useTailStream.ts`)
- Log dock → Log preview and tail: renders log streams (evidence: `src/components/browser/LogDock.tsx`)
- Log preview and tail → Remote log services: starts remote tail (evidence: `README.md`)
- Desktop user → Tracing analyzer: analyzes log files (evidence: `README.md`)
- Tracing analyzer → Tracing parser: parses records (evidence: `src/main.tsx`)
- Desktop user → System status stream: views status (evidence: `README.md`)
- Remote browser → System status stream: shows remote status (evidence: `src/components/Browser.tsx`)
- Desktop user → Terminal dock: opens terminal (evidence: `README.md`)
- Terminal dock → Terminal sessions: renders sessions (evidence: `src/components/browser/TerminalDock.tsx`)
- Terminal sessions → Tauri command router: starts and writes (evidence: `src/components/browser/useTerminal.ts`)
- Terminal sessions → Tauri command router: stops sessions (evidence: `src/components/browser/useTerminal.ts`)
- Tauri command router → PTY terminal: dispatches terminal commands
- Tauri command router → Saved profiles: dispatches profile commands (evidence: `src-tauri/src/lib.rs`)
- Tauri command router → File operations: dispatches remote commands (evidence: `src-tauri/src/lib.rs`)
- SSH connection → OpenSSH client: builds SSH commands (evidence: `src-tauri/core/src/ssh.rs`)
- SFTP operations → OpenSSH client: runs SFTP commands (evidence: `src-tauri/core/src/sftp.rs`)
- OpenSSH client → Remote Linux server: connects over SSH (evidence: `README.md`)
- Remote log services → Remote Linux server: reads and tails logs (evidence: `README.md`)
- PTY terminal → Remote Linux server: opens remote PTY (evidence: `README.md`)
