Probo
Probo
This
feature allows multiple users to edit documents simultaneously, seeing each other's changes in
real time.
Implementation Plan
1. Programming Languages and Frameworks
Frontend:
● JavaScript (TypeScript): Provides type safety and helps in preventing bugs during
development.
● React: Efficiently updates and renders components for interactive user interfaces.
● WebSockets (Socket.io): Enables real-time communication between the client and server.
Backend:
● Node.js (with Express.js): Suitable for handling WebSockets and real-time data exchange.
Express.js simplifies the creation of REST APIs.
● WebSockets (Socket.io): Facilitates real-time, bidirectional communication between the
server and clients.
Database:
● MongoDB: A flexible NoSQL database for storing documents and their versions.
● Redis: An in-memory data structure store used for real-time data storage and
synchronization due to its speed.
2. High-Level Architecture and Low-Level Design
High-Level Architecture:
Client-Server Model:
● Clients: Interact with the server through REST APIs for standard CRUD operations and
WebSockets for real-time updates.
● Server: Manages document states, user sessions, and broadcasts changes to connected
clients.
Components:
Frontend (React App):
● Handles the user interface and interactions.
● Manages local document state and uses WebSockets for real-time communication with
the backend.
Backend (Node.js/Express Server):
● Manages user authentication, document storage, and synchronization.
● Uses WebSockets to push real-time updates to clients.
Database Layer:
● MongoDB: Stores documents, user data, and document history.
● Redis: Manages real-time data, such as active document sessions and user connections.
Low-Level Design:
1. Client-Side:
2. Server-Side:
WebSocket Management:
● Manages WebSocket connections and message broadcasting using Socket.io.
● Handles events like joining a document, receiving document changes from clients, and
broadcasting these changes to other connected clients.
Database Operations:
● Saves document changes to MongoDB, maintaining a history of changes.
● Uses Redis to manage active document sessions and synchronize real-time data
efficiently.
3. Database Schema:
● MongoDB: Stores document metadata, content, and version history, allowing retrieval
and update operations for documents.