A real-time collaborative code editor. Create a room, share the URL, and edit code together with live cursor and selection sync. Rooms auto-delete 5 minutes after the last participant disconnects.
- Real-time collaborative editing via Yjs CRDT
- Live cursor and selection awareness per participant
- Shared language selection across all participants
- Rooms expire automatically 5 minutes after everyone leaves
- Rate-limited room creation (10 rooms per IP)
- Backend: Go (stdlib
net/http,gorilla/websocket) - Frontend: React + TypeScript, CodeMirror 6, Yjs, Vite, Tailwind CSS
docker compose up --build # debug image (all logs enabled)The app will be available at http://localhost:8080.
make docker-build # prod image → sharecode:prod (minimal logs)
make docker-build-debug # debug image → sharecode:debug (all logs)Prerequisites: Go 1.22+, Node.js
Backend:
go run ./cmd/server # prod (minimal logs)
DEBUG=1 go run ./cmd/server # debug (all logs)The server listens on :8080 and serves the built frontend from frontend/dist.
Frontend (in a separate terminal):
cd frontend
npm install
npm run dev # dev server on :5173, debug logs enabledThe Vite dev server runs on :5173 and proxies /api and /ws requests to :8080. Open http://localhost:5173 for development with hot reload.
Build variants:
# prod (minimal logs)
cd frontend && npm run build
go run ./cmd/server
# debug (all logs)
cd frontend && npm run build:debug
DEBUG=1 go run ./cmd/serverOr via Makefile:
make run # prod build + run
make run-debug # debug build + rungo test ./...