Skip to content

DeathGun44/codepair

Repository files navigation

CodePair

CodePair is a production-grade, real-time collaborative coding interview platform designed to simulate realistic technical interviews. It seamlessly matches peers based on skill level and provides a synchronized IDE environment for solving algorithmic problems together.

🔴 Live Demo: Try CodePair Now

CodePair Demo

Why CodePair?

Ever wanted to remove that interview anxiety?

Technical interviews are stressful. The only way to get comfortable is to practice exactly how you play. CodePair isn't just a shared editor; it's a simulation engine for your next big interview.

  • Conquer the Nerves: Get used to explaining your thought process in real-time while coding in front of a peer.
  • Find Your Match: Stop practicing alone. Our smart queue pairs you with partners at your exact skill level.
  • Master the Format: From "Easy" warm-ups to "Hard" dynamic programming, practice the full range of algorithmic challenges.

🚀 Key Features

  • Intelligent Peer Matching: Instant, skill-based matchmaking queue that pairs users by preferred language (Go, Python, Java, JS/TS) and problem difficulty.
  • Real-Time Collaboration: Low-latency code synchronization allowing two users to type, edit, and debug simultaneously in the same environment.
  • Production-Grade Editor: Integrated Monaco Editor (the core of VS Code) for a familiar, powerful coding experience with syntax highlighting and auto-completion.
  • LeetCode Integration: Dynamically fetches algorithmic problems from LeetCode or falls back to a curated local repository.
  • Interactive Feedback System: robust session tracking, post-interview feedback, and history management.

🛠️ Technology Stack

CodePair is built with a modern, high-performance stack ensuring scalability and responsiveness.

Backend (The Core)

  • Language: Go (Golang) 1.22 - Chosen for high concurrency and low latency.
  • Framework: Fiber - Express-inspired web framework, optimized for speed.
  • Real-Time: WebSocket - Full-duplex communication for state synchronization and match notifications.
  • Database: PostgreSQL 16 - Relational data integrity for users, sessions, and problems.
  • Caching & Pub/Sub: Redis 7 - Ephemeral state management and distributed message passing.

Frontend (The Interface)

  • Framework: React 18 + TypeScript - Type-safe, component-based UI.
  • Build Tool: Vite - Next-generation frontend tooling.
  • Styling: CSS Modules + Vanilla CSS Variables - Scoped, performant styling without style leakage.
  • State Management: Zustand - Minimalist state management.
  • Editor: Monaco Editor - Industry-standard code editor implementation.

Infrastructure & DevOps

  • Containerization: Docker - Multi-stage builds for optimized production images.
  • IaC: Terraform - Declarative infrastructure management.
  • Cloud Provider: AWS
    • Compute: ECS Fargate (Serverless Containers)
    • Load Balancing: Application Load Balancer (ALB)
    • Database: RDS for PostgreSQL
    • Cache: ElastiCache for Redis
    • Registry: Amazon ECR
  • CI/CD: GitHub Actions - Automated pipelines for linting, testing, and deployment checks.

🏗️ System Architecture

System Architecture

⚡ Getting Started

Prerequisites

  • Go 1.22+
  • Node.js 20+
  • Docker & Docker Compose
  • AWS CLI & Terraform (for deployment)

Local Development

  1. Clone and Setup

    git clone https://github.com/yourusername/codepair.git
    cd codepair
    cp .env.example .env
    # Populate .env with your GitHub OAuth credentials
  2. Start Infrastructure

    docker-compose up -d postgres redis
  3. Run Backend

    go mod tidy
    go run ./cmd/api
  4. Run Frontend

    cd frontend
    npm install
    npm run dev
  5. Visit http://localhost:3000

🚢 AWS Deployment

We use Terraform for reproducible, click-to-deploy infrastructure.

  1. Provision Infrastructure

    cd terraform
    terraform init
    terraform apply
  2. Deploy Application

    # 1. Login to ECR
    aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <account_id>.dkr.ecr.<region>.amazonaws.com
    
    # 2. Build & Push
    docker build -t codepair-dev .
    docker tag codepair-dev:latest <repo_uri>:latest
    docker push <repo_uri>:latest
    
    # 3. Update Service
    aws ecs update-service --cluster codepair-dev --service codepair-dev-api --force-new-deployment

📄 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published