Backend Engine that is used in codemash project for rating the open-source code
- Developed the rating mechanism using ELO Rating Algorithm
- Implemented in memory caching (30 seconds)
- Secured the update and the searching routes with token mechanism (Token expiry maintained as 5 minutes)
- Implemented rate limiting (10 requests per minute)
As system architecture contains sensitive information so please email us here
- node js v20
- yarn v1
- vercel CLI (only required for deployments)
- MongoDB in local desktop or in MongoDB Atlas
- Clone the repository using the below command
git clone git@github.com:TECHOUS/coderatingengine.git
- Run the below command in the project folder and install all the dependencies
yarn run build
- Create
.env
file in the project folder and add the properties mentioned in the Environment Variables section - After all this setup we are good to run the APIs from local
- Follow the Scripts section for the scripts you can run in your local
Add the mongo db URI from the local desktop or from Mongo DB Atlas account, for example
mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
- how long to remember requests for, in minutes
- configure a number as 1 or greater than 1
- how many requests to allow
- configure a number greater than 1 per your choice
- For how long you can have to return the data from in memory cache
- This property is applicable for randomCodes and searchUser API
Build and install the required nodejs dependencies and devDependencies from package.json
for running this project
You can run the tests with this script and verify if the APIs are working fine or not
- Start the nodejs server in production mode
- Server will be stopped if any issues came up
- Start the nodejs server in development mode
- Server will be restarted if any issues came up
For API Endpoints and Documentation follow this link