https://github.com/davidkarnik/webgame
Web Game - Angular - Spring
https://github.com/davidkarnik/webgame
angular ci-cd-pipeline css html java spring-boot typescript
Last synced: about 1 month ago
JSON representation
Web Game - Angular - Spring
- Host: GitHub
- URL: https://github.com/davidkarnik/webgame
- Owner: DavidKarnik
- Created: 2023-07-22T12:37:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-01T11:31:32.000Z (about 1 year ago)
- Last Synced: 2024-12-29T19:10:26.480Z (9 months ago)
- Topics: angular, ci-cd-pipeline, css, html, java, spring-boot, typescript
- Language: TypeScript
- Homepage:
- Size: 1.63 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web Game
Project of simple clicking web game with a database and separate frontend and backend.
#### Logic
Load main page with score == 0, blank nickname textbox, time set to 10 seconds and svg target in the middle. When target is clicked start time t=10 until t=0 and save nickname to temporary variable. If player click in target radius, add score++. When miss-click target do miss++. After every click change target position. When t=0 stop game, show results (modal), send data to backend, do logic and store them into the MySQL database. Restart.## Used Tools and Languages
| Frontend | Backend | Database | Cloud hosting/ Deployment | Git | Tests |
| --- | --- | --- | --- | --- | --- |
| [TypeScript](https://www.typescriptlang.org/) | [Java](https://www.java.com/en/) | [MySQL](https://www.mysql.com/) | [AWS](https://aws.amazon.com/) | [Git](https://git-scm.com/) | [Jacoco](https://www.jacoco.org/jacoco/trunk/index.html) |
| [HTML, CSS](https://html.com/) | [Spring Boot](https://spring.io/projects/spring-boot) | [MySQL Workbench](https://www.mysql.com/products/workbench/) | [Ubuntu](https://ubuntu.com/aws) | [Git Bash](https://gitforwindows.org/) | [SonarCloud](https://www.sonarsource.com/products/sonarcloud/) |
| [Angular](https://angular.io/) | [Maven](https://maven.apache.org/) | JPA API | [Docker](https://www.docker.com/) | [GitHub](https://github.com/) | [Karma](https://karma-runner.github.io/latest/index.html) |
| [WebStorm](https://www.jetbrains.com/webstorm/) | [IntelliJ IDEA](https://www.jetbrains.com/idea/) | | | [GitHub Actions](https://github.com/features/actions) | |## Screenshots

## MySQL Database
#### Get all players
```
GET /api/players
```| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `id` | `BIGINT` | **Required**. Player key |
| `nickname` | `VARCHAR` | Player nickname |
| `score` | `INT` | Player score |#### Get leaderboard (Top 10 players)
```
GET /api/leaderboard
```SELECT * FROM databaseName ORDER BY score DESC LIMIT 10
## Running Tests
To run unit tests for frontend via [Karma](https://karma-runner.github.io), run the following command
```bash
ng test
```To run tests for backend and generate test coverage report from [jacoco](https://www.jacoco.org/jacoco/trunk/index.html), run the following command
```bash
mvn clean test
```## Deployment
#### Frontend
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.#### Backend
Run `mvn package` in /webGame/webGame/ directory for build the project (/xxxFileName-0.0.x-SNAPSHOT.jar)
Run `java -jar /xxxFileName-0.0.x-SNAPSHOT.jar` for start application server. Navigate to `http://localhost:8080/`.#### All-in-One
Using [Docker](https://www.docker.com/) for automated deployment. To deploy this project run```bash
*not implemented yet*
```## Author
- [Me, myself and I](https://github.com/DavidKarnik)