https://github.com/ztirom45/guessnumberserver
a guess a number game server written in java using springboot and postgres
https://github.com/ztirom45/guessnumberserver
game java server spring
Last synced: about 1 month ago
JSON representation
a guess a number game server written in java using springboot and postgres
- Host: GitHub
- URL: https://github.com/ztirom45/guessnumberserver
- Owner: Ztirom45
- Created: 2025-02-12T12:03:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-21T14:14:49.000Z (over 1 year ago)
- Last Synced: 2025-03-04T04:15:32.373Z (over 1 year ago)
- Topics: game, java, server, spring
- Language: Java
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GuessNumberServer ๐โ๐๐
A spring boot server for the numberguessing game
## Use:
### install with docker compose ๐โฉ
#### tested on (Fedora 41 x86)
- [download install_and_run_compose.yaml](https://raw.githubusercontent.com/Ztirom45/GuessNumberServer/refs/heads/release/compose.yaml)
- or use `wget https://raw.githubusercontent.com/Ztirom45/GuessNumberServer/refs/heads/release/install_and_run_compose.yaml`
- or use `curl -O https://raw.githubusercontent.com/Ztirom45/GuessNumberServer/refs/heads/release/install_and_run_compose.yaml`
- run `docker compose -f install_and_run_compose.yaml up`
- you may need to use `sudo`
- you may need to start docker `sudo systemctl start docker`
- if it throws errors after first boot up: try to rerun it
### build yourself ๐ ๐:
#### tested on: (Fedora 41 x86) (raspberry pi os arm)
```
git clone https://github.com/Ztirom45/GuessNumberServer
cd GuessNumberServer
./gradlew bootJar
docker compose build
docker compose up
```
- you may need to use `sudo`
- you may need to start docker `sudo systemctl start docker`
### frontend ๐ฅ๏ธ:
- http://localhost:8080
### guess API ๐ง:
- range:
```java
float GUESS = (float)(ThreadLocalRandom.current().nextInt(-0x7fffffff,0x7fffffff))/10000.f;
```
- http://localhost:8080/greeting?number= `GUESS`
- example: http://localhost:8080/greeting?number=-11.12
### highscore API ๐ง:
- `float time`
- `int tries`
- add a score: [http://localhost:8080/score?tries=](_)`tries`[&time=](_)`time`
- read scores: http://localhost:8080/get_scores
## used technoligies
### backend ๐ง:
- ๐spring boot
- ๐postgres / h2 in the past
### frontend ๐ฅ๏ธ:
- html css javascript
- โtailwind + dazyui
### deployment
- ๐docker-compose