Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

VSArchive/COMETLABS-Assessment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event-Specific Coding platform

Running the code

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

yarn install
yarn start

variables in the .env file:

MONGODB_URL JWT_ACCESS_TOKEN JWT_REFRESH_TOKEN SPHERE_PROBLEMS_URL SPHERE_SUBMISSIONS_URL SPHERE_PROBLEMS_TOKEN

Testing the code

The API is hosted at https://sphere-engine-cometlabs.herokuapp.com

Features

Make sure you are using correct Bearer Token for all the requests.

Signup

route - /signup

Signup takes a POST request with four parameters name, email, password, role and gives you email, accessToken, refreshToken as response.

Request:

  • POST

Parameters:

  • name
  • email
  • password
  • role

img

Login

route - /login

Login takes a POST request with two parameters email, password and gives you email, accessToken, refreshToken as response

Request:

  • POST

Parameters:

  • email
  • password

img

Logout

route - /logout

Login takes a POST request with refreshToken

Request:

  • POST

Parameters:

  • refreshToken

img

Refresh Auth Token

route - /refresh

Refresh takes a POST request with refreshToken and gives you accessToken, refreshToken as response

Request:

  • POST

Parameters:

  • refreshToken

img

Home Page

route - /

Greets the user with the name and role

img

List All Questions

route - /displayQuestions

displayQuestions takes a GET request and gives you all questions in Sphere Engine as response including uploaded and auto generated

Request:

  • GET

Parameters:

  • NONE

img

List All Uploaded Questions

route - /displayQuestions

displayQuestions takes a GET request and gives you all questions uploaded by admins

Request:

  • GET

Parameters:

  • NONE

img

Add Questions

route - /addQuestion

addQuestion takes a POST request with parameters name, description

Request:

  • POST

Parameters:

  • name
  • description
  • masterJudgeID

img

Edit Questions

route - /updateQuestion

updateQuestion takes a POST request with parameters new name, new description, id of the question

Request:

  • POST

Parameters:

  • id
  • name
  • description

img

Delete Questions

route - /deleteQuestion

deleteQuestion takes a POST request with id of the question

Request:

  • POST

Parameters:

  • id

img

Add Test Cases

route - /addTestCase

addTestCase takes a POST request with id of the question, input, output, judgeId as the input

Request:

  • POST

Parameters:

  • id
  • input
  • output
  • judgeId

img

Edit Test Cases

route - /updateTestCase

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

Request:

  • POST

Parameters:

  • id
  • input
  • output
  • number (test case number)

img

List Test Cases

route - /listTestCase

listTestCase takes a POST request with id of the question

Request:

  • POST

Parameters:

  • id

img

User Submisions

route - /submission

submission takes a POST request with id of the question, source, compilerId as input

Request:

  • POST

Parameters:

  • problemId
  • source
  • compilerId

img

List All Submissions

route - /listAllSubmissions

listAllSubmissions takes a GET request

Request:

  • GET

Parameters:

  • NONE

img

List Submissions By Users

route - /listUserSubmissions

listUserSubmissions takes a POST request with email of the user

Request:

  • POST

Parameters:

  • email

img

List Submissions for Questions

route - /listQuestionSubmissions

listQuestionSubmissions takes a POST request with id of the question

Request:

  • POST

Parameters:

  • problemId

img

List Self Submissions

route - /listSelfSubmissions

listSelfSubmissions takes a GET request with signed in user

Request:

  • GET

Parameters:

  • NONE

img

About

COMETLABS Internship Interview Assessment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages