A high-performance, professional-grade collaborative code editor built with Next.js, Yjs, and Socket.IO. Features real-time multi-user editing, AI assistance, and an integrated code execution engine.
- Real-time Collaboration: Multi-user editing with zero conflicts powered by Yjs CRDTs.
- AI Pair Programmer: Context-aware AI assistant that can explain, refactor, and review code.
- Integrated Execution: Run Python, JavaScript, and more directly in the browser with real terminal output.
- Premium UI: Modern "Apple-grade" aesthetic with glassmorphism, dark mode, and smooth animations.
- Presence Tracking: Live cursor decorations and user awareness.
- Frontend: Next.js 14 (App Router), Tailwind CSS, Monaco Editor, Lucide Icons.
- Backend: Node.js (Express), Socket.IO, Yjs.
- Execution: Local runtime bridge (Python/Node.js).
- Database: Prisma with SQLite (Room management).
git clone https://github.com/YOUR_USERNAME/CollabEditor.git
cd CollabEditorcd backend
npm install
npx prisma migrate dev --name init
npm run devBackend will run on http://localhost:3001
cd ../frontend
npm install
npm run devFrontend will run on http://localhost:3000
- Open
http://localhost:3000in your browser. - Click "Start Coding Now" to create a random room or use the Dashboard to join a specific one.
- Share the URL with a friend to test the real-time sync.
- Write some Python code like
print("Hello World")and hit the "Run Code" button.
Create a .env file in the backend directory:
PORT=3001
CLIENT_URL=http://localhost:3000
DATABASE_URL="file:./dev.db"
# ANTHROPIC_API_KEY=your_key_hereBuild both apps, then start them with the production scripts:
npm --prefix backend run build
npm --prefix frontend run build
npm --prefix backend run start:prod
npm --prefix frontend run start:prodFor PM2/systemd, see deploy/pm2/ecosystem.config.cjs and deploy/systemd/.
MIT