PHPackages                             clarion-app/download-manager-backend - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. clarion-app/download-manager-backend

ActiveLibrary[File &amp; Storage](/categories/file-storage)

clarion-app/download-manager-backend
====================================

Describe your package

02PHP

Since Apr 5Pushed 1mo agoCompare

[ Source](https://github.com/clarion-app/download-manager-backend)[ Packagist](https://packagist.org/packages/clarion-app/download-manager-backend)[ RSS](/packages/clarion-app-download-manager-backend/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Download Manager Backend
========================

[](#download-manager-backend)

A Laravel-based backend service for managing downloads in Clarion. This package provides comprehensive torrent management capabilities with support for multiple torrent client implementations.

Overview
--------

[](#overview)

The Download Manager Backend is a Clarion app component that enables users to:

- Manage torrent downloads across multiple servers
- Track download status and completion
- Support multiple torrent client types (currently Transmission)

Features
--------

[](#features)

- **Multi-Server Support**: Manage torrents across multiple torrent servers and client types
- **Torrent Lifecycle Management**: Add, monitor, and remove torrents with automatic status tracking
- **RESTful API**: Complete CRUD operations for torrents and torrent servers
- **Extensible Client Architecture**: Plugin-based system for supporting different torrent clients
- **User Association**: Link torrents to specific users with authentication support
- **Automatic Processing**: Background commands for checking torrent status

Architecture
------------

[](#architecture)

### Models

[](#models)

#### Torrent

[](#torrent)

Represents individual torrent downloads with the following attributes:

- `local_node`: Node identifier for distributed tracking
- `server_id`: Reference to the torrent server handling the download
- `user_id`: Associated user (when authenticated)
- `magnetURI`: Magnet link for the torrent
- `hash_string`: Unique torrent hash identifier
- `name`: Display name (auto-extracted from magnet URI)
- `completed_at`: Timestamp when download completed

#### TorrentServer

[](#torrentserver)

Represents torrent client servers with:

- `local_node`: Node identifier
- `address`: Server connection address
- `type`: Client type (e.g., "Transmission")

### Controllers

[](#controllers)

#### TorrentController

[](#torrentcontroller)

- `index()`: List all torrents
- `store()`: Add new torrent from magnet URI
- `show()`: Get specific torrent details
- `update()`: Modify torrent properties
- `markIncomplete()`: Reset completion status
- `destroy()`: Remove torrent

#### TorrentServerController

[](#torrentservercontroller)

- Standard CRUD operations for torrent servers
- `getClientTypes()`: List supported client types

### Torrent Clients

[](#torrent-clients)

#### TransmissionClient

[](#transmissionclient)

Implementation for Transmission torrent client with:

- RPC communication via HTTP
- Session management with X-Transmission-Session-Id headers
- Methods for adding, checking status, and removing torrents

#### TorrentClientBase

[](#torrentclientbase)

Abstract base class for implementing additional torrent clients

### Commands

[](#commands)

#### CheckTorrent (`torrent:check`)

[](#checktorrent-torrentcheck)

Background command that:

- Scans for incomplete torrents
- Checks status with respective torrent clients
- Updates completion timestamps
- Processes torrent lifecycle events

API Endpoints
-------------

[](#api-endpoints)

All endpoints require authentication (`auth:api` middleware) and use the configured route prefix.

### Torrent Servers

[](#torrent-servers)

- `GET /torrent-servers/client-types` - Get supported client types
- `GET /torrent-servers` - List all servers
- `POST /torrent-servers` - Create new server
- `GET /torrent-servers/{id}` - Get server details
- `PUT /torrent-servers/{id}` - Update server
- `DELETE /torrent-servers/{id}` - Remove server

### Torrents

[](#torrents)

- `GET /torrents` - List all torrents
- `POST /torrents` - Add new torrent
- `GET /torrents/{id}` - Get torrent details
- `PUT /torrents/{id}` - Update torrent
- `DELETE /torrents/{id}` - Remove torrent
- `PATCH /torrents/{id}/mark-incomplete` - Mark as incomplete

Database Schema
---------------

[](#database-schema)

### Torrents Table

[](#torrents-table)

```
- id (UUID, primary key)
- local_node (string)
- server_id (UUID, foreign key)
- user_id (UUID, nullable)
- magnetURI (text)
- hash_string (string, nullable)
- name (string, nullable)
- completed_at (timestamp, nullable)
- created_at/updated_at (timestamps)
- deleted_at (soft deletes)
```

### Torrent Servers Table

[](#torrent-servers-table)

```
- id (UUID, primary key)
- local_node (string)
- address (string)
- type (string)
- created_at/updated_at (timestamps)
- deleted_at (soft deletes)
```

Usage Examples
--------------

[](#usage-examples)

### Adding a Torrent

[](#adding-a-torrent)

```
POST /api/torrents
{
    "magnetURI": "magnet:?xt=urn:btih:...",
    "server_id": "uuid-of-server" // optional, uses default if not specified
}
```

### Checking Torrent Status

[](#checking-torrent-status)

The system automatically processes torrents via the `torrent:check` command, which can be run manually or scheduled:

```
php artisan torrent:check
```

### Adding a New Torrent Server

[](#adding-a-new-torrent-server)

```
POST /api/torrent-servers
{
    "address": "192.168.1.100:9091",
    "type": "Transmission"
}
```

Extending Client Support
------------------------

[](#extending-client-support)

To add support for new torrent clients:

1. Create a new class extending `TorrentClientBase`
2. Implement required methods: `add()`, `check()`, `remove()`
3. Set the static `$type` property
4. Place in `src/TorrentClients/` directory

Example:

```
class QBittorrentClient extends TorrentClientBase
{
    public static $type = "qBittorrent";

    public function add($torrent) { /* implementation */ }
    public function check($hashString) { /* implementation */ }
    public function remove($hashString) { /* implementation */ }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance61

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/544de7b46960eb87f0f60bc59cb8bd4dccd2679622adf0c8ed82b75df9f65685?d=identicon)[timschwartz](/maintainers/timschwartz)

---

Top Contributors

[![timschwartz](https://avatars.githubusercontent.com/u/13080528?v=4)](https://github.com/timschwartz "timschwartz (9 commits)")

### Embed Badge

![Health badge](/badges/clarion-app-download-manager-backend/health.svg)

```
[![Health](https://phpackages.com/badges/clarion-app-download-manager-backend/health.svg)](https://phpackages.com/packages/clarion-app-download-manager-backend)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
