Distributed Coding Challenge Platform
A microservices-based architecture for executing and evaluating code submissions in isolated sandbox environments. Built with Docker Swarm for orchestration and scalability.
System Architecture
The platform consists of multiple microservices communicating through an API Gateway, with RabbitMQ handling asynchronous task distribution.
Frontend Client
Next.js Application
React-based web interface where users browse challenges, write code in the integrated editor, and submit solutions for evaluation.
API Gateway
FastAPI Service
Central entry point that routes incoming requests to appropriate microservices. Handles authentication validation and request forwarding.
Microservices Layer
Users Service
User management & profiles
Manages user data, profiles, and submission history. Stores data in PostgreSQL.
Challenges Service
Problem repository
Stores and serves coding challenges with test cases, descriptions, and metadata.
Auth Service
Keycloak Identity Provider
Handles authentication via OAuth 2.0 / OpenID Connect. Issues and validates JWT tokens.
Execution Pipeline
RabbitMQ
Message Broker
Distributes code execution tasks to available sandbox workers using task queues for async processing.
Sandbox Runner
Isolated Execution Environment
Worker processes that execute user code in isolated Docker containers with resource limits and security constraints.
Code Submission Workflow
Step-by-step flow of how a code submission is processed through the system.
Submit Code
User writes solution in the web-based code editor and submits for evaluation.
Gateway Routes
API Gateway validates the request and publishes a task to the RabbitMQ queue.
Sandbox Executes
A worker picks up the task and runs the code in an isolated container against test cases.
Results Returned
Execution results are stored and returned to the user with pass/fail status.