# amule-project/amule architecture

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

- Interactive diagram: https://gitdiagram.com/amule-project/amule
- Repository: https://github.com/amule-project/amule

## Overview

aMule is a graphical and headless peer-to-peer file-sharing client built around the eD2k network, with Kad, downloads, uploads, shared files, and remote-control interfaces. The principal workflow is to search through a server or Kad, select a result, download it from peers, and expose completed/shared files for other peers. The tree identifies the corresponding runtime areas, but the README supplied is only a project-migration notice and most implementation excerpts are absent; links between those areas are therefore limited to clearly named responsibilities and documented SearchManager behavior.

Main entry points: [`src/DownloadQueue.cpp`](https://github.com/amule-project/amule/blob/master/src/DownloadQueue.cpp) (Download queue), [`src/UploadQueue.cpp`](https://github.com/amule-project/amule/blob/master/src/UploadQueue.cpp) (Upload queue), [`src/SharedFileList.cpp`](https://github.com/amule-project/amule/blob/master/src/SharedFileList.cpp) (Shared file index), [`src/kademlia/kademlia/SearchManager.cpp`](https://github.com/amule-project/amule/blob/master/src/kademlia/kademlia/SearchManager.cpp) (Search management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client runtime"]
  node_daemon["Headless client<br/>[amuled.cpp]"]
  node_app["Application core<br/>[amule.cpp]"]
end

subgraph group_sharing["File transfer"]
  node_queue["Download queue<br/>[DownloadQueue.cpp]"]
  node_partfile["Partial files<br/>[PartFile.cpp]"]
  node_upload["Upload queue<br/>[UploadQueue.cpp]"]
  node_shared["Shared file index<br/>[SharedFileList.cpp]"]
  node_disk[("Completed files<br/>[KnownFileList.cpp]")]
end

subgraph group_network["Peer networks"]
  node_search["Search management<br/>[SearchManager.cpp]"]
  node_kad["Kad network<br/>[Kademlia.cpp]"]
  node_kad_transport["Kad UDP transport"]
  node_server_conn["Server connection<br/>[ServerConnect.cpp]"]
  node_peer["Peer clients<br/>[ClientList.cpp]"]
end

subgraph group_interfaces["User interfaces"]
  node_gui["Desktop client<br/>[amule-gui.cpp]"]
  node_search_ui["Search dialog<br/>[SearchDlg.cpp]"]
  node_server_ui["Server view<br/>[ServerWnd.cpp]"]
  node_transfer_ui["Transfer view<br/>[TransferWnd.cpp]"]
  node_remote_gui["Remote GUI"]
  node_web["Web interface<br/>[WebInterface.cpp]"]
  node_ec["External connections<br/>[ExternalConn.cpp]"]
end

node_user(("User"))
node_server_network(("eD2k servers"))
node_peers(("Other clients"))

node_user -->|"starts"| node_gui
node_user -->|"starts"| node_daemon
node_gui -->|"runs"| node_app
node_search_ui -->|"requests search"| node_search
node_search -->|"manages searches"| node_kad
node_kad -->|"uses UDP"| node_kad_transport
node_server_ui -->|"manages connection"| node_server_conn
node_server_conn -->|"connects"| node_server_network
node_transfer_ui -->|"views transfers"| node_queue
node_queue -->|"tracks partials"| node_partfile
node_peer -->|"communicates"| node_peers
node_upload -->|"serves files"| node_peers
node_shared -->|"supplies shared files"| node_upload
node_disk -->|"indexes files"| node_shared
node_remote_gui -->|"controls remotely"| node_ec
node_web -->|"controls remotely"| node_ec

click node_gui "https://github.com/amule-project/amule/blob/master/src/amule-gui.cpp"
click node_daemon "https://github.com/amule-project/amule/blob/master/src/amuled.cpp"
click node_app "https://github.com/amule-project/amule/blob/master/src/amule.cpp"
click node_search_ui "https://github.com/amule-project/amule/blob/master/src/SearchDlg.cpp"
click node_server_ui "https://github.com/amule-project/amule/blob/master/src/ServerWnd.cpp"
click node_transfer_ui "https://github.com/amule-project/amule/blob/master/src/TransferWnd.cpp"
click node_remote_gui "https://github.com/amule-project/amule/blob/master/src/amule-remote-gui.cpp"
click node_web "https://github.com/amule-project/amule/blob/master/src/webserver/src/WebInterface.cpp"
click node_search "https://github.com/amule-project/amule/blob/master/src/kademlia/kademlia/SearchManager.cpp"
click node_kad "https://github.com/amule-project/amule/blob/master/src/kademlia/kademlia/Kademlia.cpp"
click node_kad_transport "https://github.com/amule-project/amule/blob/master/src/kademlia/net/KademliaUDPListener.cpp"
click node_server_conn "https://github.com/amule-project/amule/blob/master/src/ServerConnect.cpp"
click node_peer "https://github.com/amule-project/amule/blob/master/src/ClientList.cpp"
click node_queue "https://github.com/amule-project/amule/blob/master/src/DownloadQueue.cpp"
click node_partfile "https://github.com/amule-project/amule/blob/master/src/PartFile.cpp"
click node_upload "https://github.com/amule-project/amule/blob/master/src/UploadQueue.cpp"
click node_shared "https://github.com/amule-project/amule/blob/master/src/SharedFileList.cpp"
click node_disk "https://github.com/amule-project/amule/blob/master/src/KnownFileList.cpp"
click node_ec "https://github.com/amule-project/amule/blob/master/src/ExternalConn.cpp"

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_daemon,node_app,node_user,node_peers toneBlue
class node_queue,node_partfile,node_upload,node_shared,node_disk toneAmber
class node_search,node_kad,node_kad_transport,node_server_conn,node_peer,node_server_network toneMint
class node_gui,node_search_ui,node_server_ui,node_transfer_ui,node_remote_gui,node_web,node_ec toneRose
```

## Components

### Client runtime

- [Headless client](https://github.com/amule-project/amule/blob/master/src/amuled.cpp): `src/amuled.cpp`
- [Application core](https://github.com/amule-project/amule/blob/master/src/amule.cpp): `src/amule.cpp`

### File transfer

- [Download queue](https://github.com/amule-project/amule/blob/master/src/DownloadQueue.cpp): `src/DownloadQueue.cpp`
- [Partial files](https://github.com/amule-project/amule/blob/master/src/PartFile.cpp): `src/PartFile.cpp`
- [Upload queue](https://github.com/amule-project/amule/blob/master/src/UploadQueue.cpp): `src/UploadQueue.cpp`
- [Shared file index](https://github.com/amule-project/amule/blob/master/src/SharedFileList.cpp): `src/SharedFileList.cpp`
- [Completed files](https://github.com/amule-project/amule/blob/master/src/KnownFileList.cpp): `src/KnownFileList.cpp`

### Peer networks

- [Search management](https://github.com/amule-project/amule/blob/master/src/kademlia/kademlia/SearchManager.cpp): `src/kademlia/kademlia/SearchManager.cpp`
- [Kad network](https://github.com/amule-project/amule/blob/master/src/kademlia/kademlia/Kademlia.cpp): `src/kademlia/kademlia/Kademlia.cpp`
- [Kad UDP transport](https://github.com/amule-project/amule/blob/master/src/kademlia/net/KademliaUDPListener.cpp): `src/kademlia/net/KademliaUDPListener.cpp`
- [Server connection](https://github.com/amule-project/amule/blob/master/src/ServerConnect.cpp): `src/ServerConnect.cpp`
- [Peer clients](https://github.com/amule-project/amule/blob/master/src/ClientList.cpp): `src/ClientList.cpp`

### User interfaces

- [Desktop client](https://github.com/amule-project/amule/blob/master/src/amule-gui.cpp): `src/amule-gui.cpp`
- [Search dialog](https://github.com/amule-project/amule/blob/master/src/SearchDlg.cpp): `src/SearchDlg.cpp`
- [Server view](https://github.com/amule-project/amule/blob/master/src/ServerWnd.cpp): `src/ServerWnd.cpp`
- [Transfer view](https://github.com/amule-project/amule/blob/master/src/TransferWnd.cpp): `src/TransferWnd.cpp`
- [Remote GUI](https://github.com/amule-project/amule/blob/master/src/amule-remote-gui.cpp): `src/amule-remote-gui.cpp`
- [Web interface](https://github.com/amule-project/amule/blob/master/src/webserver/src/WebInterface.cpp): `src/webserver/src/WebInterface.cpp`
- [External connections](https://github.com/amule-project/amule/blob/master/src/ExternalConn.cpp): `src/ExternalConn.cpp`

### Other components

- **User**
- **eD2k servers**
- **Other clients**

## Connections

- User → Desktop client: starts
- User → Headless client: starts
- Desktop client → Application core: runs
- Search dialog → Search management: requests search
- Search management → Kad network: manages searches
- Kad network → Kad UDP transport: uses UDP
- Server view → Server connection: manages connection
- Server connection → eD2k servers: connects
- Transfer view → Download queue: views transfers
- Download queue → Partial files: tracks partials
- Peer clients → Other clients: communicates
- Upload queue → Other clients: serves files
- Shared file index → Upload queue: supplies shared files
- Completed files → Shared file index: indexes files
- Remote GUI → External connections: controls remotely
- Web interface → External connections: controls remotely
