Real-time collaborative code editor with AI-powered code review. Built for portfolio/demo use — deploy the frontend + serverless APIs on Vercel, run the WebSocket collab server on Railway or Render.
- Real-time collaboration — Multiple users edit the same C++ file via WebSockets (Socket.io)
- AI code review — Groq-powered side panel scores code and surfaces bugs, style issues, and fixes
- AI chat — Ask follow-up questions about your code in context
- Remote compilation — Run C++ code via RapidAPI compiler
- Modern stack — Vite, React, TypeScript, Monaco Editor, Tailwind CSS
┌─────────────────────┐ ┌──────────────────────────┐
│ Vercel (Frontend) │────▶│ Vercel Serverless APIs │
│ React + Monaco │ │ /api/review (Groq) │
│ AI Side Panel │ │ /api/chat (Groq) │
└──────────┬──────────┘ │ /api/compile (RapidAPI) │
│ WebSocket └──────────────────────────┘
▼
┌─────────────────────┐
│ Railway / Render │
│ collab-server/ │ ← Socket.io rooms
└─────────────────────┘
npm installcp .env.example .envFill in:
GROQ_API_KEY— from console.groq.comVITE_SOCKET_URL—http://localhost:3001for local dev
Code compilation uses the free Judge0 CE API (no key required). Optionally set RAPIDAPI_KEY if you subscribe to Judge0 on RapidAPI.
# Terminal 1 — WebSocket collab server
npm run collab
# Terminal 2 — Local API server (proxied by Vite)
npm run dev:api
# Terminal 3 — Frontend
npm run dev- Push to GitHub
- Import project in Vercel
- Add environment variables:
GROQ_API_KEYVITE_SOCKET_URL(your collab server URL)
- Deploy — Vercel auto-detects Vite and deploys
/apiserverless functions
Deploy the collab-server/ folder as a Node service:
- Start command:
node index.js - Port:
3001(or setPORTenv var) - Set
VITE_SOCKET_URLin Vercel to your Railway URL (e.g.https://your-app.railway.app)
├── api/ # Vercel serverless functions
│ ├── review.js # AI code review (Groq)
│ ├── chat.js # AI follow-up chat
│ └── compile.js # C++ compilation
├── collab-server/ # Socket.io server (Railway/Render)
├── src/
│ ├── components/
│ │ ├── AISidePanel.tsx
│ │ ├── CodeEditor.tsx
│ │ └── Client.tsx
│ └── pages/
│ ├── Home.tsx
│ └── EditorPage.tsx
└── scripts/dev-api.mjs # Local API server for development
- Split architecture: static frontend on Vercel, serverless AI APIs, dedicated WebSocket service
- Integrated Groq LLM for structured code review with severity-tagged feedback
- Real-time collaborative editing with Socket.io room sync
- Secured API keys server-side with rate-limit-ready serverless endpoints
MIT