Skip to content

sopra-fs23-group-01/sopra-fs23-group-01-server

Repository files navigation

Who is undercover? :shipit:

Deploy Project to App Engine Spring Boot Spring WebSocket

Table of Content

Introduction

"Who's Undercover" is a very popular social party game from China that usually requires 4 or more players to play together. The game aims to find out the "Undercover" characters hidden among all players through description and reasoning.

The game consists of at least 4 people and at most 8 people. After the game starts, everyone will be assigned a word. You may be assigned a different word, which means you are undercover. Usually in a game Among them, if there are 5 players, including games with less than 5 players, one person is undercover, and games with more than 5 players have two undercovers. Each round of the game has a description link. As an undercover, you should try your best to hide your identity.

As a detective, you Carefully observe whether other players are undercover. After each round of description, players must vote for a player. When the number of undercovers is the same as the number of detectives, the undercover victory is declared. If all undercovers are voted out, the detection wins. Have fun !

Built With

  • React - Frontend JavaScript library developed by facebook
  • Spring - Framework that enables running JVM
  • Gradle - Build automation tool
  • STOMP - Text agreement for configuring WebSocket connections
  • Spring WebSocket - Real-time interactive applications
  • SockJS - API compatible with WebSocket
  • Datamuse API - Datamuse Api to get synonyms

Main Components

User

The User JPA entity, the most important part of the whole game is user, they are the main participants of the game, this class determines their identity information and winning information in the game, these information play an important role in the whole game

UserController

The UserController is mainly responsible for processing the RESTful request from the client related to user, and directing it to the correct service function in the server side

Room

The Room JPA entity, another important part is mainly responsible for storing the information we need to use in the game process, such as the player list in the room, and the process status of the game, etc., as an important part of controlling our game information

RoomService

The RoomService contains the main logic function that controls the overall process of the game. It fully cooperates with RoomController and ChatService to precisely control the correct operation of the game, including the assignment of words, identities and voting, etc.

WebSocketConfig

The WebSocketConfig is a Spring Boot configuration class, which is used to set the relevant configuration of WebSocket and STOMP message proxy. After configuration, the client can connect to "/ws" through WebSocket, and send and receive messages through STOMP protocol to realize real-time communication

Deployment

1. Local Deployment

Clone Repository

Clone the client-repository onto your local machine with the help of Git.

git clone https://github.com/sopra-fs23-group-01/sopra-fs23-group-01-server.git

Build

./gradlew build

Run

./gradlew bootRun

You can verify that the server is running by visiting localhost:8080 in your browser.

Test

./gradlew test

2. Remote Deployment

In this project, we applied Google Cloud to realize our remote deployment. You can set up Google Cloud App Engine to deploy synchronously. When the content of Github is updated, it will be automatically checked and remotely deployed to the cloud

For more inforamtion please refer to Google Cloud Deployment.

Illustrition

The main user flow(s) please refer to our client side.

Roadmap

New developers who want to contribute to your projec could add:

  • More game modes, such as more themes
  • Add kicking function to the room
  • Add friend function, friends in the game can play a game together

Authors & Acknowledgments

Authors

Acknowledgments

We extend our deepest gratitude to our tutor, Valentin as well as to the entire team involved in the Software Engineering Lab course at the University of Zurich.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages