From a1971b737a090ed234db6907aec7e84e1553890d Mon Sep 17 00:00:00 2001 From: narawat Date: Sat, 14 Mar 2026 07:43:22 +0700 Subject: [PATCH] big picture mermaid --- docs/walkthrough.md | 89 +++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/docs/walkthrough.md b/docs/walkthrough.md index c243035..0e9e022 100644 --- a/docs/walkthrough.md +++ b/docs/walkthrough.md @@ -22,43 +22,60 @@ This walkthrough serves as the primary onboarding guide for new developers and e NATSBridge implements the **Claim-Check pattern** for efficient handling of large payloads (>0.5MB): +```mermaid +flowchart TB + subgraph NATSBridge["NATSBridge Module"] + direction TB + + subgraph Sender["Sender (smartsend)"] + direction LR + S1["Data Tuples
[(dataname, data, type)]"] + S2["Serialize Data"] + S3["Size Check"] + S4["Transport Selection"] + S5["Build Envelope"] + S6["Publish to NATS"] + + S1 --> S2 + S2 --> S3 + S3 --> S4 + S4 --> S5 + S5 --> S6 + end + + subgraph Receiver["Receiver (smartreceive)"] + direction LR + R1["Subscribe to NATS"] + R2["Parse Envelope"] + R3["Check Transport"] + R4["Deserialize Data"] + R5["Return Payloads"] + + R1 --> R2 + R2 --> R3 + R3 --> R4 + R4 --> R5 + end + + S6 -.->|Message| R1 + end + + subgraph FileServer["HTTP File Server (Plik)"] + direction TB + FS1["Upload URL"] + FS2["Download URL"] + + S4 -.->|Large Payload| FS1 + R3 -.->|Fetch URL| FS2 + end + + style NATSBridge fill:#e1f5fe,stroke:#0288d1,stroke-width:2px + style Sender fill:#b3e5fc,stroke:#0288d1 + style Receiver fill:#b3e5fc,stroke:#0288d1 + style FileServer fill:#ffe0b2,stroke:#f57c00 ``` -┌─────────────────────────────────────────────────────────────────────┐ -│ NATSBridge Architecture │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ ┌──────────────┐ ┌──────────────┐ │ -│ │ Sender │ │ Receiver │ │ -│ │ │ │ │ │ -│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ -│ │ │smartsend │◀─────────┤ │smartreceive│ │ │ -│ │ └────┬─────┘ │ │ └────┬─────┘ │ │ -│ │ │ │ │ │ │ │ -│ │ ▼ │ │ ▼ │ │ -│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ -│ │ │Serialize │◀─────────┤ │Deserialize│ │ │ -│ │ └────┬─────┘ │ │ └────┬─────┘ │ │ -│ │ │ │ │ │ │ │ -│ │ ▼ │ │ ▼ │ │ -│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ -│ │ │Transport │◀─────────┤ │Transport │ │ │ -│ │ │Selection │ │ │ │Selection │ │ │ -│ │ └────┬─────┘ │ │ └────┬─────┘ │ │ -│ │ │ │ │ │ │ │ -│ │ ▼ │ │ ▼ │ │ -│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ -│ │ │ NATS │◀─────────┤ │ NATS │ │ │ -│ │ │Publish │ │ │ │Subscribe │ │ │ -│ │ └──────────┘ │ │ └──────────┘ │ │ -│ │ │ │ │ │ -│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ -│ │ │File Server│◀─────────┤ │File Server│ │ │ -│ │ │Upload │ │ │ │Download │ │ │ -│ │ └──────────┘ │ │ └──────────┘ │ │ -│ └──────────────┘ └──────────────┘ │ -│ │ -└─────────────────────────────────────────────────────────────────────┘ -``` + +### Key Design Principles ### Key Design Principles