A distributed, eventually persisted, websocket framework designed for real-time applications.
Initially designed to be compatible with Yjs, this framework allows for efficient communication between clients and servers, enabling collaborative features in applications.
- Relay Nodes: Manage WebSocket connections and facilitate communication between clients and rooms.
- Redis Integration: Utilizes Redis for storing room and node information, ensuring data persistence and quick access.
- Scalability: Supports multiple relay nodes, allowing for horizontal scaling of the application.
- Real-time Updates: Provides real-time updates to clients about room status and participant information.
- TUI (Terminal User Interface): A terminal-based interface for monitoring and managing the relay nodes.
- Yjs Compatibility: This framework is designed to be compatible with Yjs, allowing for efficient communication between clients and servers, enabling collaborative features in applications.
- Relay Node Connection Reuse: Relay nodes reuse existing connections to other relay nodes, allowing for efficient communication between relay nodes.
- Room Takeover: If a relay node goes down, another relay node will take over the room, ensuring that the room is never lost.
This section of the readme is still WIP
- Relay Nodes: These nodes manage WebSocket connections and facilitate communication between clients and rooms. They are responsible for handling incoming messages and broadcasting them to the appropriate recipients.
- Redis or Redis Cluster: Acts as the data store for room and node information. Redis provides fast access to data and ensures that the state of rooms and nodes is persisted across sessions.
- DB/Storage Persistence Layer: This layer is intended for future enhancements, allowing for persistent storage beyond Redis. It will enable the application to store historical data and provide more robust data management capabilities.
The architecture consists of multiple relay nodes that communicate with each other and with a Redis instance. Clients connect to the relay nodes via WebSocket, allowing for real-time communication. The relay nodes handle the logic for managing rooms and broadcasting messages, while Redis serves as the backend data store for maintaining the state of the application.
To run two RelayNodes and a redis cluster locally:
docker compose up
To run the Tui just run
cargo run --bin contactor-tui
WIP

