Code-Collab Project
A browser-based, real-time collaborative coding environment (like 'Google Docs for code' + 'VS Code Live Share'). It allows multiple developers to write, edit, run, and share code simultaneously without conflicts, entirely self-hosted.
Project Scope
Real-Time Co-Editing & Live Cursors: Multiple users can type simultaneously with distinct cursor colors. Isolated Execution Environment: Every coding session gets its own isolated Docker container to safely run code. Integrated Terminal: A resizable terminal (with multi-tab support) synced over WebSockets so all participants can run commands. Session Management: Secure login (NextAuth), auto-saving, session history, and one-click link sharing.
Technology Stack
Architecture
The Next.js frontend hosts the Monaco Editor and XTerm.js. Edits and cursors are synced via WebSockets using Yjs CRDTs. A separate Express API manages Docker container lifecycles to safely execute code in isolated node-pty instances, while Supabase and Prisma handle session state and NextAuth.
(Database)
Results & Validation
Zero-Conflict Guarantee: Yjs CRDTs ensure simultaneous edits are mathematically merged without any conflict, independently of a master server. Safe Execution: Code is safely sandboxed in ephemeral Docker containers, never on the host. High Performance: Instant peer-to-peer updates via binary WebSockets deltas, debouncing saves to the container instead of hitting the database on every keystroke.