How baairon/torlink works
torlink is a terminal torrent finder, downloader, and seeding client. The principal workflow is: a terminal user submits a query, source adapters fetch and normalize results, the UI merges and presents them, selection enters the download queue, WebTorrent writes files, and persisted state enables resumption and later seeding. Headless search, watch, seed, HTTP serving, file streaming, configuration, and updates are separate product branches. The graph reflects sampled entry points and orchestration; some daemon internals are represented only by their exact tree paths.
Main entry points: index.tsx CLI entry · App.tsx Terminal UI · queue.ts Download queue · engine.ts Torrent engine
Components 24
Entry and TUI
- CLI entry
src/index.tsx - Terminal UI
src/ui/App.tsx - Concurrent search
src/ui/hooks/useConcurrentSearch.ts - Results view
src/ui/components/Results.tsx
Torrent discovery
- JSON search
src/cli/search.ts - Source registry
src/sources/registry.ts - Source adapters
src/sources - Search cache
src/sources/cache.ts
Downloads and seeding
- Download queue
src/download/queue.ts - Torrent engine
src/download/engine.ts - Download files
src/download/engine.ts - Seed lifecycle
src/daemon/seed.ts
Headless services
- Watch service
src/daemon/watch.ts - Torrent API
src/daemon/serve.ts - Files API
src/daemon/files.ts - Auth guards
src/daemon/auth.ts
Operations and state
- State files
src/download/persist.ts - Configuration
src/config/config.ts - Update service
src/update/run.ts
Other components
- Terminal user
- HTTP client
- Torrent sources
- Torrent network
- Package registry
Connections 32
- Terminal user → CLI entry: submits commands
- CLI entry → Terminal UI: starts TUI
- Terminal UI → Concurrent search: runs search
- Terminal UI → Download queue: queues selection
- Terminal UI → Results view: renders results
- Concurrent search → Source registry: reads sources
- Concurrent search → Search cache: searches sources
- CLI entry → JSON search: dispatches search
- JSON search → Source registry: selects sources
- JSON search → Search cache: searches sources
- Search cache → Source adapters: calls adapters
- Source adapters → Torrent sources: fetches listings
- Download queue → Torrent engine: starts torrents
- Download queue → State files: persists state
- Torrent engine → Torrent network: exchanges pieces
- Torrent engine → Download files: writes files
- Seed lifecycle → Torrent engine: starts seeding
- Seed lifecycle → State files: records seeds
- CLI entry → Watch service: dispatches watch
- Watch service → Download queue: queues drops
- CLI entry → Seed lifecycle: dispatches seed
- CLI entry → Torrent API: dispatches serve
- CLI entry → Files API: dispatches files
- HTTP client → Torrent API: posts magnets
- HTTP client → Files API: requests files
- Torrent API → Auth guards: checks access
- Files API → Auth guards: checks access
- Torrent API → Download queue: adds torrents
- Files API → Download files: streams files
- Terminal UI → Configuration: loads config
- CLI entry → Update service: dispatches update
- Update service → Package registry: checks releases