digi-doodle --- Built by Sophia Koeut | Michael Weedman | Jonathan Jackson | Austin Tumlinson | Daniel Kent
DigiDoodle is an application that uses Canvas and Socket.io to re-create the classic game, Pictionary. A user can sign up with a username and be automatically navigated to an open avaliable game. Users take turns to draw and guess the corresponding prompts on the screen. When the prompt is answered correctly, the drawer is awarded 2 points and the user who guesses correctly receives one point. The first person who reaches 15 points wins the game!
FRONT END - HTML | CSS | JS | REACT | RESTFUL API | COOKIES | SOCKET.IO | JEST | ENZYME
BACK END - NODE | EXPRESS | SOCKET.IO | MOCHA | CHAI
Digi-doodle uses websockets as a primary form of data exchange. As such, there are only two traditional endpoints. The game lifecycle states indicate the object passed to the client fron the server for each of the stages of a game.
- 'waiting for players'
{ id: 'game uuid', current_drawer: null, current_answer: null, status: 'waiting for players', winner: null }
- 'standby'
{ id: 'game uuid', current_drawer: 'drawer uuid', //drawer who is up next current_answer: null, status: 'standby', winner: null }
- 'drawing'
{ id: 'game uuid', current_drawer: 'drawer uuid', current_answer: 'current answer', status: 'standby', winner: null }
- Game ended
{ id: 'game uuid', current_drawer: 'drawer uuid', current_answer: 'current answer', status: 'standby', winner: 'winner username' }
Receives a username in a req.body and then writes a new user to the database. This returns the userID (UUID).
Request Format:
{
"username": "example-user-name"
}Success Response
Returns only the new user's id. Code :
200 OK"a2ddf32a-9a60-4075-8626-a85928e093af"
Error Response
If a username is not provided: Code :
404Body:{ "error": "Request must include a username" }
If a username is already taken: Code :
404Body:{ "error": "Duplicate usernames are not allowed" }
____________________________________________________
Looks at all current games. If there is a game with an empty seat, it places the requesting player in that game and returns the game id. If there are no games with open seats, it will create a new game, place the player in it, and return the game id.
Request Format:
{ "playerId": "player id here", "username": "username here", }
Success Response
Returns the gameId of the game joined Code :
200 OK{ "gameId": "game uuid here", }
Error Response
If user is already in a game Code :
404Body:{ "error": "You are already in a game" }