# maheshbvv/vanish architecture

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

- Interactive diagram: https://gitdiagram.com/maheshbvv/vanish
- Repository: https://github.com/maheshbvv/vanish

## Overview

Vanish is a self-hosted, ephemeral terminal chat: a host starts a room, shares a per-run join key, and guests connect; the room ends when the host exits. The server handles admission, chat, host controls, and optional tailcat tunneling, while the client provides the terminal experience. The repository also includes install/join scripts and a landing site. Server and client behavior is concentrated in single source files; unsampled details are included only where the README documents them.

Main entry points: [`server/src/main.rs`](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs) (Room server), [`client/src/main.rs`](https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs) (Client connection), [`landing/app/page.tsx`](https://github.com/maheshbvv/vanish/blob/main/landing/app/page.tsx) (Landing page), [`install.sh`](https://github.com/maheshbvv/vanish/blob/main/install.sh) (Binary installer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hosting["Room hosting"]
  node_server["Room server<br/>[main.rs]"]
  node_room["Volatile room state<br/>[main.rs]"]
  node_admission["Key admission<br/>[main.rs]"]
  node_host_controls["Host controls<br/>[main.rs]"]
  node_host_client["Local host client<br/>[main.rs]"]
  node_tailcat["Tailcat tunnel<br/>[main.rs]"]
end

subgraph group_client["Terminal chat"]
  node_tui["Terminal interface<br/>[main.rs]"]
  node_client_connection["Client connection<br/>[main.rs]"]
  node_client_cleanup["Client self-cleanup<br/>[main.rs]"]
end

subgraph group_distribution["Install and join"]
  node_installer["Binary installer<br/>[install.sh]"]
  node_zero_install["Zero-install join<br/>[join.sh]"]
end

subgraph group_site["Landing site"]
  node_web_page["Landing page<br/>[page.tsx]"]
  node_install_ui["Install command UI<br/>[Install.tsx]"]
  node_session_ui["Session preview<br/>[Session.tsx]"]
  node_session_tabs["Session tabs<br/>[SessionTabs.tsx]"]
  node_captures["Chat captures<br/>[captures.ts]"]
end

node_host(("Host"))
node_guest(("Guest"))
node_tunnel_service["tailcat service"]
node_clipboard["Clipboard tools"]

node_host -->|"starts room"| node_server
node_server -->|"holds in RAM"| node_room
node_server -->|"checks joins"| node_admission
node_admission -->|"validates key"| node_room
node_server -->|"handles commands"| node_host_controls
node_host_controls -->|"rotates key"| node_room
node_server -->|"launches locally"| node_host_client
node_host_client -->|"starts client"| node_tui
node_server -->|"starts optionally"| node_tailcat
node_tailcat -.->|"opens tunnel"| node_tunnel_service
node_guest -->|"runs join command"| node_zero_install
node_zero_install -->|"downloads and runs"| node_client_connection
node_guest -->|"installs binaries"| node_installer
node_installer -->|"provides client"| node_client_connection
node_tui -->|"sends chat input"| node_client_connection
node_client_connection -->|"connects by TCP"| node_server
node_client_cleanup -->|"cleans up on exit"| node_client_connection
node_server -.->|"copies invite optionally"| node_clipboard
node_web_page -->|"renders"| node_install_ui
node_web_page -->|"renders"| node_session_ui
node_web_page -->|"renders"| node_session_tabs
node_web_page -->|"uses examples"| node_captures
node_session_tabs -->|"renders panels"| node_session_ui

click node_server "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_room "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_admission "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_host_controls "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_host_client "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_tailcat "https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs"
click node_tui "https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs"
click node_client_connection "https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs"
click node_client_cleanup "https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs"
click node_installer "https://github.com/maheshbvv/vanish/blob/main/install.sh"
click node_zero_install "https://github.com/maheshbvv/vanish/blob/main/join.sh"
click node_web_page "https://github.com/maheshbvv/vanish/blob/main/landing/app/page.tsx"
click node_install_ui "https://github.com/maheshbvv/vanish/blob/main/landing/components/Install.tsx"
click node_session_ui "https://github.com/maheshbvv/vanish/blob/main/landing/components/Session.tsx"
click node_session_tabs "https://github.com/maheshbvv/vanish/blob/main/landing/components/SessionTabs.tsx"
click node_captures "https://github.com/maheshbvv/vanish/blob/main/landing/lib/captures.ts"

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_server,node_room,node_admission,node_host_controls,node_host_client,node_tailcat toneBlue
class node_tui,node_client_connection,node_client_cleanup toneAmber
class node_installer,node_zero_install toneMint
class node_web_page,node_install_ui,node_session_ui,node_session_tabs,node_captures toneRose
class node_host,node_guest,node_tunnel_service,node_clipboard toneIndigo
```

## Components

### Room hosting

- [Room server](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`
- [Volatile room state](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`
- [Key admission](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`
- [Host controls](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`
- [Local host client](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`
- [Tailcat tunnel](https://github.com/maheshbvv/vanish/blob/main/server/src/main.rs): `server/src/main.rs`

### Terminal chat

- [Terminal interface](https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs): `client/src/main.rs`
- [Client connection](https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs): `client/src/main.rs`
- [Client self-cleanup](https://github.com/maheshbvv/vanish/blob/main/client/src/main.rs): `client/src/main.rs`

### Install and join

- [Binary installer](https://github.com/maheshbvv/vanish/blob/main/install.sh): `install.sh`
- [Zero-install join](https://github.com/maheshbvv/vanish/blob/main/join.sh): `join.sh`

### Landing site

- [Landing page](https://github.com/maheshbvv/vanish/blob/main/landing/app/page.tsx): `landing/app/page.tsx`
- [Install command UI](https://github.com/maheshbvv/vanish/blob/main/landing/components/Install.tsx): `landing/components/Install.tsx`
- [Session preview](https://github.com/maheshbvv/vanish/blob/main/landing/components/Session.tsx): `landing/components/Session.tsx`
- [Session tabs](https://github.com/maheshbvv/vanish/blob/main/landing/components/SessionTabs.tsx): `landing/components/SessionTabs.tsx`
- [Chat captures](https://github.com/maheshbvv/vanish/blob/main/landing/lib/captures.ts): `landing/lib/captures.ts`

### Other components

- **Host**
- **Guest**
- **tailcat service**
- **Clipboard tools**

## Connections

- Host → Room server: starts room (evidence: `README.md`)
- Room server → Volatile room state: holds in RAM (evidence: `README.md`)
- Room server → Key admission: checks joins (evidence: `server/src/main.rs`)
- Key admission → Volatile room state: validates key (evidence: `server/src/main.rs`)
- Room server → Host controls: handles commands (evidence: `server/src/main.rs`)
- Host controls → Volatile room state: rotates key (evidence: `server/src/main.rs`)
- Room server → Local host client: launches locally (evidence: `server/src/main.rs`)
- Local host client → Terminal interface: starts client (evidence: `server/src/main.rs`)
- Room server → Tailcat tunnel: starts optionally (evidence: `server/src/main.rs`)
- Tailcat tunnel → tailcat service: opens tunnel (evidence: `README.md`)
- Guest → Zero-install join: runs join command (evidence: `README.md`)
- Zero-install join → Client connection: downloads and runs (evidence: `README.md`)
- Guest → Binary installer: installs binaries (evidence: `README.md`)
- Binary installer → Client connection: provides client (evidence: `README.md`)
- Terminal interface → Client connection: sends chat input (evidence: `client/src/main.rs`)
- Client connection → Room server: connects by TCP (evidence: `client/src/main.rs`)
- Client self-cleanup → Client connection: cleans up on exit (evidence: `README.md`)
- Room server → Clipboard tools: copies invite optionally (evidence: `README.md`)
- Landing page → Install command UI: renders (evidence: `landing/app/page.tsx`)
- Landing page → Session preview: renders (evidence: `landing/app/page.tsx`)
- Landing page → Session tabs: renders (evidence: `landing/app/page.tsx`)
- Landing page → Chat captures: uses examples (evidence: `landing/app/page.tsx`)
- Session tabs → Session preview: renders panels (evidence: `landing/components/SessionTabs.tsx`)
