# fareldev-hub/vyssh architecture

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

- Interactive diagram: https://gitdiagram.com/fareldev-hub/vyssh
- Repository: https://github.com/fareldev-hub/vyssh

## Overview

VySSH is a local SSH dashboard and management console. A user starts it through the CLI, then uses the browser dashboard or interactive monitor; dashboard requests go through the local server, which reads settings and coordinates remote SSH operations, terminal sessions, file/system features, and tunnels. SSH credentials are built separately and used for persistent connections or connection tests. The README documents the local UI/API boundary and local credential storage. Some server routes and wiring are only partially excerpted, so edges rely on the source index where noted; unsampled subsystem internals are not inferred.

Main entry points: [`src/server.js`](https://github.com/fareldev-hub/vyssh/blob/main/src/server.js) (HTTP and WebSocket API), [`src/sshManager.js`](https://github.com/fareldev-hub/vyssh/blob/main/src/sshManager.js) (SSH connection manager), [`src/config.js`](https://github.com/fareldev-hub/vyssh/blob/main/src/config.js) (Configuration), [`private/web.js`](https://github.com/fareldev-hub/vyssh/blob/main/private/web.js) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_browser["Dashboard UI<br/>[web.js]"]
  node_cli["CLI and monitor<br/>[cli.js]"]
end

subgraph group_control["Local dashboard"]
  node_server["HTTP and WebSocket API<br/>[server.js]"]
end

subgraph group_ssh["SSH connectivity"]
  node_ssh["SSH connection manager<br/>[sshManager.js]"]
  node_auth["SSH auth builder<br/>[sshAuth.js]"]
  node_tester["SSH connection test<br/>[sshTester.js]"]
end

subgraph group_operations["Remote operations"]
  node_terminal["Terminal sessions<br/>[terminalSession.js]"]
  node_tunnel["Remote port tunnels<br/>[tunnelManager.js]"]
  node_project_tunnel["Project tunnel"]
  node_ports["Port registry<br/>[portRegistry.js]"]
end

subgraph group_state["Local state"]
  node_config["Configuration<br/>[config.js]"]
  node_paths["Data paths<br/>[paths.js]"]
  node_config_store[("Local config and env files")]
end

node_user(("User"))
node_remote(("Remote SSH host"))
node_tunnel_provider(("Public tunnel provider"))

node_user -->|"runs commands"| node_cli
node_user -->|"uses dashboard"| node_browser
node_cli -->|"checks local API"| node_server
node_browser -->|"sends local requests"| node_server
node_server -->|"reads and updates"| node_config
node_config -->|"uses data paths"| node_paths
node_paths -->|"locates files"| node_config_store
node_config -->|"reads and writes"| node_config_store
node_server -->|"coordinates SSH"| node_ssh
node_server -->|"tests connections"| node_tester
node_ssh -->|"builds credentials"| node_auth
node_tester -->|"builds credentials"| node_auth
node_ssh -->|"connects remotely"| node_remote
node_server -->|"manages sessions"| node_terminal
node_terminal -->|"opens remote shell"| node_ssh
node_server -->|"manages port tunnels"| node_tunnel
node_tunnel -->|"executes remote commands"| node_ssh
node_server -->|"manages project links"| node_project_tunnel
node_project_tunnel -->|"opens public tunnel"| node_tunnel_provider
node_server -->|"updates registrations"| node_ports

click node_browser "https://github.com/fareldev-hub/vyssh/blob/main/private/web.js"
click node_cli "https://github.com/fareldev-hub/vyssh/blob/main/src/cli.js"
click node_server "https://github.com/fareldev-hub/vyssh/blob/main/src/server.js"
click node_ssh "https://github.com/fareldev-hub/vyssh/blob/main/src/sshManager.js"
click node_auth "https://github.com/fareldev-hub/vyssh/blob/main/src/sshAuth.js"
click node_tester "https://github.com/fareldev-hub/vyssh/blob/main/src/sshTester.js"
click node_terminal "https://github.com/fareldev-hub/vyssh/blob/main/src/terminalSession.js"
click node_tunnel "https://github.com/fareldev-hub/vyssh/blob/main/src/tunnelManager.js"
click node_project_tunnel "https://github.com/fareldev-hub/vyssh/blob/main/src/projectTunnelManager.js"
click node_ports "https://github.com/fareldev-hub/vyssh/blob/main/src/portRegistry.js"
click node_config "https://github.com/fareldev-hub/vyssh/blob/main/src/config.js"
click node_paths "https://github.com/fareldev-hub/vyssh/blob/main/src/paths.js"

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_browser,node_cli,node_user toneBlue
class node_server toneAmber
class node_ssh,node_auth,node_tester toneMint
class node_terminal,node_tunnel,node_project_tunnel,node_ports toneRose
class node_config,node_paths,node_config_store,node_remote,node_tunnel_provider toneIndigo
```

## Components

### User entry points

- [Dashboard UI](https://github.com/fareldev-hub/vyssh/blob/main/private/web.js): `private/web.js`
- [CLI and monitor](https://github.com/fareldev-hub/vyssh/blob/main/src/cli.js): `src/cli.js`

### Local dashboard

- [HTTP and WebSocket API](https://github.com/fareldev-hub/vyssh/blob/main/src/server.js): `src/server.js`

### SSH connectivity

- [SSH connection manager](https://github.com/fareldev-hub/vyssh/blob/main/src/sshManager.js): `src/sshManager.js`
- [SSH auth builder](https://github.com/fareldev-hub/vyssh/blob/main/src/sshAuth.js): `src/sshAuth.js`
- [SSH connection test](https://github.com/fareldev-hub/vyssh/blob/main/src/sshTester.js): `src/sshTester.js`

### Remote operations

- [Terminal sessions](https://github.com/fareldev-hub/vyssh/blob/main/src/terminalSession.js): `src/terminalSession.js`
- [Remote port tunnels](https://github.com/fareldev-hub/vyssh/blob/main/src/tunnelManager.js): `src/tunnelManager.js`
- [Project tunnel](https://github.com/fareldev-hub/vyssh/blob/main/src/projectTunnelManager.js): `src/projectTunnelManager.js`
- [Port registry](https://github.com/fareldev-hub/vyssh/blob/main/src/portRegistry.js): `src/portRegistry.js`

### Local state

- [Configuration](https://github.com/fareldev-hub/vyssh/blob/main/src/config.js): `src/config.js`
- [Data paths](https://github.com/fareldev-hub/vyssh/blob/main/src/paths.js): `src/paths.js`
- **Local config and env files**

### Other components

- **User**
- **Remote SSH host**
- **Public tunnel provider**

## Connections

- User → CLI and monitor: runs commands (evidence: `README.md`)
- User → Dashboard UI: uses dashboard (evidence: `README.md`)
- CLI and monitor → HTTP and WebSocket API: checks local API (evidence: `src/cli.js`)
- Dashboard UI → HTTP and WebSocket API: sends local requests (evidence: `README.md`)
- HTTP and WebSocket API → Configuration: reads and updates (evidence: `src/server.js`)
- Configuration → Data paths: uses data paths (evidence: `src/config.js`)
- Data paths → Local config and env files: locates files (evidence: `src/paths.js`)
- Configuration → Local config and env files: reads and writes (evidence: `src/config.js`)
- HTTP and WebSocket API → SSH connection manager: coordinates SSH (evidence: `src/server.js`)
- HTTP and WebSocket API → SSH connection test: tests connections (evidence: `src/server.js`)
- SSH connection manager → SSH auth builder: builds credentials (evidence: `src/sshManager.js`)
- SSH connection test → SSH auth builder: builds credentials (evidence: `src/sshTester.js`)
- SSH connection manager → Remote SSH host: connects remotely (evidence: `README.md`)
- HTTP and WebSocket API → Terminal sessions: manages sessions (evidence: `src/server.js`)
- Terminal sessions → SSH connection manager: opens remote shell (evidence: `src/terminalSession.js`)
- HTTP and WebSocket API → Remote port tunnels: manages port tunnels (evidence: `src/server.js`)
- Remote port tunnels → SSH connection manager: executes remote commands (evidence: `src/tunnelManager.js`)
- HTTP and WebSocket API → Project tunnel: manages project links (evidence: `src/server.js`)
- Project tunnel → Public tunnel provider: opens public tunnel (evidence: `src/projectTunnelManager.js`)
- HTTP and WebSocket API → Port registry: updates registrations (evidence: `src/server.js`)
