How yourok/torrserver works
TorrServer is a server for adding and managing torrents, caching their pieces, and serving media over HTTP without first downloading complete files. The main workflow runs from a browser or API client through the web/API layer to the torrent engine and its cache, then streams requested media to the client. The product also exposes a web UI, Torznab search, optional DLNA and GStreamer support, and an MCP interface; Telegram and filesystem-based torrent input are additional entry points. Some subsystem wiring is inferred from documented capabilities and module boundaries; unsampled handlers are not modeled as direct calls.
Main entry points: route.go HTTP API · torrent.go Torrent management · server.go HTTP server · btserver.go Torrent engine
Components 25
User interfaces
- Web UI
web/src/components/App/index.jsx
Server interfaces
- HTTP server
server/web/server.go - HTTP API
server/web/api/route.go - Web pages
server/web/pages/route.go - MCP endpoint
server/mcp/server.go - Torrent API
server/web/api/torrents.go - Playback API
server/web/api/play.go - Stream API
server/web/api/stream.go
Torrent streaming
- Torrent engine
server/torr/btserver.go - Torrent management
server/torr/torrent.go - Piece cache
server/torr/storage/torrstor/storage.go - Torrent filesystem
server/torrfs/torrfs.go
Configuration state
- Settings
server/settings/settings.go - Settings storage
server/settings/db.go
Optional integrations
- Torznab search
server/torznab/torznab.go - RuTor search
server/rutor/rutor.go - DLNA server
server/dlna/dlna.go - GStreamer remux
server/gstreamer/service.go - Telegram bot
server/tgbot/server.go - Telegram uploads
server/tgbot/upload/manager.go - Bonjour discovery
server/bonjour/bonjour.go
Other components
- Browser user
- Media client
- Telegram user
- MCP client
Connections 29
- Browser user → Web UI: uses
- Web UI → HTTP API: requests
- HTTP server → Web pages: mounts
- HTTP server → HTTP API: mounts
- HTTP server → MCP endpoint: mounts
- HTTP API → Torrent API: dispatches
- HTTP API → Playback API: dispatches
- HTTP API → Stream API: dispatches
- Torrent API → Torrent management: manages
- Playback API → Torrent management: selects media
- Stream API → Torrent engine: serves stream
- Torrent engine → Piece cache: reads and writes
- Torrent management → Torrent engine: manages torrents
- Torrent engine → Torrent filesystem: exposes files
- Media client → Stream API: requests stream
- Settings → Settings storage: persists
- HTTP API → Settings: updates settings
- MCP client → MCP endpoint: uses tools
- MCP endpoint → Torrent management: manages torrents
- Torznab search → RuTor search: queries
- Torrent API → Torznab search: searches indexers
- HTTP server → DLNA server: starts optionally
- DLNA server → Torrent engine: serves torrent media
- Stream API → GStreamer remux: remuxes optionally
- Telegram user → Telegram bot: uses
- Telegram bot → Torrent management: manages torrents
- Telegram bot → Telegram uploads: queues uploads
- Telegram uploads → Torrent management: reads torrent files
- HTTP server → Bonjour discovery: starts optionally