Coderoom is a collaborative coding platform built with Rust that allows multiple users to edit code together in real time, execute programs inside isolated Docker containers, and collaborate in shared coding rooms. It is designed as a systems programming project to explore networking, concurrency, process management, and real-time synchronization.
- JWT-based authentication
- Create and join collaborative coding rooms
- Real-time collaborative editing using CRDTs (Yrs)
- Live cursor and participant awareness
- Run code inside isolated Docker containers
- Stream stdout and stderr back to every participant in real time
- Live participant list
- Automatic JWT refresh using refresh tokens
- Multiple rooms with isolated execution environments
Note: Real-time chat is currently under development.
- Rust
- Tokio
- Axum
- SQLx
- PostgreSQL
- Yrs (Rust CRDT)
- Docker
- Next.js
- React
- Monaco Editor
- TypeScript
- Rust
- Docker Desktop
- PostgreSQL
Clone the repository
git clone https://github.com/yourusername/coderoom
cd coderoomInstall dependencies
cargo buildStart Docker Desktop.
Create a .env file
DATABASE_URL=postgres://...
JWT_SECRET=your_secretRun the server
cargo runRun the frontend
cd frontend
npm install
npm run devUsers can
- Sign up
- Log in
- Automatically refresh expired access tokens
- Log out
Authentication is handled using JWT access and refresh tokens stored as HTTP-only cookies.
Users can
- Create rooms
- Join existing rooms
- View connected participants
- Invite others using the room ID
Each room maintains its own
- Shared document
- Connected participants
- Running execution process
Coderoom uses Yrs, the Rust implementation of Yjs CRDTs.
Every edit made by one participant is immediately synchronized with everyone else without merge conflicts.
Features include
- Character-level synchronization
- Conflict-free merging
- Shared document state
- Cursor awareness
Each room can execute the current document.
Execution happens inside an isolated Docker container.
Current implementation supports
- Python
Execution provides
- Live stdout
- Live stderr
- Exit status
- One running process per room
Every execution
- runs inside its own Docker container
- has no access to the host filesystem
- is isolated from other rooms
- streams output through WebSockets
src/
│
├── auth/
├── errors/
├── helpers/
├── websocket/
├── room/
├── state.rs
├── models.rs
├── messages.rs
└── main.rs
User joins room
│
▼
Edits shared document
│
▼
CRDT updates broadcast
│
▼
Everyone sees changes
│
▼
User clicks Run
│
▼
Rust writes temporary file
│
▼
Docker starts container
│
▼
Program executes
│
▼
stdout/stderr streamed
│
▼
All participants see output
Planned features include
- Real-time chat
- Support for more programming languages
- Process timeouts
- Memory limits
- CPU limits
- Docker sandbox improvements
- Supervisor-based process management
- Dashboard for active rooms
- Execution history
- Syntax diagnostics
- File explorer
- Each room maintains an independent CRDT document.
- Only one execution can run per room at a time.
- Access tokens refresh automatically using refresh tokens.
- Code execution currently supports Python.
- Chat functionality is not yet implemented.
MIT