Algocode
Algocode, coding context and practice platform, is a Django based microservices architecture backend for online judge platforms just like Leetcode.
Install / Use
/learn @Mahboob-A/AlgocodeREADME
Algocode is an online data structure and algorithm practice backend built in microservices architecture.
Algocode currently has three services: <a href="https://github.com/Mahboob-A/algocode-auth">Algocode Auth Service .</a> <a href="https://github.com/Mahboob-A/code-manager">Code Manager Service .</a> and <a href="https://github.com/Mahboob-A/rcee/">RCE Engine Service</a> <br/> <br/>
-
<a href="https://github.com/Mahboob-A/algocode-auth">Algocode Auth Service </a> Auth Service handles user management.
-
<a href="https://github.com/Mahboob-A/code-manager">Code Manager Service </a> Code Manager Service handles
code submission,code exec event creation to Message Queue, andsaving and caching code executing resultto Database. -
<a href="https://github.com/Mahboob-A/rcee/">RCE Engine Service</a> RCE Engine Service contains the
C++code execution Judge. The Judge is completely isolated and it is only accessible usingevents. <br/> RCE Engine service forJava JudgeandPython Judgeare under development. <br/> <br/>
The C++ Judge of <a href="https://github.com/Mahboob-A/rcee/">RCE Engine </a> can execute C++ codes and run test cases against the code output. It can currently handle the below events:
a. AC (Accepted)
b. WA (Wrong Answer)
c. Compilation Error
d. Time Limit Exceed
e. Memory Limit Exceed
f. Segmentation Fault
NOTE
A. The C++ Judge in <a href="https://github.com/Mahboob-A/rcee/">RCE Engine </a> is a pure docker implementation and no other 3rd party API or service has been used.
Please refer to the respective services to learn more about it. You will find rich and detailed documentation in the respective service's github repository, I promise!
B. Rate Limit Alert
The API endpoint to submit solution to the Algocode platfrom (API in <a href="https://github.com/Mahboob-A/code-manager">Code Manager Service </a>) is rate limited to
1 request per 20 seconds.POST https://codemanager.algocode.site/api/v1/code/submit/You can learn more on this in the
API Guideline - Code Submission in Algocodesection.
C. Documentation
<details> <summary><h3 align="center">Architecture and Workflow</h3></summary>All the services have dedicated documentation page. Please visit the respective service repository to learn more.
Architecture of Algocode
Algocode Services
The Algocode platform is comprised of 3 services.
<br/>
<a href="https://github.com/Mahboob-A/algocode-auth">Algocode Auth Service</a> For user management.
<a href="https://github.com/Mahboob-A/code-manager">Code Manager Service</a> For interacting with client, data processing and event creation for RCE Engine.
<a href="https://github.com/Mahboob-A/rcee/">RCE Engine Service</a> For executing the code submitted by the user and produce result for Code Manager Service to consume.
<br/>
<br/> <br/>The mentioned RCE Engine is responsible to execute
C++code. The RCE Engine forJavaandPythonis under development.
Workflow of Algocode - The Workflow below is Sequential How Algocode Works (See the Diagram)
A. <a href="https://github.com/Mahboob-A/algocode-auth">Algocode Auth Service</a>
-
The access to the Algocode begins from the Auth Service.
-
Algocode Auth Service is responsible for user management.
-
The user creates an account or logs in into the Algocode platform to complete the authentication/authorization process.
-
PostgreSQLdatabase is used for user management. The database isself-hostedand capable ofbackupandrestoredata periodically.
B. <a href="https://github.com/Mahboob-A/code-manager">Code Manager Service</a>
-
The Code Manager service is the true manager which is responsible to interact with users to submit the code submission request and return them the answer of their solution.
-
The user sends a
POSTrequest to the
POST https://codemanager.algocode.site/api/v1/code/submit/
API to submit their code solution.
-
Code Manager verifies the
authenticity of the user,processes the submitted data,publishes the data in a RabbbitMQ instanceand thequeueis based on theprogramming languagethe solution is written, and returns asubmission_idto the client. -
Code Manager also listens to event produced by RCE Engine. The
RCE Engine executes the solution and publishes the result to an unified result queue. -
Once message is consumed by Code Manager from
result queue, Code Managercaches the result in Redisand stores the result inMongoDB database. -
The client can send a
GETrequest to theresult check
GET https://codemanager.algocode.site/api/v1/result/check/<submission_id>/
API to get the code execution result. The API is a short polling request for 5 seconds.
-
The
GETrequest checks thecachefirst for the result, thenchecks in databaseand if the result is still not found, then the API process waits for5 secondsfor availability of the data. -
If the data is available within the
5 secondswait time, it returns the result, otherwise, the below response will be returned.
<br/>| Response Key | Type | Value/Description | | :-------- | :------- | :------------------------- | |
status|string|pending| |data|string|null|
C. <a href="https://github.com/Mahboob-A/rcee/">RCE Engine Service</a>
-
The RCE Engine comprises either
C++ Judge, orJava Judge, orPython Judge. -
The RCE Engine consumes messages from respective
queue. Each RCE Engine consumesdatabased on theprogramming languagequeue type i.e. RCE Engine forC++ Judgeconsumes data fromC++ queue. -
The RCE Engine
processes the consumed data,prepares the data for executionand passes the data to theJudge. -
The
Judgecreates asecureandunprivilegeddocker container to run the user submitted code. -
The
Judgestores the output of the code in a file after thecode executionis completed. -
Once the
code executionby theJudgeis completed, the RCE Enginecompares the output with testcases. -
After the
output comparison with testcases, the RCE Engine formats theresult dataandpublish the result datato an unifiedresult queuein aRabbitMQinstance which is consumed byCode Manager Service. -
In case, you want to learn more about the
Judge Engine, please check <a href="https://github.com/Mahboob-A/online-judge/">Online Judge</a> - a light-weight solution to test the Judge locally.
A. Long Video (Describes all the features and architecture)
- Watch from
16:30for code execution begin and18:30for code submission result.
B. Short Video (Only core features)
- Watch from
09:30for code execution begin and11:30for code submission result.
Deployment Information
<a href="https://github.com/Mahboob-A/code-manager">Code Manager Service </a> is deployed on AWS EC2 in Ubuntu 22.04 server. <br/>
<a href="https://github.com/Mahboob-A/algocode-auth">Algocode Auth Service </a> and <a href="https://github.com/Mahboob-A/rcee/">RCE Engine Service</a> are deployed on Azure VM in Ubuntu 22.04 server.
<br/>
The DNS for the platform www.algocode.site is hosted on Cloudflare.
Tech Stack
1. Proxy and Monitoring:
a. Nginx as webserver.
b. Nginx Proxy Manager to manage Nginx.
c. Portainer to manage and monitor docker container in Auth Service.
2. Backend and Server:
b. Gunicorn as application server.
e. Celery to process tasks asynchronously.
f. Flower to monitor celery worker.
g. Resend for email service.
h. Django as backend.
i. Django Rest Framework for API.
3. Databases and Cache:
j. PostgreSQL for user management database.
k. MondoDB for code execution result backend.
l. Redis for celery backend and cache.
4. Containerization and Code Execution:
m. Docker for containerization.
n. Sibling Docker for secure foreign code execution.
o. RabbitMQ for asynchronous processing.
p. Rate Limit (Token Bucket Algorighm, Django Middleware) for rate limit code submission API.
5. Deployment and Testing:
q. AWS EC2 instance for deployment
r. Cloudflare for DNS hosting.
s. Postman for API testing.
</details>
<details>
<summary><h3 align="center">Problem ListsRelated Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
prose
350.1kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
Security Score
Audited on Feb 23, 2026
