- SpringBoot
- Gradle
- Java
- JPA
- Mockito
- RESTful API
- WebSockets
- Google Cloud
- SonarQube
The game controller is critical to the app's functionality because it handles practically all API requests performed during the game turns. For example, it is responsible for setting player ready/unready, start the game and upload audio and guessing words.
The user can view a public lobby, find existing waiting rooms and select one to join to a room, or user can exit the room when he/she is already in the room, then the owner of this room can start the game. And game controller controls the startings and endings of the games. After finishing each game, the game and room entity will be deleted.
The game entity extends the room, will be created when the game starts, and it will be deleted after the game ends. The game entity contains the game's status, the current player's turn, the current round, and all needed information.
The player entity extends the user, will be created when the game starts, and it will be deleted after the game ends. The player entity contains the player's status, the player's score, and all needed information.
Download your IDE of choice (e.g., IntelliJ, Visual Studio Code, or Eclipse). Make sure Java 17 is installed on your system (for Windows, please make sure your JAVA_HOME
environment variable is set to the correct version of Java).
- File -> Open... -> SoPra server template
- Accept to import the project as a
gradle project
- To build right click the
build.gradle
file and chooseRun Build
The following extensions can help you get started more easily:
vmware.vscode-spring-boot
vscjava.vscode-spring-initializr
vscjava.vscode-spring-boot-dashboard
vscjava.vscode-java-pack
External database MongoDB is adopted, substitute it in application.properties with your own collection.
Zhipu AI (https://open.bigmodel.cn) is the API we used to distribute words for the game, you will need to use your own API Key
Note: You'll need to build the project first with Gradle, just click on the build
command in the Gradle Tasks extension. Then check the Spring Boot Dashboard extension if it already shows soprafs24
and hit the play button to start the server. If it doesn't show up, restart VS Code and check again.
You can use the local Gradle Wrapper to build the application.
- macOS:
./gradlew
- Linux:
./gradlew
- Windows:
./gradlew.bat
More Information about Gradle Wrapper and Gradle.
./gradlew build
./gradlew bootRun
You can verify that the server is running by visiting localhost:8080
in your browser.
./gradlew test
You can start the backend in development mode, this will automatically trigger a new build and reload the application once the content of a file has been changed.
Start two terminal windows and run:
./gradlew build --continuous
and in the other one:
./gradlew bootRun
If you want to avoid running all tests with every change, use the following command instead:
./gradlew build --continuous -xtest
- ❎ Implement a live chat feature.
- ❎ Allow to finish each round earlier
- ❎ Configurable setting of game rounds and word difficulty.
- ❎ Optional re-match after a game ends.
Name | Personal page |
---|---|
Han Yang | |
Shaochang Tan | |
Yixuan Zhou | |
Zehao Zhang | |
Zihan Liu |
- The client code is based on the SoPra FS24 - Server Template.
- Many thanks to Miro Vannini who helped us as a Tutor and Scrum Master during this SoPra project.
We publish the code under the terms of the Apache 2.0 License that allows distribution, modification, and commercial use. This software, however, comes without any warranty or liability.