Skip to content
Back to home

Project Alpha

Real-time collaboration platform built with WebSockets and React

TypeScript, Next.js, PostgreSQL

A real-time collaboration platform that handles concurrent editing from multiple users without data conflicts.

The Challenge

The client needed a Google Docs-like editing experience for their internal documentation tool. Traditional REST APIs weren't cutting it — updates needed to propagate in under 100ms.

Solution

Built a WebSocket-based sync engine using CRDTs (Conflict-free Replicated Data Types) to handle concurrent edits without a central authority. The frontend uses React with a custom hook that manages the WebSocket connection lifecycle.

Key decisions:

  • PostgreSQL for persistent storage with LISTEN/NOTIFY for cross-instance events
  • Redis for ephemeral presence data (who's online, cursor positions)
  • Next.js API routes as the WebSocket upgrade endpoint

Results

  • 50ms average sync latency across regions
  • Zero data conflicts in 6 months of production use
  • Handles 200+ concurrent editors on a single document