A production-ready, real-time collaborative document editor demonstrating the power of QUIC protocol for ultra-low latency synchronization. Built with Go, this project showcases modern networking protocols and distributed systems concepts.
This project is a complete implementation of a collaborative editing system that demonstrates:
- QUIC Protocol: Google's modern transport protocol (HTTP/3 foundation) for multiplexed, low-latency communication
- Operational Transformation (OT): Industry-standard algorithm for conflict-free collaborative editing
- Hybrid Architecture: QUIC for high-performance + WebSocket for broad compatibility
- Production-Ready Storage: Event sourcing with compaction, metadata DB, and object storage
- Session Management: Fun random names for each editing session (e.g., "Happy Eagle", "Clever Penguin")
- Multiple users can edit the same document simultaneously
- Instant synchronization across all connected clients
- Conflict resolution using Operational Transformation
- Visual feedback showing active users with unique names and avatars
- Multiplexed streams - multiple documents over single connection
- 0-RTT connection establishment - faster than TCP+TLS
- Built-in encryption - TLS 1.3 by default
- Connection migration - survives network changes
- Event Sourcing: All edits stored as immutable events
- Automatic Compaction: Periodic snapshot creation for performance
- Persistent Storage: Metadata DB + Object Store for documents
- Vector Clocks: Causal ordering of operations
- Lamport Timestamps: Global ordering across distributed clients
- Go 1.21+ - Download here
- Modern browser - Chrome, Firefox, Safari, or Edge
```bash
git clone https://github.com/DevelopersCoffee/collaborative-doc-quic.git cd collaborative-doc-quic
go mod download
go build -o bin/server cmd/server/main.go
./bin/server ```
The server will start on:
- HTTP/WebSocket: `http://localhost:8080\`
- QUIC: `localhost:4433`
- Open your browser to `http://localhost:8080\`
- Create a document - Click the document list to create new docs
- Open in multiple tabs - Each tab gets a unique session name
- Start typing - Watch real-time synchronization in action!
- Share the URL - Collaborate with others on the same document
QUIC (Quick UDP Internet Connections) is a modern transport protocol developed by Google, now standardized as the foundation of HTTP/3.
See ARCHITECTURE.md for detailed technical documentation.
``` collaborative-doc-quic/ βββ cmd/ β βββ server/ # Main server application (HTTP + QUIC + WebSocket) βββ internal/ β βββ collaboration/ # Real-time collaboration logic β βββ handlers/ # HTTP request handlers β βββ models/ # Data models (Document, Operation) β βββ names/ # Random name generator for sessions β βββ storage/ # Persistence layer (metadata, objects, events) βββ templates/ # HTML templates for the web UI βββ data/ # Persistent storage (created at runtime) βββ README.md ```
```http POST /api/documents Content-Type: application/json
{ "title": "My Document", "content": "Initial content" } ```
```http GET /api/documents/{id} ```
```http GET /api/documents ```
Connect to `ws://localhost:8080/ws/{documentId}` and send/receive JSON messages for real-time collaboration.
```bash
./bin/server
curl -X POST http://localhost:8080/api/documents \ -H "Content-Type: application/json" \ -d '{"title":"Test Doc","content":"Hello World"}'
open http://localhost:8080/editor/{document-id} ```
- Open the same document URL in multiple browser tabs
- Each tab will show a different session name (e.g., "Brave Tiger", "Swift Dolphin")
- Type in one tab and watch it appear in others instantly
Each connection gets a fun, randomly generated name:
- "Happy Eagle" π¦
- "Clever Penguin" π§
- "Brave Tiger" π―
- "Swift Dolphin" π¬
- Latency: Round-trip time for operations
- Operations: Total operations processed
- Version: Document version number
- Active Users: Live count with names
This is a demonstration project for educational purposes. Feel free to:
- Fork and experiment
- Use as a learning resource
- Adapt for your own projects
MIT License - See LICENSE file for details
- QUIC Protocol: Google's quic-go library
- Operational Transformation: Inspired by Google Docs
- WebSocket: Gorilla WebSocket library
Built with β€οΈ for the developer community
This project demonstrates modern networking protocols and distributed systems concepts. Perfect for learning about QUIC, real-time collaboration, and Go backend development.