A lightweight system designed for real-time code interviews involving two users (interviewer and reviewer), with support for real-time collaboration and integrated video chat. Key features include:
- Real-Time Code Collaboration: Allows both users to work on code together simultaneously.
- Code Execution Environment: Provides a secure environment for running and evaluating code.
- Video Chat: Enables video and audio communication between interviewer and reviewer.
- Minimal User Management: Basic authentication and role management.
- Simple Persistence Layer: Stores user profiles and interview session data.
- Purpose: Enables real-time, bi-directional communication between the interviewer and reviewer for code collaboration.
- Library: Go’s
gorilla/websocketpackage. - Functionality:
- Real-time text synchronization (code editing) between interviewer and reviewer.
- Simple chat system for exchanging messages.
- Manage WebRTC signaling (video/audio chat setup).
- Containerized Execution: Execute code securely within Docker containers.
- Tech: Docker for isolation with resource limits (CPU, memory).
- Supported Languages: Go, Python, Java.
- Execution Process: Submit code via WebSocket, run it in a container, and return the result to both users.
- JWT-based Authentication: Token-based authentication for both interviewer and reviewer.
- Role Management: Two roles:
InterviewerandReviewer.
- Relational Database (PostgreSQL): Store minimal data, including:
- User profiles (username, roles).
- Interview history (date, participants).
- Code submissions for future reference.
- Code Editor: Use Monaco or Ace editor for real-time code editing.
- Features:
- Real-time code synchronization between interviewer and reviewer.
- Syntax highlighting for supported languages.
- Submit code for execution and view results.
- Features:
- WebRTC: Use WebRTC for peer-to-peer video and audio communication.
- Signaling: Handle signaling for establishing WebRTC connections via the WebSocket server.
- Video/Audio Stream: Allow the interviewer and reviewer to communicate via a video stream within the interface.
- Video Window: Displays video chat alongside the code editor.
- Chat Box: Simple text-based chat for non-verbal communication during the session.
- Code Execution Result Panel: Displays execution results next to the code editor.
- Containerization: Use Docker containers to isolate and run user-submitted code.
- Basic Resource Limits: Set limits on CPU, memory, and execution time to prevent abuse.
- Supported Languages: Go, Python, Java.
- Purpose: Facilitate real-time communication for code synchronization, signaling for WebRTC, and chat.
- Library: Use Go’s
gorilla/websocketpackage for WebSocket connections.
- Library: Use Go’s
- Peer-to-Peer Communication: Use WebRTC for direct video/audio streaming between the interviewer and reviewer.
- Signaling Process:
- WebSocket is used to exchange signaling messages (SDP, ICE candidates) between peers to establish the WebRTC connection.
- Once the connection is established, video/audio data streams directly between users.
- Session Start: The interviewer and reviewer log in and join the session.
- WebSocket Connection: Both users connect to the WebSocket server for real-time code collaboration and WebRTC signaling.
- WebRTC Setup: The WebSocket server handles signaling messages (SDP/ICE candidates) to establish a peer-to-peer WebRTC connection for video chat.
- Live Coding: The reviewer writes code while the interviewer observes in real-time.
- Code Execution: The reviewer submits the code, which is executed in a Docker container, and the result is returned.
- Video Chat: Both users communicate via live video while working on the code.
- Golang: Core logic for WebSocket handling, authentication, and code execution.
- gorilla/websocket: For WebSocket communication.
- Docker: For containerized code execution.
- PostgreSQL: Relational database for user and session data.
- WebRTC: For video and audio communication.
- React.js: Basic UI framework.
- Monaco/Ace Editor: For live code editing.
- WebRTC API: Browser-based WebRTC for peer-to-peer video communication.
- WebSockets: For real-time collaboration and signaling.
- Sandboxing: Isolate code execution in Docker containers.
- Resource Limits: Enforce CPU, memory, and execution time limits to prevent misuse.
- TLS Encryption: Ensure WebSocket connections are secure using TLS.
- JWT Authentication: Authenticate WebSocket connections using JWT tokens.
- Encryption: WebRTC streams are encrypted by default for security.
- Secure Signaling: Ensure that the WebSocket server used for signaling is secured using TLS and authenticated with JWT tokens.
- Session Recording: Option to record video calls and code submissions.
- Interview Analytics: Basic stats on interviews conducted and code submissions.
- Problem Templates: Pre-defined coding problems that can be assigned by the interviewer.