Realtime collaborative workspace platform built with CRDTs, WebSockets, and modern full-stack architecture.
Create collaborative workspaces, edit documents in realtime, and synchronize changes across multiple users with low latency.
- Overview
- Demo
- Features
- Architecture
- Tech Stack
- Realtime Collaboration
- Authentication System
- Workspace System
- Document System
- Project Structure
- Environment Variables
- Local Development
- Prisma Commands
- Deployment
- API Overview
- WebSocket Events
- Current Status
- Roadmap
- Performance Goals
- Known Limitations
- Contributing
- License
SyncSpace is a realtime collaborative workspace platform inspired by collaborative editing systems like Google Docs and Notion.
The project focuses on:
- scalable realtime synchronization
- modular backend architecture
- collaborative document editing
- persistent synchronization
- multi-user workspace systems
- production-oriented deployment
SyncSpace uses:
- WebSockets for realtime communication
- Yjs CRDTs for conflict-free collaboration
- PostgreSQL for persistence
- NestJS for backend architecture
- React + TipTap for the editor experience
The goal of the project is to build a modern collaboration platform with scalable realtime infrastructure and extensible workspace architecture.
https://your-frontend.vercel.app
https://your-backend.onrender.com
- JWT-based authentication
- User registration
- User login
- Protected routes
- Persistent session handling
- Create workspaces
- Workspace membership system
- Role-based access control
- Shared workspace collaboration
- Create documents
- Delete documents
- Rename documents
- Search documents
- Persistent document storage
- Multi-user collaborative editing
- Realtime title synchronization
- Shared Yjs collaborative state
- WebSocket synchronization
- Conflict-free updates
- Automatic persistence
- Multi-client synchronization
- Realtime collaboration awareness
- Frontend deployment on Vercel
- Backend deployment on Render
- PostgreSQL hosted on Neon
SyncSpace follows a modular realtime collaboration architecture.
┌──────────────────────┐
│ Frontend │
│ React + TipTap + Yjs │
└──────────┬───────────┘
│
│ HTTP + WebSocket
▼
┌──────────────────────┐
│ Backend │
│ NestJS │
├──────────────────────┤
│ Authentication │
│ Workspace Module │
│ Document Module │
│ Realtime Module │
│ Prisma ORM │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ PostgreSQL │
│ Neon │
└──────────────────────┘
- React
- TypeScript
- Vite
- TipTap Editor
- Context API
- NestJS
- Prisma ORM
- PostgreSQL
- JWT Authentication
- Class Validator
- WebSockets
- Yjs
- CRDT synchronization
- Shared collaborative state
- WebSocket broadcasting
- Neon PostgreSQL
- Render
- Vercel
The realtime system is built using:
- Yjs CRDTs
- WebSocket synchronization
- Shared collaborative document state
User Input
│
▼
TipTap Editor
│
▼
Yjs Shared State
│
▼
WebSocket Broadcast
│
▼
Connected Clients
│
▼
Database Persistence
Yjs provides:
- conflict-free collaboration
- efficient synchronization
- shared distributed state
- offline-friendly architecture
- low-latency updates
This allows multiple users to edit the same document simultaneously without overwriting each other’s changes.
SyncSpace uses JWT-based authentication.
User Login/Register
│
▼
Credential Validation
│
▼
JWT Token Generated
│
▼
Frontend Stores Token
│
▼
Authenticated API Requests
│
▼
Authenticated WebSocket Access
Authenticated endpoints require:
Authorization: Bearer <token>Workspaces are collaborative containers that organize:
- users
- documents
- permissions
- realtime collaboration
Each workspace supports:
- multiple members
- collaborative editing
- role-based access
- shared synchronization
Each document supports:
- collaborative editing
- realtime updates
- persistence
- synchronization recovery
Document state is:
- synchronized using Yjs
- broadcast using WebSockets
- persisted to PostgreSQL
- restored after reconnect or refresh
This ensures document recovery after:
- page refreshes
- reconnects
- temporary disconnects
- server restarts
apps/
├── backend/
│ ├── src/
│ │ ├── common/
│ │ │ ├── filters/
│ │ │ ├── interceptors/
│ │ │ └── guards/
│ │ │
│ │ ├── modules/
│ │ │ ├── auth/
│ │ │ ├── workspace/
│ │ │ ├── document/
│ │ │ └── realtime/
│ │ │
│ │ ├── prisma/
│ │ │ ├── prisma.module.ts
│ │ │ └── prisma.service.ts
│ │ │
│ │ ├── realtime/
│ │ │ └── ws.server.ts
│ │ │
│ │ ├── app.module.ts
│ │ └── main.ts
│ │
│ └── prisma/
│ └── schema.prisma
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── context/
│ │ ├── hooks/
│ │ ├── services/
│ │ ├── editor/
│ │ └── constants/
│ │
│ └── public/
Create:
apps/backend/.env
Add:
DATABASE_URL=
FRONTEND_URL=
JWT_SECRET=
PORT=Create:
apps/frontend/.env
Add:
VITE_API_URL=
VITE_WS_URL=git clone <repository-url>
cd syncspacepnpm installcd apps/backend
pnpm run start:devBackend runs on:
http://localhost:3000
cd apps/frontend
pnpm run devFrontend runs on:
http://localhost:5173
npx prisma generate --schema=src/prisma/schema.prismanpx prisma db push --schema=src/prisma/schema.prismanpx prisma studio --schema=src/prisma/schema.prismaFrontend is deployed on Vercel.
Required frontend environment variables:
VITE_API_URL=
VITE_WS_URL=Backend is deployed on Render.
Required backend environment variables:
DATABASE_URL=
FRONTEND_URL=
JWT_SECRET=
PORT=Database is hosted on Neon PostgreSQL.
POST /auth/registerPOST /auth/loginPOST /workspaceGET /workspacePOST /workspace/:workspaceId/documentsGET /workspace/:workspaceId/documentsPATCH /documents/:documentId/titlejoin-document
document-update
title-update
document-updated
title-updated
document-created
document-deleted
- Authentication system
- Workspace management
- Membership system
- Realtime collaboration
- Yjs synchronization
- Persistent collaborative editing
- Deployment pipeline
- Multi-client synchronization
- Reconnect improvements
- Better error handling
- Collaborative awareness improvements
- Editor optimizations
- Live cursors
- Typing indicators
- User avatars
- Rich collaborative presence
- Version history
- Comments and mentions
- File attachments
- Export system
- Redis pub/sub
- Horizontal scaling
- Background jobs
- Monitoring and analytics
The project is designed with focus on:
- low-latency synchronization
- efficient collaborative updates
- scalable modular architecture
- realtime consistency
- production-oriented deployment
Current limitations include:
- single-server realtime architecture
- no Redis scaling layer yet
- no offline persistence layer
- limited reconnect recovery
- advanced presence system still in progress
This project is currently under active development.
Future contribution guidelines and issue tracking will be added later.
This project is currently private and under active development.
