A full-stack web application for real-time collaborative code editing and drawing, featuring:
- Live code editing with Monaco Editor
- Multi-language support (JavaScript, Python, Java, C++)
- Code execution with output console
- Room-based collaboration (join by Room ID)
- User presence (see who is in the room, typing indicators)
- Real-time collaborative whiteboard powered by tldraw
- Persistent whiteboard state per room
- Edit code collaboratively in real time using Monaco Editor
- Language selection: JavaScript, Python, Java, C++
- See who is typing
- Code execution with output displayed in a console
- Draw, sketch, and annotate together using tldraw
- All changes are synchronized in real time
- New users joining a room receive the current whiteboard state
- Create or join a room by Room ID
- See a list of users in the room
- Copy Room ID for sharing
- Leave room at any time
- Frontend: React, Vite, Tailwind CSS, Monaco Editor, tldraw
- Backend: Node.js, Express, Socket.IO
- Code Execution: Piston API
- Node.js (v16+ recommended)
- npm
git clone https://github.com/yourusername/realtime-code-editor.git
cd realtime-code-editorcd backend
npm installcd ../frontend
npm install- By default, the backend runs on port 5000.
- The frontend expects the backend at
http://localhost:5000(for local dev) or your deployed backend URL. - To use a different backend URL, update the
io()call infrontend/src/App.jsx.
cd backend
npm startcd frontend
npm run dev- Visit
http://localhost:5173(or the port Vite shows) in your browser.
- The backend can be deployed to any Node.js-compatible host (e.g., Render, Heroku, Vercel serverless functions).
- The frontend can be built with
npm run buildand served as static files. - Update the socket URL in
App.jsxto your deployed backend.
- Join a Room: Enter a Room ID and your name to join or create a room.
- Collaborate:
- Edit code together in real time.
- See who is in the room and who is typing.
- Select language and run code; see output in the console.
- Draw together on the whiteboard; all changes sync instantly.
- Share: Copy the Room ID and share with others to collaborate.
- Leave Room: Click 'Leave Room' to exit.
Real time Code Editor/
backend/ # Express + Socket.IO server
index.js
frontend/ # React app (Vite)
src/
App.jsx # Main app logic
...
public/
...
README.md
package.json
- React, Vite, Tailwind CSS
- @monaco-editor/react
- @tldraw/tldraw
- socket.io, socket.io-client
- express, axios
MIT