How d-led/mermaidlive works
Key Components to Include:
Client Layer
• Long-polling connection management
• Connection status display
• Event subscription handling
Server Layer
• HTTP Server (Go-based)
• Resource Management (embedded UI resources)
• State Machine Controller
• Pub/Sub Event System
• File Watcher (for development)
Distributed System Layer
• G-Counter CRDT Implementation
• ZeroMQ Mesh Network
• Peer Discovery System
• Persistent Storage
• Rectangles: Core services
• Hexagons: External systems
• Diamonds: Decision points
Component Relationships
→ Synchronous calls
⇢ Asynchronous events
⇄ Bi-directional communication
• Blue: Client-side components
• Green: Server-side components
• Orange: Distributed system components
• Gray: External services/dependencies
Event Flow
• How commands flow from UI → Server → State Machine
• Event publication path: State Machine → PubSub → Connected Clients
• Demonstrate the long-polling mechanism for client updates
Distributed System
• Fully-connected ZeroMQ mesh between replicas
• Peer discovery through fly.io DNS
• CRDT state replication flow
• Persistent storage interaction
Development Features
• Live reload mechanism
• Resource compilation/embedding flow
• Test infrastructure connections
Additional Recommendations:
• CRDT replication process
• Client connection lifecycle
• State machine transitions
• Client connection establishment
• State updates and propagation
• Replica synchronization
Remember to include testing infrastructure in a separate view, as the project has comprehensive testing at unit, API, and browser levels using shared Gherkin features.