CoEdit is a real-time collaborative coding platform that allows multiple users to join shared rooms and edit code together instantly.
Built using React, Node.js, Socket.IO, and MongoDB, it supports live synchronization, user presence tracking, and persistent room-based code storage.
- Room-based collaboration using unique Room IDs
- Multiple users editing simultaneously
- Live code synchronization in real time
- Active user list
- Typing indicators
- Duplicate username prevention
- User join/leave notifications
- Code automatically saved in MongoDB
- Same room ID restores previous code
- Real-time updates stored continuously
- WebSocket communication using Socket.IO
- Event-driven architecture
- Sync-code support for late joiners
- React.js
- CodeMirror Editor
- Bootstrap
- React Router
- React Hot Toast
- Node.js
- Express.js
- Socket.IO
- MongoDB + Mongoose
CoEdit/
│
├── client/ # React frontend
│
├── server/ # Node + Socket.IO backend
│ ├── Room.js # MongoDB schema
│ └── index.js # Server logic
│
└── README.md
git clone https://github.com/Krithika1627/CoEdit.git
cd CoEditFrontend:
cd client
npm installBackend:
cd ../server
npm installbrew services start mongodb-communityCheck MongoDB:
mongoshcd server
npm startcd client
npm startApp runs at:
http://localhost:3000
User joins room
↓
Socket connection established
↓
Code changes emit events
↓
Server broadcasts updates
↓
All users sync instantly
code-change event
↓
MongoDB update (upsert)
↓
Room code stored
↓
Rejoining loads saved code
This project helped me understand:
- WebSocket-based real-time architecture
- Event-driven backend design
- Socket lifecycle management
- Multi-user state synchronization
- MongoDB persistence using upsert logic
- Debugging race conditions between frontend & sockets
- Cursor synchronization
- Chat panel
- Code compiler integration
- Multi-language support
- Role-based permissions
- Cloud deployment
Krithika V
GitHub: @Krithika1627
If you like this project, give it a star ⭐ on GitHub!