Skip to content

GoyalIshaan/docnest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

DocNest: Real-Time Collaborative Text Editor

DocNest is a real-time text editing collaboration platform. This project showcases the implementation of a distributed system for concurrent editing, addressing challenges such as conflict resolution and eventual consistency.

Tech Stack

Frontend

  • Vite Vite
  • React React
  • TypeScript TypeScript
  • Framer Motion Framer Motion
  • Tailwind CSS Tailwind CSS

Backend

  • Node.js Node.js
  • TypeScript TypeScript
  • Express Express
  • WebSocket WebSocket

Database

  • PostgreSQL PostgreSQL
  • Prisma Prisma

External Libraries

  • Yjs Yjs
  • Quill Quill

Key Learning Points

Conflict-free Replicated Data Types (CRDTs)

In developing DocNest, I gained a deep understanding of CRDTs and their crucial role in enabling real-time collaboration. CRDTs provide a mathematical foundation for managing concurrent updates without conflicts, ensuring that all users converge to the same final state regardless of the order in which they receive updates.

Race Conditions in Text Editing

I learned to identify and mitigate race conditions that can occur in collaborative text editing. These situations arise when multiple users attempt to modify the same part of a document simultaneously. By implementing proper synchronization mechanisms and leveraging the CRDT properties of Yjs, I ensured that such race conditions are handled gracefully, maintaining document integrity.

Achieving Eventual Consistency

One of the core challenges in distributed systems is achieving eventual consistency. Through this project, I learned how to design and implement a system that guarantees all replicas of the shared document will eventually reach the same state, even in the face of network delays, disconnections, and out-of-order message delivery.

Other Challenges and Learning Opportunities

  1. Real-time Synchronization: Implementing efficient real-time synchronization between multiple clients and the server using WebSockets and Yjs.

  2. Operational Transformation vs. CRDTs: Understanding the trade-offs between Operational Transformation (OT) and CRDTs, and why CRDTs were chosen for this project.

  3. Scalability Considerations: Designing the system to handle a growing number of concurrent users and larger documents.

  4. Offline Support: Implementing offline editing capabilities and seamless synchronization upon reconnection.

  5. Version History and Time Travel: Developing a system for maintaining document version history and allowing users to revert to previous states.

  6. Performance Optimization: Optimizing the performance of real-time updates, especially for large documents with many concurrent editors.

  7. Security and Access Control: Implementing secure authentication and fine-grained access control for collaborative editing.

  8. UI/UX for Collaborative Editing: Designing an intuitive user interface that provides real-time feedback on other users' actions and presence.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages