Skip to content

Cyrus-Krispin/Peer-Prep

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

364 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeerPrep: Collaborative Coding Platform

Overview

PeerPrep is a collaborative coding platform where users can be matched based on question difficulty and topic to solve coding questions together in real-time. It follows a microservices architecture with scalable deployment on Google Cloud.

Features

  • Real-Time Collaboration: Two users collaborate live on a shared code editor (CodeMirror).
  • Matching Service: Matches users based on question difficulty and topic.
  • Question Service: Provides a catalog of coding questions.
  • User Management: User registration, authentication, and account management.
  • Code Execution: Execute Python code directly on the collaboration page (via Pyodide).
  • Code Syntax Highlighting: Syntax highlighting in the shared editor.
  • Cloud Deployment: Frontend on Google Cloud Run; Backend on Google Kubernetes Engine.
  • Scalability: Horizontal Pod Autoscaler (HPA) support for backend services.
  • Secure Communication: API Gateway with SSL/TLS via NGINX Ingress.

Architecture

  • Frontend: React.js (deployed to Google Cloud Run)

  • Backend Microservices:

    • User Service (Express.js)
    • Question Service (FastAPI)
    • Matching Service (Express + Redis PubSub)
    • Collaboration Service (Socket.io, Express, Redis PubSub)
  • Databases:

    • MongoDB Atlas (persistent storage)
    • Redis (message queue and in-memory store)
  • Inter-service Communication:

    • REST for frontend-backend communication
    • gRPC for synchronous backend-to-backend communication
    • Redis PubSub for asynchronous messaging
  • Containerization: Docker

  • Orchestration: Kubernetes (GKE)

  • CI/CD: GitHub Actions (multi-architecture matrix builds)

Functional Services

  • User Service:
    • User Registration and Authentication
    • JWT-based session management
  • Question Service:
    • CRUD for coding questions
    • Rich content support (images, hints, code snippets)
  • Matching Service:
    • Match users based on topic and difficulty
    • Publish-Subscribe pattern with Redis
  • Collaboration Service:
    • Real-time collaborative code editing
    • WebSocket-backed communication with Redis Adapter

Deployment

  • Frontend: Google Cloud Run
  • Backend: Google Kubernetes Engine (GKE)
  • Database: MongoDB Atlas (Managed Database)
  • API Gateway: NGINX Ingress with Let's Encrypt SSL
  • Horizontal Pod Autoscaler: Services scale based on memory/CPU usage

Tech Stack

  • Frontend: React.js, JavaScript, CodeMirror
  • Backend:
    • Express.js (User, Collaboration services)
    • FastAPI + Pydantic (Question Service)
    • TypeScript + Socket.io (Collaboration Service)
  • Databases:
    • MongoDB Atlas (User, Question services)
    • Redis (Matching and Collaboration services)
  • Containerization: Docker
  • Orchestration: Kubernetes
  • CI/CD: GitHub Actions
  • Hosting: Google Cloud Platform

Contributions

  • Ho Qi Yuan, Janald: Frontend development, API integration, Collab page code execution
  • Arkar Kyaw Aung: Backend architecture, Kubernetes deployment, Matching and Question service implementation
  • Lim Xuan Zheng: Backend services (User, Question, Matching), HPA configuration
  • Cyrus Krispin Vijikumar: Kubernetes GKE deployment, SSL setup, Redis integration for Collaboration and Matching
  • Austin Huang Deyu: Frontend development for Question, Match, and Collab pages, frontend CI/CD

Nice-to-Haves Implemented

  • Code Execution: Sandbox Python execution using Pyodide (WebAssembly)
  • Syntax Highlighting: Python syntax highlighting with CodeMirror
  • Scalability: Auto-scaling backend with Kubernetes HPA
  • API Gateway: NGINX Ingress with SSL/TLS

Further Enhancements

  • Comprehensive Integration Testing
  • Enhanced Observability (Prometheus + Grafana)
  • GitOps Deployment (ArgoCD)
  • Helm Charts for Kubernetes resource management
  • API Rate Limiting and more advanced API Gateway features

Repository: GitHub - PeerPrep

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 43.9%
  • Python 35.5%
  • CSS 9.2%
  • TypeScript 5.3%
  • Dockerfile 2.8%
  • HTML 1.3%
  • Other 2.0%