Algocode is a DSA practice platform just like Leetcode!
Read the blog Β»
Algocode Auth Service .
Code Manager Service .
RCE Engine Service
Algocode is an online data structure and algorithm practice backend built in microservices architecture.
Algocode currently has three services: Algocode Auth Service . Code Manager Service . and RCE Engine Service
Algocode Auth
is responsible for User Management service for Algocode - a DSA Practice Platform just like Leetcode
.
To learn more about Algocode and the architecture, please READ-THE-BLOG-URL
or visit Algocode here.
Algocode Auth Service uses celery
to asynchronously send email to users,Flower
to monitor celery workers
, resend
for email service, and the auth service is a fully dockerized solution
.
To read more on Development
or Production
stage, please follow the below sections.
Workflow
Once a user completes a registration in the Algocode platfrom, a profile for the user is also created of the user using Django Signals
A. Documentation
Please visit the documentation page for the detailed guide on Algocode Auth Service.
However, all the APIs are referenced in the API Reference section below.
B. Deployment
The service is deployed in Azure VM Ubuntu 22.04 server.
C. About Algocode
This is Algocode Auth Service specific guideline.
Please visit Algocode to learn the mircroservices architecture of Algocode and more in-depth guideline how to submit a solution to Algocode platform.
The Algocode Auth Services uses the following services to serve the request during Development Stage.
a. Nginx as webserver.
b. Gunicorn as application server .
c. Celery to process tasks asynchronously.
d. Flower to monitor celery worker.
e. Mailhog to mock email management.
f. Django as backend.
g. Django Rest Framework for API.
h. PostgreSQL for user management database.
i. Redis for celery backend.
l. Docker to containerize the service.
The Algocode Auth Services uses the following services to serve the request during Production Stage.
a. Nginx as webserver.
b. Nginx Proxy Manager to manage Nginx.
c. Portainer to manage and monitor docker container in Auth Service.
b. Gunicorn as application server.
e. Celery to process tasks asynchronously.
f. Flower to monitor celery worker.
g. Resend as email service.
h. Django as backend.
i. Django Rest Framework for API.
j. PostgreSQL for user management database.
k. Redis for celery backend.
l. Docker to containerize the service.
The Auth Service is deployed in Azure VM Ubuntu 22.04 Server.
- Watch from
16:30
for code execution begin and18:30
for code submission result.
- Watch from
09:30
for code execution begin and11:30
for code submission result.
Algocode uses JWT tokens as cookies to manage Authentication/Authorization token.
POST https://auth.algocode.site/api/v1/auth/registration/
Parameter | Type | Description |
---|---|---|
username |
string |
Required Your username for the account. |
email |
string |
Required Your valid email address. |
password1 |
string |
Required Your password. |
password2 |
string |
Required Confirm your password. |
first_name |
string |
Required Your first name. |
last_name |
string |
Required Your last name. |
POST https://auth.algocode.site/api/v1/auth/login/
Parameter | Type | Description |
---|---|---|
email |
string |
Your registered email. |
password |
string |
Your password. |
POST https://auth.algocode.site/api/v1/auth/registration/verify-email/
Parameter | Type | Description |
---|---|---|
key |
string |
Required. Your copied token from your email |
To learn more on Registration APIs please also visit here - Registration in Algocode
POST https://auth.algocode.site/api/v1/auth/password/change/
Parameter | Type | Description |
---|---|---|
new_password1 |
string |
Required. Your new password. |
new_password2 |
string |
Required. Confirm your new password. |
POST https://auth.algocode.site/api/v1/auth/password/reset/
Parameter | Type | Description |
---|---|---|
email |
string |
Required. Your registered email |
POST https://auth.algocode.site/api/v1/auth/password/reset/confirm/
Parameter | Type | Description |
---|---|---|
token |
string |
Required. Token from the email sent to your registered email address. |
uid |
string |
Required. UID from the email sent to your registered email address. |
new_password1 |
string |
Required. Your new password. |
new_password2 |
string |
Required. Confirm your new password. |
POST https://auth.algocode.site/api/v1/auth/token/refresh/
POST https://auth.algocode.site/api/v1/auth/logout/
GET https://auth.algocode.site/api/v1/user/user-detail/
GET https://auth.algocode.site/api/v1/user/user-detail/<uuid:id>/
Parameter | Type | Description |
---|---|---|
id |
string |
Required The id of the user to get details |
Profiles are the more user centric details for a user.
GET https://auth.algocode.site/api/v1/profile/all-user-profiles/
GET https://auth.algocode.site/api/v1/profile/profile/
GET https://auth.algocode.site/api/v1/profile/profile/<uuid:id>/
Parameter | Type | Description |
---|---|---|
id |
string |
Required The id of the user to get details |
GET https://auth.algocode.site/api/v1/profile/profile/update/
Parameter | Type | Description |
---|---|---|
gender |
string |
M , for Male F for Female , or O for Other. |
twitter_handle |
string |
Twitter handle of the user. |
phone_number |
string |
Phone number of the user. |
GET https://auth.algocode.site/api/v1/common/healthcheck/
Please visit the documentation page for more details.
Please fork
and clone
this development branch of Algocode Auth Service, and follow along with the envs-examples
.
cd
to src
and create a virtual environment
. Activate the virtual environment.
Run make docker-up
and the development setup will start running. Please install make
in your host machine.
If you use Windows
Operating System, please run the respective docker commands
from the dev.yml
docker compose file.
You are always welcome to contribute to the project. Please open an issue
or raise a PR
on the project.