You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DevHive is a live collaborative code editor with built-in video calling. Run mock interviews, pair-program with your team, or grind DSA with friends — all face-to-face in one room.
Live Demo:
Features
Real-Time Code Collaboration — Monaco Editor synced live across all room participants via WebSocket
Reconnect Handling — rejoining users get re-synced state (USER_REJOIN) instead of duplicate participant entries
Live Room Events — real-time broadcasts for user joined, left, rejoined, and room closed
JWT Authentication — short-lived access tokens + long-lived refresh tokens (6 months) in HTTP-only cookies
Role-Based LiveKit Tokens — per-user JWT tokens with admin grants for room owners
Automatic Call Lifecycle Management — LiveKit room auto-created on call start, cleaned up on room end, participants auto-removed on leave
Cache-Aside Fallback — graceful handling and logging of Redis cache misses with DB fallback
Global Exception Handling — custom exceptions (ResourceNotFoundException, RoomNotAvailableException, AccessDeniedException) for consistent error responses
Modular Service Architecture — clean separation across Room, User, LiveKit, and Redis services
Tech Stack
Layer
Technology
Frontend
React, Vite, TailwindCSS
Code Editor
Monaco Editor (@monaco-editor/react)
WebSocket Client
SockJS + STOMP.js (@stomp/stompjs)
Video Calling
WebRTC (SFU topology) via LiveKit
Backend
Spring Boot
Real-time
WebSocket + STOMP
Cache / Pub-Sub
Redis
Database
PostgreSQL (Spring Data JPA)
Auth
JWT + Refresh Token (HttpOnly Cookie)
Architecture
API Reference
Auth — /auth
Method
Endpoint
Description
POST
/auth/signup
Register a new user
POST
/auth/login
Login; sets HttpOnly refresh token cookie
POST
/auth/refresh
Rotate access + refresh token
POST
/auth/logout
Revoke token + clear cookie
Rooms — /rooms
Method
Endpoint
Description
POST
/rooms
Create a room (caller becomes OWNER)
POST
/rooms/{roomId}/join
Join as EDITOR
GET
/rooms/{roomId}
Get room info (live code from Redis if available)
DELETE
/rooms/{roomId}/end
Owner ends room; final Redis → DB sync
DELETE
/rooms/{roomId}/leave
Participant leaves room
WebSocket
Direction
Destination
Description
Client → Server
/app/code-update/{roomId}
Send a code change; cached in Redis (ROOM_CODE_KEY, TTL via ROOM_TTL_HOURS) and republished
Client → Server
/app/lang-update/{roomId}
Change the room's active language; persisted via RoomService.langUpdate and republished
Server → Client
/topic/room/{roomId}
Receive code updates, language updates, join/leave events, video call events, room-end signal
LiveKit — /livekit
Method
Endpoint
Description
POST
/livekit/token/{roomId}
Validates membership and returns a LiveKit access token for the caller to join the room's video call
POST
/livekit/start/{roomId}
Validates membership, creates the LiveKit room, returns the initiator's token, and broadcasts a VC_STARTED event to /topic/room/{roomId}
Running Locally
About
DevHive is a live collaborative code editor with built-in video calling — run mock interviews, pair-program with your team, or grind DSA with friends, all face-to-face in one room.