Architecture
ATorrent shares a specialised BitTorrent engine, while adapting its interface, persistence and lifecycle to each system.
Android
Section titled “Android”- Interface: Jetpack Compose and ViewModel.
- Persistence: Room, repository and resume data.
- Engine: libtorrent through libtorrent4j.
- Transfers: Foreground Service and a persistent notification.
HomeViewModel coordinates screen state and user actions. The repository centralises access to Room. The service maintains the transfer session when the interface is no longer in the foreground.
The app uses SwiftUI and MVVM, with Swift Package Manager packages separated by responsibility:
| Module | Responsibility |
|---|---|
| TorrentCore | Domain models, contracts and logic |
| TorrentPersistence | Preserving transfer state |
| TorrentEngineBridge | Integration between Swift and libtorrent |
| SwiftUI application | Interface and action coordination |
The engine uses libtorrent-rasterbar 2.0.12, Boost and OpenSSL 3.
iOS and iPadOS
Section titled “iOS and iPadOS”The libtorrent 2.0.12 engine is packaged for devices (iphoneos) and simulators (iphonesimulator). A C/C++ bridge and an XCFramework make it available to Swift.
Swift concurrency isolates session management. SwiftData and resume data preserve transfers. Files remain inside the app sandbox.
Windows
Section titled “Windows”Version in development.