Amit91848 / Cometlabs-Test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running the code

Make sure you have the latest version of the code and filled in the .env file.

yarn install
yarn dev

.env example:

  • PORT
  • MONGOOSE_URI
  • ACCESS_TOKEN_EXPIRY
  • ACCESS_TOKEN_SECRET
  • SPHERE_ENGINE_PROBLEM_TOKEN
  • SPHERE_ENGINE_PROBLEM_URL
  • SES_ACCESS_KEY
  • SES_SECRET_ACCESS_KEY

DEPLOYED CODE

The API is hosted at https://comet-labs-test.onrender.com

ADMIN LOGIN

Features

Signup

route - /user/signup

Request:

  • POST

Parameters:

  • name
  • email
  • password

Returns:

  • accesstoken
  • email

img img

Login

route - /user/login

Request:

  • POST

Parameters:

  • email
  • password

img

All Questions

route - /problem/allQuestions

Request:

  • GET

Returns:

  • List of problems from Sphere Engine API

img

All Added Questions

route - /problem/addedQuestion

Questions added by admin

Request:

  • GET

Parameters:

  • NONE

img

Add Questions

route - /addQuestion

Request:

  • POST

Parameters:

  • name
  • description
  • masterJudgeId

img

Update Questions

route - /question

Request:

  • PUT

Parameters:

  • problemId*
  • name*
  • body*

img

Add Test Cases

route - /test/

Request:

  • PUT

Parameters:

  • problemId*
  • judgeId*
  • input
  • output
  • active
  • timeLimit

img

Update Test Cases

route - /updateTestCase

updateTestCase takes a POST request with id of the question, input, output, number of test case as the input

Request:

  • PUT

Parameters:

  • problemId*
  • number* (test case number)
  • input
  • output
  • active
  • timeLimit

img

List Test Cases

route - /testcase/all

Request:

  • POST

Parameters:

  • problemId*

img

List All Submissions

route - /submission

Request:

  • GET

Parameters:

  • NONE

Create submission

route - /submission

Request:

  • POST

Parameters:

  • problemId*
  • compilerId*
  • source*
  • compilerVersionId

img

Submission Result Mail

img

About


Languages

Language:TypeScript 100.0%