How novik/rutorrent works
Project type and purpose
• ruTorrent is a full-stack, web-based front-end for the rTorrent BitTorrent client.
• It runs in a browser (JS/CSS) and on a webserver (PHP), talking to rTorrent via XML-RPC.
File structure
• Top-level “index.html”, “js/”, “css/” serve the client UI.
• “php/” contains the core PHP API wrappers, settings, XML-RPC client, and utility libraries.
• “conf/” holds server configuration (config.php, access control) and plugin registry.
• “plugins/” is a plugin framework—each plugin has its own PHP hooks, JS init, CSS, and language files.
• “share/” holds persistent data (torrents, settings, user data).
• “tests/” contains JS and PHP unit/integration tests.
Insights from README
• Lightweight server side, no DB—configuration in files, cache in filesystem.
• Extensible via plugin architecture.
• Communication: browser → PHP API → rTorrent XML-RPC.
a. Main components
• Browser/UI layer: HTML/CSS/JS assets (js/, css/, custom elements, charts)
• Web Server + ruTorrent app:
– PHP controller layer (php/*.php)
– XML-RPC client module (php/xmlrpc.php)
– Configuration subsystem (conf/)
– Plugin manager + individual plugins (plugins/)
• rTorrent daemon: exposes XML-RPC interface
• Filesystem storage: share/ (torrents, settings, logs), any cache files
b. Relationships & data flows
1. User interacts in browser → UI JS triggers Ajax/XML-RPC calls to PHP endpoints.
2. PHP endpoints read conf/, load plugin hooks, forward commands as XML-RPC to rTorrent.
3. rTorrent responds over XML-RPC → PHP processes response (caching, plugin post-hooks) → returns JSON/XML to client.
4. Plugins may read/write to share/ or call external services (e.g., GeoIP lookup, XMPP).
c. Architectural patterns
• MVC-like separation: JS “view” & “controller” talk to PHP “model” (rTorrent state).
• Plugin hook dispatcher: each hook point loads plugin modules.
• No centralized DB—filesystem as persistence.
d. Key technologies
• Frontend: Vanilla JS + jQuery + custom web components + Flot charts
• Backend: PHP 5+ with XML-RPC library
• Communication: Ajax/JSON + XML-RPC
• Plugin framework (PHP/JS/CSS per plugin)
Detail
• Major PHP module and plugin namespace.
• Configuration flow (conf/ → PHP → rTorrent).
• Document where language files, assets, and logs reside.
• Data flows (commands, status polling, plugin callbacks) to reflect runtime behavior clearly.