Skip to content

Commit c5a3ba4

Browse files
committed
Replace image diagrams with mermaid diagrams
1 parent 3c7c19d commit c5a3ba4

File tree

6 files changed

+84
-15
lines changed

6 files changed

+84
-15
lines changed

README.md

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,37 @@ The *Save* DWeb Backend relies on two P2P protocols, [Veilid](https://veilid.com
4242

4343
### Save App Architecture
4444

45-
46-
47-
![P2P Sync Diagram](./docs/diagrams/data-sync.png)
45+
```mermaid
46+
graph TD;
47+
A["Android Kotlin"] -->|RPC| B["P2P Daemon Rust"];
48+
C["iOS Swift"] -->|RPC| B;
49+
B --> D["Data Repo"];
50+
D --> E["Personal Data"];
51+
D --> F["External"];
52+
G["Sync Admin"] -->|View/Remove<br>Via veilid?| H["Sync Server"];
53+
B -.->|Code reuse| H;
54+
I --> H;
55+
H --> I["P2P Sync Group"];
56+
I -->|View, Replicate| J["Other peers"];
57+
J -->|Add archives| I;
58+
```
4859

4960
P2P Data Synchronization and Replication Architecture
5061

5162

5263
### P2P Connections
5364

54-
![Group Data Retrieval](./docs/diagrams/group-retrieval.png)
55-
65+
```mermaid
66+
graph TD;
67+
A["groupId"] -->|Find peers| B["veilidKeyValue"];
68+
B --> C["veilidTunnels"];
69+
C --> D["irohStorageVerification"];
70+
D --> E["irohDocs"];
71+
E --> F["groupDoc"];
72+
F --> G["personalRepo"];
73+
G --> H["CBORFileList"];
74+
D --> H;
75+
```
5676

5777
Group Data Retrieval and Verification Flow
5878

@@ -155,9 +175,23 @@ Groups are the fundamental organizational unit in the system, enabling secure pe
155175

156176
## 2.3 Network Topology
157177

158-
159-
![DWeb Sync and Communication Flow](./docs/diagrams/decentralized-sync-and-comms-flow.png)
160-
178+
```mermaid
179+
graph TD;
180+
A["BOOTSTRAP"] -->|Node List| B["YOU!"];
181+
B -->|Find Self| A;
182+
183+
B -->|Ping| C["HEADLESS"];
184+
C -->|Status| B;
185+
B -->|Status| D["DWEB BACKEND DAEMON"];
186+
D -->|Ping| B;
187+
D -->|Gossip via app calls| E["SYNC GROUP"];
188+
189+
C -->|Signal| F["MOBILE APP"];
190+
F -->|Signal| C;
191+
192+
G -->|View, Replicate| E;
193+
E -->|Add archives| G["PEER"];
194+
```
161195

162196
Decentralized Web Synchronization and Communication Flow
163197

@@ -167,9 +201,25 @@ Decentralized Web Synchronization and Communication Flow
167201

168202
### Data Flow Diagram
169203

204+
```mermaid
205+
graph TD;
206+
A["Backend Initialization"] --> B["Group Management"];
207+
B --> C["Repository Operations"];
208+
B --> D["Create/Join Groups"];
209+
B --> E["Manage Members"];
210+
211+
C --> F["Peer Communication"];
212+
C --> G["Create Repos"];
213+
214+
F --> H["Route Updates"];
215+
F --> I["Data Replication"];
216+
217+
G --> J["File Transfer"];
218+
219+
D --> K["Update Routes"];
220+
221+
```
170222

171-
![Data Flow](./docs/diagram/data-flow.png)
172-
173223
Data flow diagram illustrating the interactions between the core components
174224

175225

@@ -236,11 +286,30 @@ We use AppCalls to ensure ordering for tunnels. Each message for a tunnel is sen
236286
The first message (PING) sent through a tunnel contains the bytes [0x07, 0x02, 0x08, 0x03] (SAVE on a phone dial pad) followed by the route ID blob needed to register the route with Veilid. When a peer gets a tunnel ID it has not seen before it should attempt to check if the message contains the PING and if not ignore the tunnel. If the PING is present, the application should register the tunnel and listen for subsequent messages. The Route ID from the tunnel ID is where responses must be sent.
237287

238288

239-
240-
241-
![Tunnels and RouteIDs](./docs/diagrams/tunnels.png)
242-
243-
289+
```mermaid
290+
sequenceDiagram
291+
participant AppA
292+
participant TunnelsA
293+
participant TunnelsB
294+
participant AppB
295+
296+
AppA->>TunnelsA: Open New Tunnel to RouteIDB:Blob
297+
note right of TunnelsA: Register RouteIDB:Blob <br> with Veilid and get RouteIDB
298+
note right of TunnelsA: Create Tunnel ID <br> (u32:RouteIDA)
299+
300+
TunnelsA->>TunnelsB: (u32:RouteIDA)PING(RouteIDA:Blob)
301+
TunnelsA->>AppA: New Tunnel (u32:RouteIDB)
302+
303+
note right of TunnelsB: Verify PING
304+
note right of TunnelsB: Register RouteIDA:Blob
305+
306+
TunnelsB->>AppB: New Tunnel (u32:RouteIDA)
307+
AppB->>TunnelsB: Send BYTES to (u32:RouteIDA)
308+
309+
TunnelsB->>TunnelsA: (u32:RouteIDB)(BYTES)
310+
AppA->>TunnelsA: New data (u32:RouteIDB): BYTES
311+
312+
```
244313
Tunnels and RouteIDs communication flow in Veilid
245314

246315

docs/diagrams/data-flow.png

-135 KB
Binary file not shown.

docs/diagrams/data-sync.png

-232 KB
Binary file not shown.
Binary file not shown.

docs/diagrams/group-retrieval.png

-177 KB
Binary file not shown.

docs/diagrams/tunnels.png

-25.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)