This game is a project requested by our University (UFPE), developed and designed by students.
Our objective here is understand the different types of multimedia and discover the power of the internet.
Our idea was to create a game that would be played by one, two or more players.
You can understand more of the game in the Front-End Readme (will be added here later :D).
| Type | Description |
|---|---|
| Node.js | Server |
| Express | Server |
| Socket.io | Server |
| Nodemon | Server (Development) |
| spotify-web-api-node | Spotify API |
| TypeScript | Server |
Run the following command in your terminal:
npm installNow you can run the server with the following command:
nodemon index.tsOBS: Nodemon is only for development purposes. If you want to run the server in production, you can run the following command:
node index.tsWe can use ngrok to share the server with other people.
You can check ngrok documentation here.
| Route | Type |
|---|---|
| / | GET |
| /api/create-room | POST |
| /api/join-room | POST |
| /api/exit-room | POST |
| /api/fetch-rooms | GET |
| /api/update-room | PUT |
| /api/restart-room | PUT |
Body
"steps": number (required),
"owner": {
"name": string (required),
"crowns": number (optional),
},
"genres": string[] (optional),- The back-end will generate an Unique ID to indentify the room that will be returned.
Response
"id": UUID,
"players": string[],
"tracks": track_list[],
"started": boolean,
"steps": number,
"genres": string[],Body
"roomID": UUID (required),
"user": {
"name": string (required),
"crowns": number (optional)
}- Crowns: Actual number of victories.
Response
"id": UUID,
"players": string[],
"tracks": track_list[],
"started": boolean,
"steps": number,
"genres": string[],Response
[
"id": UUID,
"players": string[],
"tracks": track_list[],
"started": boolean,
"steps": number,
"genres": string[],
]Body
"roomId": UUID, (required)
"user": string, (required)Response
"status": 200 | 404,
"message": string,Body
"roomId": UUID, (required)
"room": {
"started": boolean, (required)
"steps": number, (required)
"genres": string[], (required)
"finished": boolean, (required)
}Even if not changed all the informations, all of them need to be sent.
Response
"id": UUID,
"players": string[],
"tracks": track_list[],
"started": boolean,
"steps": number,
"genres": string[],Body
"roomId": UUID, (required)Response
"status": 200 | 404,
"message": string,23/04/2022:
- Arthur (thurcst):
- Created all interfaces to be used in the project.
- Created all classes to be used in the project.
- Choosed the best way to organize the project.
- Picked one library to (not) implement Spotify API.
- Added the
/route to be the test page. - Added the
/api/test-websocketroute to test websocket. - Added the
/api/create-roomroute. - Added the
/api/fetch-roomsroute. - Added the
/api/join-roomroute. - Added the
/api/exit-roomroute. - Added the
/api/update-roomroute. - Added the
/api/restart-roomroute.
11/05/2022:
- Arthur (thurcst):
- After our infrastructure change, we decided to use WebSocket protocol instead of http calls.
- Added the
stopandtrackAssertevents on websocket.- The
stopevent will be fired when the user stops the game. - The
trackAssertevent will be fired after the stop, to make players send their crowns.
- The
- Created the result attribute on room class.
- Deleted old stop implementation.
- Created the
disconnectroutine on websocket.- The
disconnectroutine will be fired when the user disconnects from the server.- We remove player from room if he is in one.
- The