← all work

systems · Rust

Travshipped

A headless BitTorrent engine with three front-ends.

One async engine core drives a terminal dashboard and a Tauri desktop app from a single shared snapshot.

context

Trav is a Rust workspace built around one headless engine (trav-core) and multiple interfaces: a Quantum terminal dashboard, a Nova desktop app (Tauri + Next.js), and a CLI to bootstrap them. The design keeps networking entirely off the UI thread.

the problem

Implementing the BitTorrent protocol correctly is real systems work (bencode parsing, the peer wire protocol, piece management, trackers, DHT), and doing it async without ever stalling the interface that watches it.

what i built

  • Async engine loop with command/event channels; bencode parsing, info-hash generation, rarest-first piece manager
  • Peer wire protocol framing, HTTP/UDP trackers, magnet parsing, DHT/KRPC scaffolding
  • Security throughout: jailed download paths, path sanitization, spawn_blocking SHA-1 verification, adaptive peer penalties and backoff
  • A shared Arc<RwLock<EngineSnapshot>> exposes live metrics to both TUI and GUI with no blocking
  • Bounded disk queue and an LRU FilePool to cap open file handles on multi-file torrents

outcome

A clean separation of engine from interface: the same non-blocking telemetry powers a dense ratatui dashboard with sparklines and a Tauri GUI with drag-and-drop and a system tray.

Networking stays off the UI thread; TUI and GUI read the same live telemetry without blocking.

next project gotobykkrwhofrags →