Dok
| |
|
Dok is a distributed, real-time collaborative document editing platform implemented as a web application. It allows multiple users to create, share, and simultaneously edit text documents. The system is built on a client–server architecture in which the backend is horizontally scaled across two Node.js/Express server instances, load-balanced by an Nginx reverse proxy. Real-time collaboration is achieved through Yjs Conflict-free Replicated Data Types (CRDTs) transported over Socket.io WebSocket connections; cross-instance event propagation is coordinated via a shared Redis Pub/Sub adapter, which also enables cluster-wide user-presence tracking. Persistent state is stored in a MongoDB document database. Documents are organised in folders and can be made public or private, with sharing policies (viewer, commenter, editor) enforced through JWT-based authentication and role-based access control. An administrative dashboard provides real-time platform-wide statistics, audit trails, user presence information, and site-access logs. The entire infrastructure is containerised with Docker Compose, making deployment reproducible with a single command.