Code together, in real time. Share a 6-character room code — no signup, no install required.
🌐 Live Demo: syncra-collab.vercel.app
Syncra is a browser-based collaborative code editor. Multiple users join the same room using a 6-character code and write code together — every keystroke syncs instantly across all screens, with live cursors showing exactly where each person is working.
Every keystroke syncs instantly across all users in the same room. Built on persistent WebSocket connections for under 50ms latency. Room-based isolation — only people with your room code can join.
Each user gets a unique color and name label above their cursor position in the editor. Cursors auto-hide after 3.5 seconds of inactivity using a sender-side idle timer.
A floating chat panel sits alongside the editor. Messages show sender name, color, and timestamp. Auto-scrolls to latest message.
A VS Code-inspired Activity Bar on the left — click the file icon to open the explorer, click the users icon to see who is online. Create multiple files per room, language auto-detected from file extension. All files sync in real time.
Run code via a sandboxed execution API. Supported languages:
| Python | C | C++ | Java |
| TypeScript | C# | F# | PHP |
| Ruby | Haskell | Go | Rust |
Upload files from your laptop directly into the editor. Download all files as a ZIP. Imported files sync to all users instantly.
Every room gets a unique 6-character code. Late joiners receive full file state immediately. Duplicate usernames are rejected within a room.
| Technology | Purpose |
|---|---|
| React 18 + Vite | UI framework |
| Monaco Editor | VS Code editor engine |
| React Router v6 | Client-side routing |
| WebSocket API | Real-time communication |
| JSZip | ZIP export |
| Technology | Purpose |
|---|---|
| Node.js + Express | HTTP server and REST API |
| ws | WebSocket server |
| onlinecompiler.io | Sandboxed code execution |
| Service | Purpose |
|---|---|
| Vercel | Frontend |
| Render | Backend |
syncra/
├── collab-editor-frontend/
│ └── src/
│ ├── App.jsx ← Router
│ ├── constants.js ← Config (languages, colors, URLs)
│ ├── pages/
│ │ ├── Landing.jsx ← Landing page
│ │ └── EditorPage.jsx ← Editor + all logic
│ └── components/
│ ├── ActivityBar.jsx ← VS Code-style icon sidebar
│ ├── SidePanel.jsx ← File explorer + users panel
│ └── ChatPanel.jsx ← Chat popup
│
└── collab-backend/
├── server.js ← WebSocket server + room management
└── executor.js ← Code execution via API
Browser (React)
│
├── WebSocket (wss://) ──► Node.js Backend
│ │
│ ├── Room Manager (Map + Set)
│ ├── File State (per room)
│ └── User List (per room)
│
└── HTTP POST /run ──────► Node.js Backend
│
└── onlinecompiler.io API
(isolated sandboxes)
User types
→ WebSocket sends { type: 'code', code, fileId }
→ Backend saves to room memory
→ Backend broadcasts to all others in room
→ Monaco model updated via minimal diff (not full replace)
→ Changes appear in under 50ms
Instead of replacing the entire Monaco document on each remote change (which resets cursor position), a common-prefix/suffix diff is applied — only the changed range is replaced. This keeps every user's cursor stable when someone else edits elsewhere.
When remote code arrives, Monaco's onChange would fire and resend the code — creating an infinite loop. Solved with an isRemoteChange ref set synchronously around every remote model update.
When a new user connects, the backend immediately sends the full file state (init) and current user list — so late joiners see everything without anyone resending.
Before accepting a join, the backend checks all existing names in the room. If taken, a name-taken message is sent back and the user is prompted to choose a different name.
Remote cursors auto-hide after 3.5s using a sender-side idle timer that emits cursor-stop, with a receiver-side safety timeout as backup.
- Node.js 18+
- Git
git clone https://github.com/user1-prajwal/collab-editor.git
cd collab-editorBackend:
cd collab-backend
npm install
# Create .env file:
# ONLINECOMPILER_API_KEY=your_key_here
node server.jsFrontend:
cd collab-editor-frontend
npm install
npm run devOpen http://localhost:5173
collab-backend/.env
ONLINECOMPILER_API_KEY=your_key_here
PORT=4000
Get a free API key at onlinecompiler.io
- AI code analysis (Gemini API)
- Teacher/Student mode — read-only access for viewers
- Session playback
- Persistent rooms (database)
- WebRTC voice chat
MIT — see LICENSE
Built by Prajwal Poojari · LinkedIn · Report a Bug