Quizy Back End provides the server-side functionality for hosting interactive quiz games. A host can create a game room secured with a unique name and password. Players join the room using these credentials and wait for the host to start the game. At the end of each game, a ranked scoreboard is displayed to showcase player standings.
- Web API: Express.js
- Database: MongoDB with Mongoose
- WebSocket Implementation: Socket.io
- Runtime: Bun (compatible with Node.js)
-
Host Control:
The host has complete control over when to start the game. -
Question Management:
The host can add or edit questions before the game starts. -
Flexible Question Delivery:
The host can send questions to players at their discretion. -
Real-Time Synchronization:
All players receive questions simultaneously, ensuring everyone stays in sync. -
Scoreboard Generation:
At the end of the game, the host can generate a scoreboard to announce the winner.
To install dependencies:
bun installTo run:
bun run index.js💡 Proof of Concept - Front End Implmentation of this API can be seen at Quizy-FE
- GET
/
Returns a "Welcome to Quizy!" message.
-
GET
/viewquestions
Returns all questions in the database. -
GET
/viewquestion/:qid
Returns a single question by itsquestionid. -
GET
/viewquestionbyroom/:roomname
Returns all questions for a specific room. -
DELETE
/deletequestion/:qid/:roomname
Deletes a question by itsquestionidandroomname. -
GET
/submitchoices/:roomname
Emits asubmitchoicesevent to all clients in the room. -
GET
/calculatescore/:roomname
Calculates and updates scores for all players in the room. -
GET
/sendquestion/:roomname/:questionnumber
Sends a specific question to all players in the room. -
POST
/savequestion
Adds a new question.
Body:{ "questiontxt": "string", //How many planets does Solar System have? "choices": number[], //[10,5,2,9] "answer": number, //3 "roomname": "string" //mysampleroom } -
PUT
/editquestion
Edits an existing question.
Body:{ "questionid": "string", "questiontxt": "string", "choices": number[], "answer": number, "roomname": "string" }
- Handles player submissions and related actions.
- GET
/scoreboard/:roomname
Returns the scoreboard (sorted by score) for a specific room.
-
createroom
Creates a new room. -
joinroom
Joins an existing room. -
manageroom
Authenticates and manages a room.
Incase you missed it - Proof of Concept - Front End Implmentation of this API can be seen at Quizy-FE