- Change to the root directory of the project.
- Run
npm install
. This should install all dependencies. - Copy
.env.example
to.env
and fill in the variables. - You NEED MongoDB replica set, If you don’t have them installed but have
Docker and Docker-compose you can run
npm run infra
in the root. - Now run
npm run dev
. This should launch the server - Server is now running on
http://localhost:{PORT}
.
POST /signup
Sign UpPOST /login
Log in
-
POST /quiz
creates a new quiz -
GET /quizzes
Gets all quizzes.- Pass
?createdBy={:userId}
query to get all quizzes created by a user
- Pass
-
GET /quiz/[:quizId]
Get Single quiz (with questions) -
PATCH /quiz/[:quizId]
Updates a quiz -
DELETE /quiz/[:quizId]
Deletes a quiz
POST /quiz/[:quizId]/questions
Creates and Adds a question to a quizGET /quiz/[:quizId]/questions/[:questionId]
Gets a questionPATCH /quiz/[:quizId]/questions/[:questionId]
Updates a questionDELETE /quiz/[:quizId]/questions/[:questionId]
Deletes a question
-
POST /quiz/[:quizId]/submissions
Creates a submission for a quiz -
GET /quiz/[:quizId]/submissions
Gets all submissions for a quiz.- Pass
?byCurrentUser=1
query to get all submissions of the current user for the quiz
- Pass
-
GET /quiz/[:quizId]/submissions/[:submissionId]
Gets single submission details with breakdown/analysis -
GET /submissions/by-user
Gets all submissions made by the current/signed in user (on any quiz)