An open API service indexing awesome lists of open source software.

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

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