Skip to content

Commit f323a70

Browse files
committed
Use mermaid for diagrams
1 parent 125b718 commit f323a70

5 files changed

Lines changed: 87 additions & 4 deletions

File tree

README.md

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,102 @@ For comprehensive guidance on using the webpage, refer to the [Usage Guide](doc/
1111

1212
This is a centralized solution where multiple clients can connect to the server, send their download status, and receive torrent files for downloading.
1313

14-
[![](doc/images/diagrams/blocks_high.png)](https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=blocks_high.png&dark=auto#Uhttps%3A%2F%2Fraw.githubusercontent.com%2Fradaron%2FCDMServer%2Fmaster%2Fdoc%2Fimages%2Fdiagrams%2Fblocks_high.png)
14+
```mermaid
15+
graph TD
16+
A[cdm-client] -->|HTTP| D[cdm-server]
17+
B[cdm-client] -->|HTTP| D
18+
C[cdm-client] -->|HTTP| D
19+
```
1520

1621
The client connects to the [Transmission](https://transmissionbt.com/) BitTorrent client to retrieve download information and manage downloads. It then communicates with the server to receive the downloadable torrent file and send the download status.
1722

18-
[![](doc/images/diagrams/blocks.png)](https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=blocks.png&dark=auto#Uhttps%3A%2F%2Fraw.githubusercontent.com%2Fradaron%2FCDMServer%2Fmaster%2Fdoc%2Fimages%2Fdiagrams%2Fblocks.png)
23+
```mermaid
24+
graph TD
25+
subgraph "Client machine"
26+
A[Transmission-daemon]
27+
B[cdm-client]
28+
A <--> B
29+
end
30+
31+
subgraph "Server machine"
32+
C[cdm-server]
33+
D[database]
34+
C <--> D
35+
end
36+
37+
E((Internet))
38+
39+
B --> E
40+
E --> C
41+
```
1942

2043
The client transmits download status data periodically, allowing the user to check the status in the browser.
2144

22-
[![](doc/images/diagrams/sequence_status.png)](https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=sequence_status.png&dark=auto#Uhttps%3A%2F%2Fraw.githubusercontent.com%2Fradaron%2FCDMServer%2Fmaster%2Fdoc%2Fimages%2Fdiagrams%2Fsequence_status.png)
45+
```mermaid
46+
sequenceDiagram
47+
actor user
48+
participant cdm-server
49+
participant cdm-client
50+
participant transmission
51+
52+
cdm-client->>transmission: get all torrent statuses
53+
activate cdm-client
54+
activate transmission
55+
transmission-->>cdm-client: all torrent statuses
56+
deactivate transmission
57+
cdm-client->>cdm-server: send all torrent data
58+
deactivate cdm-client
59+
user->>cdm-server: Get download status
60+
activate cdm-server
61+
cdm-server-->>user: return torrent status
62+
deactivate cdm-server
63+
```
2364

2465
When the user clicks on "Download" or selects a target device for downloading, the client can retrieve the chosen torrent file and add it to Transmission.
2566

26-
[![](doc/images/diagrams/sequence_download.png)](https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=sequence_download.png&dark=auto#Uhttps%3A%2F%2Fraw.githubusercontent.com%2Fradaron%2FCDMServer%2Fmaster%2Fdoc%2Fimages%2Fdiagrams%2Fsequence_download.png)
67+
```mermaid
68+
sequenceDiagram
69+
actor user
70+
participant cdm-server
71+
participant cdm-client
72+
participant transmission
73+
74+
user->>cdm-server: initiate download a movie
75+
activate cdm-server
76+
cdm-server->>cdm-server: Download the selected torrent file from NCore and store it temporary
77+
cdm-server-->>user: added to download queue
78+
deactivate cdm-server
79+
user->>cdm-server: initiate download a series
80+
activate cdm-client
81+
activate cdm-server
82+
cdm-server->>cdm-server: Download the selected torrent file from NCore and store it temporary
83+
cdm-server-->>user: added to download queue
84+
deactivate cdm-server
85+
cdm-client->>cdm-server: check download queue
86+
activate cdm-client
87+
activate cdm-server
88+
cdm-server-->>cdm-client: downloadable file list
89+
deactivate cdm-server
90+
cdm-client->>cdm-server: download the movie
91+
activate cdm-server
92+
cdm-server-->>cdm-client: torrent file for the movie
93+
deactivate cdm-server
94+
cdm-client->>transmission: add torrent file to downloads
95+
activate transmission
96+
transmission->>transmission: Downloading the movie to the disk
97+
transmission-->>cdm-client: ok
98+
deactivate transmission
99+
cdm-client->>cdm-server: download the series
100+
activate cdm-server
101+
cdm-server-->>cdm-client: torrent file for the series
102+
deactivate cdm-server
103+
cdm-client->>transmission: add torrent file to downloads
104+
activate transmission
105+
transmission->>transmission: Downloading the series to the disk
106+
transmission-->>cdm-client: ok
107+
deactivate transmission
108+
deactivate cdm-client
109+
```
27110

28111
## Available Features
29112

doc/images/diagrams/blocks.png

-21 KB
Binary file not shown.
-16.4 KB
Binary file not shown.
-56.4 KB
Binary file not shown.
-19.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)