← Back to Mermaid Test 1
Big System Architecture
Multiple clients connect through one Gateway to business and common services.
flowchart TB
subgraph Clients[Clients]
TaskWeb[Task Website]
DiagramWeb[Diagram Website]
Linux[Linux Terminal App]
MCP[MCP Client]
Android[Android App]
end
Gateway[Gateway\nCommon Service Protocol]
subgraph Services[Cloudflare Services]
Task[Cloud Task Service\nBusiness Service]
Diagram[Diagram Service\nCommon Diagram Service]
end
subgraph DBSpecial[Common DB APIs\nSpecial Common Services]
DB1[Common DB API #1]
DB2[Common DB API #2]
DB3[Common DB API #3]
end
subgraph Data[Data Layer]
D1A[(Cloudflare D1 #1)]
D1B[(Cloudflare D1 #2)]
D1C[(Cloudflare D1 #3)]
end
TaskWeb --> Gateway
DiagramWeb --> Gateway
Linux --> Gateway
MCP --> Gateway
Android --> Gateway
Gateway -->|Same protocol| Task
Gateway -->|Same protocol| Diagram
Gateway -->|Same protocol| DB1
Gateway -->|Same protocol| DB2
Gateway -->|Same protocol| DB3
Task -->|Data layer| Data
Diagram -->|Data layer| Data
DB1 --> D1A
DB2 --> D1B
DB3 --> D1C
%% Task and Diagram depend on the data layer abstractly.
%% Their exact D1 bindings are intentionally unspecified.
Architecture idea
- There are multiple kinds of clients, but they all use the Gateway as the entry point.
- The Task Website is a client for business task functionality.
- The separate Diagram Website is a client for diagram functionality.
- The Linux terminal application, MCP client, and Android application can all connect to the same Gateway.
- The Gateway connects to business services and common services using the same service protocol.
- The Cloud Task Service is a real business service.
- The Diagram Service is a separate common service for creating and managing diagrams.
- Common DB APIs are special common services separated from the other business/common services.
- Each D1 instance has exactly one Common DB API paired with it.
- Common DB API #1 is paired with D1 #1, Common DB API #2 with D1 #2, and Common DB API #3 with D1 #3.
- Task Service and Diagram Service depend on the data layer generally; their exact D1 bindings are intentionally not specified.
- The data layer is at the lowest level and contains three D1 database instances.
- The same service protocol is used across the Gateway and services; the protocol can be inherited by new services.
Example operations
delete task → Gateway → Task Service → D1 (business-level operation)
delete record → Gateway → Common DB API #1 → D1 #1 (generic data-level operation)
save diagram → Gateway → Diagram Service → D1 (diagram data operation)