# sheng3533/lightlink architecture

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

- Interactive diagram: https://gitdiagram.com/sheng3533/lightlink
- Repository: https://github.com/sheng3533/lightlink

## Overview

LightLink is a Tauri remote-desktop application. Its main workflow is to start a host service or connect to a remote device, then view/control its screen; the product also provides file transfer, terminal access, monitoring, logs, and settings. Vue views invoke Rust commands, while Rust coordinates TCP sessions, encryption, screen capture, and input handling. The excerpts show the main session and frontend command paths; some feature-view-to-command wiring is unsampled, so those relationships are omitted rather than inferred.

Main entry points: [`src/router/index.ts`](https://github.com/sheng3533/lightlink/blob/main/src/router/index.ts) (View router), [`src-tauri/src/network.rs`](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/network.rs) (TCP sessions), [`src/main.ts`](https://github.com/sheng3533/lightlink/blob/main/src/main.ts) (App bootstrap), [`src/App.vue`](https://github.com/sheng3533/lightlink/blob/main/src/App.vue) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend shell"]
  node_app_entry["App bootstrap<br/>[main.ts]"]
  node_app_shell["App shell<br/>[App.vue]"]
  node_navigation["Sidebar navigation<br/>[Sidebar.vue]"]
  node_router["View router<br/>[index.ts]"]
  node_app_store["App state<br/>[app.ts]"]
end

subgraph group_features["Remote features"]
  node_home["Home<br/>[Home.vue]"]
  node_devices["Devices<br/>[Devices.vue]"]
  node_remote["Remote desktop<br/>[Remote.vue]"]
  node_files["File transfer<br/>[Files.vue]"]
  node_terminal["Remote terminal<br/>[Terminal.vue]"]
  node_monitor["Monitor wall<br/>[MonitorWall.vue]"]
  node_logs["Logs<br/>[Logs.vue]"]
  node_settings["Settings<br/>[Settings.vue]"]
end

subgraph group_runtime["Rust runtime"]
  node_tauri_commands["Tauri commands<br/>[lib.rs]"]
end

subgraph group_transport["Session internals"]
  node_tcp_network["TCP sessions<br/>[network.rs]"]
  node_protocol["Message protocol<br/>[protocol.rs]"]
  node_crypto["Session encryption<br/>[crypto.rs]"]
  node_capture["Screen capture<br/>[capture.rs]"]
  node_input["Input control<br/>[input.rs]"]
end

node_user(("User"))

node_user -->|"uses"| node_app_entry
node_app_entry -->|"mounts"| node_app_shell
node_app_shell -->|"renders"| node_navigation
node_app_shell -->|"renders routes"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_devices
node_router -->|"routes to"| node_remote
node_router -->|"routes to"| node_files
node_router -->|"routes to"| node_terminal
node_router -->|"routes to"| node_monitor
node_router -->|"routes to"| node_logs
node_router -->|"routes to"| node_settings
node_app_entry -->|"initializes"| node_app_store
node_app_store -->|"invokes commands"| node_tauri_commands
node_remote -->|"invokes commands"| node_tauri_commands
node_tauri_commands -->|"delegates sessions"| node_tcp_network
node_tcp_network -->|"uses messages"| node_protocol
node_tcp_network -->|"uses encryption"| node_crypto
node_tcp_network -->|"captures frames"| node_capture
node_tcp_network -->|"dispatches input"| node_input

click node_app_entry "https://github.com/sheng3533/lightlink/blob/main/src/main.ts"
click node_app_shell "https://github.com/sheng3533/lightlink/blob/main/src/App.vue"
click node_navigation "https://github.com/sheng3533/lightlink/blob/main/src/components/Sidebar.vue"
click node_router "https://github.com/sheng3533/lightlink/blob/main/src/router/index.ts"
click node_app_store "https://github.com/sheng3533/lightlink/blob/main/src/stores/app.ts"
click node_home "https://github.com/sheng3533/lightlink/blob/main/src/views/Home.vue"
click node_devices "https://github.com/sheng3533/lightlink/blob/main/src/views/Devices.vue"
click node_remote "https://github.com/sheng3533/lightlink/blob/main/src/views/Remote.vue"
click node_files "https://github.com/sheng3533/lightlink/blob/main/src/views/Files.vue"
click node_terminal "https://github.com/sheng3533/lightlink/blob/main/src/views/Terminal.vue"
click node_monitor "https://github.com/sheng3533/lightlink/blob/main/src/views/MonitorWall.vue"
click node_logs "https://github.com/sheng3533/lightlink/blob/main/src/views/Logs.vue"
click node_settings "https://github.com/sheng3533/lightlink/blob/main/src/views/Settings.vue"
click node_tauri_commands "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/lib.rs"
click node_tcp_network "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/network.rs"
click node_protocol "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/protocol.rs"
click node_crypto "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/crypto.rs"
click node_capture "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/capture.rs"
click node_input "https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/input.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_app_entry,node_app_shell,node_navigation,node_router,node_app_store,node_user toneBlue
class node_home,node_devices,node_remote,node_files,node_terminal,node_monitor,node_logs,node_settings toneAmber
class node_tauri_commands toneMint
class node_tcp_network,node_protocol,node_crypto,node_capture,node_input toneRose
```

## Components

### Frontend shell

- [App bootstrap](https://github.com/sheng3533/lightlink/blob/main/src/main.ts): `src/main.ts`
- [App shell](https://github.com/sheng3533/lightlink/blob/main/src/App.vue): `src/App.vue`
- [Sidebar navigation](https://github.com/sheng3533/lightlink/blob/main/src/components/Sidebar.vue): `src/components/Sidebar.vue`
- [View router](https://github.com/sheng3533/lightlink/blob/main/src/router/index.ts): `src/router/index.ts`
- [App state](https://github.com/sheng3533/lightlink/blob/main/src/stores/app.ts): `src/stores/app.ts`

### Remote features

- [Home](https://github.com/sheng3533/lightlink/blob/main/src/views/Home.vue): `src/views/Home.vue`
- [Devices](https://github.com/sheng3533/lightlink/blob/main/src/views/Devices.vue): `src/views/Devices.vue`
- [Remote desktop](https://github.com/sheng3533/lightlink/blob/main/src/views/Remote.vue): `src/views/Remote.vue`
- [File transfer](https://github.com/sheng3533/lightlink/blob/main/src/views/Files.vue): `src/views/Files.vue`
- [Remote terminal](https://github.com/sheng3533/lightlink/blob/main/src/views/Terminal.vue): `src/views/Terminal.vue`
- [Monitor wall](https://github.com/sheng3533/lightlink/blob/main/src/views/MonitorWall.vue): `src/views/MonitorWall.vue`
- [Logs](https://github.com/sheng3533/lightlink/blob/main/src/views/Logs.vue): `src/views/Logs.vue`
- [Settings](https://github.com/sheng3533/lightlink/blob/main/src/views/Settings.vue): `src/views/Settings.vue`

### Rust runtime

- [Tauri commands](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Session internals

- [TCP sessions](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/network.rs): `src-tauri/src/network.rs`
- [Message protocol](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/protocol.rs): `src-tauri/src/protocol.rs`
- [Session encryption](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/crypto.rs): `src-tauri/src/crypto.rs`
- [Screen capture](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/capture.rs): `src-tauri/src/capture.rs`
- [Input control](https://github.com/sheng3533/lightlink/blob/main/src-tauri/src/input.rs): `src-tauri/src/input.rs`

### Other components

- **User**

## Connections

- User → App bootstrap: uses (evidence: `README.md`)
- App bootstrap → App shell: mounts (evidence: `src/main.ts`)
- App shell → Sidebar navigation: renders (evidence: `src/App.vue`)
- App shell → View router: renders routes (evidence: `src/App.vue`)
- View router → Home: routes to (evidence: `src/router/index.ts`)
- View router → Devices: routes to (evidence: `src/router/index.ts`)
- View router → Remote desktop: routes to (evidence: `src/router/index.ts`)
- View router → File transfer: routes to (evidence: `src/router/index.ts`)
- View router → Remote terminal: routes to (evidence: `src/router/index.ts`)
- View router → Monitor wall: routes to (evidence: `src/router/index.ts`)
- View router → Logs: routes to (evidence: `src/router/index.ts`)
- View router → Settings: routes to (evidence: `src/router/index.ts`)
- App bootstrap → App state: initializes (evidence: `src/main.ts`)
- App state → Tauri commands: invokes commands (evidence: `src/stores/app.ts`)
- Remote desktop → Tauri commands: invokes commands (evidence: `src/views/Remote.vue`)
- Tauri commands → TCP sessions: delegates sessions (evidence: `src-tauri/src/lib.rs`)
- TCP sessions → Message protocol: uses messages (evidence: `src-tauri/src/network.rs`)
- TCP sessions → Session encryption: uses encryption (evidence: `src-tauri/src/network.rs`)
- TCP sessions → Screen capture: captures frames (evidence: `src-tauri/src/network.rs`)
- TCP sessions → Input control: dispatches input (evidence: `src-tauri/src/network.rs`)
