GCode-codepad is a collaborative online code editor with real-time video calling capabilities. Built on a distributed microservices architecture, it ensures scalability, low latency, and high availability. Users can create or join coding rooms, collaborate on code in real-time, and communicate seamlessly via video calls.
- Features
- Architecture Overview
- Technologies Used
- System Components
- Non-Functional Requirements
- Monitoring and Logging
- License
- Contact Information
- User Authentication: Secure signup and login with Firebase Authentication.
- Room Management: Create and join collaborative coding rooms using unique room codes.
- Real-Time Code Synchronization: Collaborate on code edits powered by Firebase Realtime Database.
- Video Calling: Integrated video calling using WebRTC and a Node.js signaling server.
- Scalability: Designed to support up to 10,000 concurrent users with minimal latency.
- Secure Communication: All communications are encrypted using HTTPS.
GCode-codepad follows a distributed microservices architecture. Services are orchestrated via Docker Compose and deployed on an Alibaba Cloud ECS instance, ensuring separation of concerns, scalability, and resilience.
- Framework: React
- Realtime Updates: Firebase SDK
- Languages & Frameworks:
- Java (Spring Boot)
- Node.js
- Docker
- Docker Compose
- Nginx
- Let's Encrypt (Certbot)
- Firebase Realtime Database
- Firebase Authentication
- Responsibilities:
- User interface for authentication, room management, collaborative code editing, and video calls.
- Real-time updates via Firebase SDK.
- REST API communication with backend services.
- WebRTC integration for video calls.
- Responsibilities:
- Manage user profiles and authentication using Firebase Authentication.
- Handle user-related API requests (e.g., profile updates).
- Validate Firebase JWT tokens for secure API access.
- Responsibilities:
- Execute and return code results.
- Set up isolated Docker environments to run submitted code securely.
- Responsibilities:
- Handle WebRTC signaling for peer-to-peer video connections.
- Manage WebSocket connections for low-latency signaling.
- Route video call requests efficiently using Global Redis.
- Responsibilities:
- Synchronize code changes in real-time between collaborators.
- Provide scalable, low-latency storage for code edits.
- Seamlessly integrate with the frontend via Firebase SDK.
- Responsibilities:
- Route HTTP/HTTPS requests to the correct services.
- Terminate SSL/TLS for secure communication.
- Enable WebSocket upgrades for signaling server requests.
-
Low Latency:
- Real-time communication using Redis and WebRTC.
- Nginx optimizes request handling.
-
Scalability:
- Independent scaling of microservices via Docker Compose.
- Firebase handles high concurrency for code synchronization.
- Future-proof architecture for Kubernetes migration.
-
Security:
- Encrypted communication over HTTPS.
- Secure user authentication with Firebase.
- SSL termination handled by Nginx.
-
Reliability:
- Docker containers configured with
restart: always
for high uptime. - Isolated microservices to prevent cascading failures.
- Docker containers configured with
-
Logging:
- Access Docker logs using
docker logs [container_name]
. - Optional integration with ELK Stack for centralized log management.
- Access Docker logs using
-
Monitoring:
- Use tools like Prometheus and Grafana to track system performance.
- Monitor key metrics such as CPU usage, memory consumption, and network latency.
This project is licensed under the MIT License. You are free to use, modify, and distribute the code.
For questions or suggestions, reach out to yuqi.guo17@gmail.com or open an issue on the GitHub repository.