A comprehensive competitive programming platform enabling students to solve coding challenges, participate in contests, and teachers to create problems and manage competitions.
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.
- 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
- 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
- Join scheduled coding contests
- Live leaderboard updates
- Time-bound problem solving
- Performance analytics and rankings
- Track all submissions with detailed status
- View execution time and memory usage
- Access submission history
- Compare solutions
- 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
- Schedule contests with start/end times
- Select problems for contests
- Configure scoring rules
- Monitor contest progress in real-time
- Global rankings based on solved problems
- Contest-specific leaderboards
- Real-time score updates
- Performance metrics and statistics
| 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 |
| 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 |
| 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 |
- 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
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
- Node.js 18+ and npm
- PostgreSQL 14+
- Redis 6+
- Docker & Docker Compose
- Judge0 instance (or Docker setup)
-
Clone the repository
git clone https://github.com/Shoyeb45/coding-platform-backend.git cd coding-platform -
Setup Environment Variables
Create
.envfiles 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.localNEXT_PUBLIC_API_URL=http://localhost:8000/api/v1
-
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
-
Setup Frontend
cd frontend npm install npm run dev -
Setup Judge0 (using Docker)
# Pull Judge0 Docker image docker pull judge0/judge0:latest # Run Judge0 container docker-compose up -d judge0
-
Start Workers
cd backend npm run dev:workers
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down- C++ (GCC 11.2.0)
- Java (OpenJDK 17.0.1)
- Python (3.10.0)
- JavaScript (Node.js 16.14.0)
- Time Limit: 2 seconds (configurable per problem)
- Memory Limit: 256 MB (configurable per problem)
- Source Code Limit: 50 KB
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Judge0 for the code execution engine
- Monaco Editor for the code editor component
- Bull MQ for reliable job queue processing
Made with β€οΈ for educators and coding enthusiasts



