Skip to content

Shoyeb45/coding-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Coding Platform

Next.js TypeScript TailwindCSS Express.js PostgreSQL Prisma Redis Docker AWS

A comprehensive competitive programming platform enabling students to solve coding challenges, participate in contests, and teachers to create problems and manage competitions.

Live Demo

Visit Coding Platform β†’


πŸ“‹ Table of Contents


Overview

A full-featured online coding platform designed for educational institutions and competitive programming enthusiasts. Built with scalability and performance in mind, it provides a LeetCode-like experience with contest management capabilities.

Why This Platform?

  • Contest Ready: Organize and participate in timed coding competitions
  • Teacher Friendly: Intuitive interface for creating questions and test cases
  • Real-time Execution: Powered by Judge0 for secure code execution
  • Performance Tracking: Leaderboards and submission history
  • Scalable Architecture: Distributed task processing with Bull MQ

Key Features

For Students

Problem Solving

  • Browse through curated coding problems
  • LeetCode-style problem statements with examples
  • Support for multiple programming languages
  • Real-time code execution with Monaco IDE
  • Instant feedback on test cases

Contest Participation

  • Join scheduled coding contests
  • Live leaderboard updates
  • Time-bound problem solving
  • Performance analytics and rankings

Submission Management

  • Track all submissions with detailed status
  • View execution time and memory usage
  • Access submission history
  • Compare solutions

For Teachers

Question Management

  • Create problems with custom test cases
  • Define driver code similar to LeetCode
  • Support for hidden and public test cases
  • Rich text editor for problem descriptions
  • Difficulty level classification

Contest Creation

  • Schedule contests with start/end times
  • Select problems for contests
  • Configure scoring rules
  • Monitor contest progress in real-time

πŸ… Leaderboard System

  • Global rankings based on solved problems
  • Contest-specific leaderboards
  • Real-time score updates
  • Performance metrics and statistics

πŸ› οΈ Tech Stack

Frontend

Technology Version Purpose
Next.js 15+ React framework with SSR/SSG
TypeScript Latest Type-safe development
TailwindCSS Latest Utility-first CSS framework
Monaco Editor Latest VS Code-powered code editor

Backend

Technology Purpose
Express.js RESTful API server
PostgreSQL Relational database for data persistence
Prisma Type-safe ORM for database operations
Redis Caching and session management
Bull MQ Distributed job queue for code execution
Judge0 Secure code compilation and execution engine

DevOps & Infrastructure

Technology Purpose
Docker Application containerization
AWS EC2 Hosting workers and Judge0 instances
AWS Elastic Beanstalk Auto-scaling and load balancing
GitHub Actions CI/CD pipeline

System Architecture

Architecture Highlights

  • Asynchronous Processing: Code submissions are queued using Bull MQ for non-blocking execution
  • Horizontal Scaling: Multiple workers process submissions in parallel
  • Caching Layer: Redis stores frequently accessed data for faster response times
  • Isolated Execution: Judge0 runs in isolated containers for security
  • Load Balancing: Elastic Beanstalk automatically scales based on traffic

πŸ“ Project Structure

coding-platform/
β”œβ”€β”€ backend/                     # Express.js API
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── migrations/
β”‚   β”‚       └── 20250820135015_init/
β”‚   └── src/
β”‚       β”œβ”€β”€ config/              # Configuration files
β”‚       β”œβ”€β”€ middlewares/         # Express middlewares
β”‚       β”œβ”€β”€ queues/              # Bull MQ queue definitions
β”‚       β”œβ”€β”€ services/            # Business logic services
β”‚       β”œβ”€β”€ types/               # TypeScript type definitions
β”‚       β”œβ”€β”€ utils/               # Helper functions
β”‚       β”œβ”€β”€ v1/                  # API version 1
β”‚       β”‚   β”œβ”€β”€ controllers/     # Route controllers
β”‚       β”‚   β”œβ”€β”€ repositories/    # Data access layer
β”‚       β”‚   β”œβ”€β”€ routes/          # API routes
β”‚       β”‚   β”œβ”€β”€ services/        # Business services
β”‚       β”‚   └── types/           # API types
β”‚       └── workers/             # Background job processors
β”‚
β”œβ”€β”€ docker-compose.yml           # Docker services configuration
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL 14+
  • Redis 6+
  • Docker & Docker Compose
  • Judge0 instance (or Docker setup)

Installation

  1. Clone the repository

    git clone https://github.com/Shoyeb45/coding-platform-backend.git
    cd coding-platform
  2. Setup Environment Variables

    Create .env files in both frontend and backend directories:

    Backend .env

    # Database
    DATABASE_URL="postgresql://user:password@localhost:5432/codingplatform"
    
    # Redis
    REDIS_URL="redis://localhost:6379"
    
    # Judge0
    JUDGE0_URL="http://localhost:2358"
    JUDGE0_API_KEY="your_judge0_api_key"
    
    # JWT
    JWT_SECRET="your_jwt_secret"
    
    # Server
    PORT=8000
    NODE_ENV=development

    Frontend .env.local

    NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1
  3. Setup Backend

    cd backend
    npm install
    
    # Run Prisma migrations
    npx prisma migrate dev
    
    # Generate Prisma client
    npx prisma generate
    
    # Start development server
    npm run dev
  4. Setup Frontend

    cd frontend
    npm install
    npm run dev
  5. Setup Judge0 (using Docker)

    # Pull Judge0 Docker image
    docker pull judge0/judge0:latest
    
    # Run Judge0 container
    docker-compose up -d judge0
  6. Start Workers

    cd backend
    npm run dev:workers

Docker Setup (Recommended)

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop all services
docker-compose down

πŸ”§ Configuration

Supported Programming Languages

  • C++ (GCC 11.2.0)
  • Java (OpenJDK 17.0.1)
  • Python (3.10.0)
  • JavaScript (Node.js 16.14.0)

Execution Limits

  • Time Limit: 2 seconds (configurable per problem)
  • Memory Limit: 256 MB (configurable per problem)
  • Source Code Limit: 50 KB

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed

πŸ™ Acknowledgments

  • Judge0 for the code execution engine
  • Monaco Editor for the code editor component
  • Bull MQ for reliable job queue processing

⬆ Back to Top

Made with ❀️ for educators and coding enthusiasts

About

Coding platform for college. Teacher and student role for smooth control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages