End-to-end guide for running the collaborative editor locally. This repo has a Node/Express backend with Socket.IO + Docker-based execution, and a Vite/React frontend.
- Node.js 20+ (backend and frontend)
- npm 10+
- Docker Desktop (for the sandboxed executor containers)
- MongoDB instance reachable from your machine
Required:
MONGODB_URI– connection string for MongoDBPORT– port for the HTTP/Socket.IO server (default 8000)
Execution tuning (optional – defaults in code):
EXECUTION_IMAGE(defaultcodehive-executor)EXECUTION_NANO_CPUS(default500000000≈ 0.5 vCPU)EXECUTION_MEMORY_BYTES(default536870912= 512MB)EXECUTION_PIDS_LIMIT(default64)EXECUTION_IDLE_TIMEOUT_MS(default300000= 5 minutes)EXECUTION_MAX_LIFETIME_MS(default3600000= 1 hour)EXECUTION_FORCE_KILL_TIMEOUT_MS(default5000ms)EXECUTION_MAX_STDIN_BYTES(default65536bytes)
VITE_API_KEYVITE_AUTH_DOMAINVITE_PROJECT_IDVITE_STORAGE_BUCKETVITE_SENDER_IDVITE_APP_IDVITE_WEBSOCKET_URL– base URL of the backend (e.g.,http://localhost:8000)
- Install deps
cd backend
npm install- Build the executor image (only once, requires Docker)
docker build -t codehive-executor -f Dockerfile.executor .- Start MongoDB (local or remote). Ensure
MONGODB_URIis reachable. - Run the server
# dev with auto-reload (requires npx to find local nodemon)
npx nodemon index.js
# or plain node
node index.jsThe server exposes REST and Socket.IO on PORT (default 8000).
- Install deps
cd frontend
npm install- Create
.envwith the values above. SetVITE_WEBSOCKET_URLto the backend URL (include protocol and port). - Run dev server
npm run devVite defaults to http://localhost:5173.
- Docker daemon (for execution containers)
- MongoDB (for sessions and chat state)
- Backend server (Express + Socket.IO)
- Frontend dev server (Vite)
Start them in this order: MongoDB → Docker → backend → frontend.
npm install– install dependenciesdocker build -t codehive-executor -f Dockerfile.executor .– build executor imagenpx nodemon index.js– run backend with reloadnode index.js– run backend without reload
npm install– install dependenciesnpm run dev– start Vite dev servernpm run build– production buildnpm run preview– preview the production buildnpm run lint– run ESLint
- Socket.IO CORS is configured for
https://*.jayprajapati.me; in dev,VITE_WEBSOCKET_URLshould behttp://localhost:8000. - The executor runs inside Docker with no network access and temporary storage; code and files are ephemeral per session.