# evansabraham/torrent-client architecture

> Architecture diagram of the GitHub repository evansabraham/torrent-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/evansabraham/torrent-client
- Repository: https://github.com/evansabraham/torrent-client

## Overview

This small macOS automation script reads a magnet link, runs aria2c to download into ~/Downloads, and reports the outcome. Successful downloads clear the input file; failures leave it available for retry. Resume behavior relies on aria2’s partial-download state. The source was not excerpted, so relationships shown here are based on the README only.

Main entry points: [`torrent-client.sh`](https://github.com/evansabraham/torrent-client/blob/main/torrent-client.sh) (Torrent script), [`magnet.txt`](https://github.com/evansabraham/torrent-client/blob/main/magnet.txt) (Magnet link)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_script["Torrent script<br/>[torrent-client.sh]"]
node_magnet["Magnet link<br/>[magnet.txt]"]
node_aria2["aria2c"]
node_downloads["Downloads folder"]
node_resume["Partial download state"]
node_notifications["macOS notifications"]

node_user -->|"runs"| node_script
node_script -->|"reads link"| node_magnet
node_script -->|"starts download"| node_aria2
node_aria2 -->|"writes files"| node_downloads
node_aria2 -->|"saves progress"| node_resume
node_aria2 -->|"reports outcome"| node_script
node_script -->|"clears on success"| node_magnet
node_script -->|"notifies outcome"| node_notifications

click node_script "https://github.com/evansabraham/torrent-client/blob/main/torrent-client.sh"
click node_magnet "https://github.com/evansabraham/torrent-client/blob/main/magnet.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_script,node_magnet toneTeal
class node_aria2,node_downloads,node_resume,node_notifications toneIndigo
```

## Components

### Other components

- **User**
- [Torrent script](https://github.com/evansabraham/torrent-client/blob/main/torrent-client.sh): `torrent-client.sh`
- [Magnet link](https://github.com/evansabraham/torrent-client/blob/main/magnet.txt): `magnet.txt`
- **aria2c**
- **Downloads folder**
- **Partial download state**
- **macOS notifications**

## Connections

- User → Torrent script: runs (evidence: `README.md`)
- Torrent script → Magnet link: reads link (evidence: `README.md`)
- Torrent script → aria2c: starts download (evidence: `README.md`)
- aria2c → Downloads folder: writes files (evidence: `README.md`)
- aria2c → Partial download state: saves progress (evidence: `README.md`)
- aria2c → Torrent script: reports outcome (evidence: `README.md`)
- Torrent script → Magnet link: clears on success (evidence: `README.md`)
- Torrent script → macOS notifications: notifies outcome (evidence: `README.md`)
