The Problem

Users need a desktop download manager that can handle HTTP, FTP, BitTorrent and Magnet links with a native UI on Windows, macOS and Linux. Existing managers often lack a single‑code‑base Electron implementation or expose a fragmented configuration surface.

What This Does

Motrix is an Electron‑based download manager built on the electron‑vue stack. Core logic lives under src/main/ (e.g., src/main/Application.js, src/main/core/Logger.js) while the UI lives under src/renderer/ (Vue components such as src/renderer/components/Preference/Advanced.vue). The build pipeline is driven by yarn and the electron-builder.json configuration, with CI defined in .travis.yml and GitHub Actions.

Key files:

  • src/main/index.js – boots the Electron main process.
  • src/renderer/api/Api.js – wraps the aria2 RPC client used for download control.
  • src/main/core/Engine.js – starts the bundled aria2 engine binaries found in extra/.

How It Is Wired

Execution starts at src/main/index.js, which creates an instance of src/main/Application.js. The Application constructor (src/main/Application.js:66) immediately calls init (10 calls) to set up context, config managers, and UI managers (Tray, Menu, Window).

init loads user and system config via src/main/utils/index.js:getUserConfig (called from 17 places) and src/main/utils/index.js:getSystemConfig (6 places). These config objects feed the src/main/core/Engine.js that spawns the bundled aria2 binary (extra/*/engine/aria2c*). The only outward‑facing operation is the file‑system open performed in src/main/Application.js → this.client.open (the sole external call).

The UI layer imports src/renderer/api/Api.js, which uses src/shared/aria2/lib/JSONRPCClient.js to issue JSON‑RPC commands over a local websocket to the engine. UI components such as Preference/Advanced.vue consume the API via src/renderer/components/CommandManager/index.js.

The most connected modules are:

  • src/main/core/Logger.js – 15 dependents, zero outgoing imports (instability 0).
  • src/main/Application.js – imports 18 other modules (instability 0.95).

No circular imports were detected, but deep nesting (indentation depth 11) appears in the Preference Vue files, making future changes risky.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/Motrix.git
cd Motrix

# Install dependencies
yarn install

# Build the Electron app (production)
yarn electron:build   # defined in package.json scripts via electron-builder

# Run locally (development)
yarn electron:start   # starts main and renderer processes with hot reload

Configuration files are located under src/main/configs/ (e.g., engine.js, protocol.js). The bundled aria2 binaries are in extra/ for each platform; no external download of aria2 is required.

Real‑World Use

A corporate IT desk can ship the built installer (dist/*.exe or .AppImage) to employee machines. When a user adds a torrent URL, the UI component calls Api.addUri, which forwards the request to the local aria2 engine via JSON‑RPC, stores the session file (/var/cache/aria2.session on Linux) and updates the UI through the Task Vue store (src/renderer/store/modules/task.js).

Code Health & Issues

  • High – Pin GitHub Actions – .github/workflows/* uses tag references (@v2). Replace with fixed commit SHAs.
  • High – No Test Suite – 415 source files, zero test files; add tests for each public entry point.
  • Medium – Least‑privilege GITHUB_TOKEN – .github/workflows/release.yml lacks a permissions block.
  • Medium – Enable Dependabot – No dependabot.yml present.
  • Medium – Dependency‑vulnerability gate – CI lacks a vulnerability scan step.
  • Medium – Large binaries in repo – extra/*/engine/aria2c* exceed 5 MiB; move to Git LFS or download at setup.
  • Medium – Remove generated build/ output – 12 generated files are version‑controlled.
  • Low – Set workflow timeouts – .github/workflows/codeql-analysis.yml has no timeout-minutes.

Additional observations: the repository contains a full CI configuration (Travis) but no unit or integration tests, and the LICENSE file is present.

The Bottom Line

Motrix delivers a complete Electron‑based download manager with a clear separation between core engine control and UI, but the codebase suffers from high‑impact hubs, deep nesting, and a lack of automated testing. It is suitable for teams comfortable extending Electron apps and willing to invest in test coverage and dependency hygiene.