How martinschaer/nitram works
Main Components
a) Server-Side (Rust):
• Core RPC Handler (src/nitram.rs)
• Authentication Module (src/auth.rs)
• WebSocket Manager (src/ws.rs)
• Message Processing (src/messages.rs)
• Error Handling (src/error.rs)
• Models Layer (src/models.rs)
b) Client-Side (TypeScript):
• Bindings Layer (examples/main/bindings/)
• API Interface (examples/main/bindings/API/)
• Request/Response Handlers (NitramRequest.ts, NitramResponse.ts)
• Signal System (NitramSignal.ts)
Connection and Data Flow
• Bidirectional WebSocket connection between server and client
• RPC call flow from client to server
• Signal flow from server to client
• Authentication flow
Specific Implementation Details
• Blue rectangles for Rust components
• Green rectangles for TypeScript components
• Yellow diamonds for interface points (API bindings)
• Red hexagons for authentication components
[Client Application Layer]
• ↕
[TypeScript Bindings Layer]
• ↕
[WebSocket Communication Layer]
• ↕
[Rust RPC Server Layer]
Important Elements to Highlight
• The bridge between Rust and TypeScript (bindings)
• WebSocket-based communication channel
• Authentication flow
• Message serialization/deserialization (serde_json)
• Signal system for real-time updates
Technical Details
Integration points:
• JSON serialization boundary
• WebSocket protocol layer
• Authentication boundaries
• API interface points