From e79b4279391333d117e369ced94dba2610362c79 Mon Sep 17 00:00:00 2001 From: Moritz Kowalski Date: Thu, 3 Apr 2025 11:51:23 +0200 Subject: [PATCH 1/4] Add README --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3891fd4 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# KickerELO + +KickerELO is a web application for displaying Elo ratings for foosball (table soccer) games. +It uses **Spring Boot** for the backend, **Vaadin** for the frontend, and **MariaDB** as the database. + +## Requirements + +- **Java 23** or later +- **Maven** (if not integrated) +- **MariaDB** (for production use) + +## Installation + +### 1️⃣ Clone the repository +```sh +git clone https://github.com/your-repo/kickerelo.git +cd kickerelo +``` + +### 2️⃣ Set up the database + +- **For testing**: No database setup is required, as an H2 in-memory database is used by default. +- **For production**: The application requires MariaDB. If MariaDB is already installed, make sure the database and +credentials are correctly configured in `application.properties`. + +If you don't have MariaDB installed, you can quickly start a database using Docker: + +```sh +docker run --name kickerelo-db -e MYSQL_ROOT_PASSWORT=root -e MYSQL_DATABASE=kickerelo -p 3306:3306 -d mariadb:latest +``` + +### 3️⃣ Build the project + +To generate the file `target/kickerelo.jar`: + +```sh +mvn clean package +``` + +### 4️⃣ Run the application + +- For testing (default): + +```sh +mvn spring-boot:run +``` + +- For production (requires MariaDB): + +```sh +mvn spring-boot:run -Dspring-boot.run.profiles=production +``` + +Alternatively, you can run the built .jar file: + +```sh +java -jar target/kickerelo.jar +``` From 59cfff96d0afe47bc0571bc47f335733b5272bd3 Mon Sep 17 00:00:00 2001 From: Moritz <34131471+Moritz921@users.noreply.github.com> Date: Thu, 3 Apr 2025 11:53:42 +0200 Subject: [PATCH 2/4] Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3891fd4..24510cb 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ credentials are correctly configured in `application.properties`. If you don't have MariaDB installed, you can quickly start a database using Docker: ```sh -docker run --name kickerelo-db -e MYSQL_ROOT_PASSWORT=root -e MYSQL_DATABASE=kickerelo -p 3306:3306 -d mariadb:latest +docker run --name kickerelo-db -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=kickerelo -p 3306:3306 -d mariadb:latest ``` ### 3️⃣ Build the project From 7ee4a90040b4fae6a4ce04e8edd3c35288eafc8f Mon Sep 17 00:00:00 2001 From: Moritz Kowalski Date: Thu, 3 Apr 2025 18:57:08 +0200 Subject: [PATCH 3/4] Fix AJMicke requests --- README.md | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3891fd4..ad94805 100644 --- a/README.md +++ b/README.md @@ -11,48 +11,62 @@ It uses **Spring Boot** for the backend, **Vaadin** for the frontend, and **Mari ## Installation -### 1️⃣ Clone the repository +### Clone the repository ```sh git clone https://github.com/your-repo/kickerelo.git cd kickerelo ``` -### 2️⃣ Set up the database +If you want to run the application in production mode, you can skip to [Production](#production) and set up the database. -- **For testing**: No database setup is required, as an H2 in-memory database is used by default. -- **For production**: The application requires MariaDB. If MariaDB is already installed, make sure the database and -credentials are correctly configured in `application.properties`. -If you don't have MariaDB installed, you can quickly start a database using Docker: +### Testing + +To run the application in a test environment, you can use an embedded H2 database. This is useful for development and testing purposes. + +To build the project and run the application with the embedded H2 database, use the following commands: + +```sh +mvn clean package +mvn spring-boot:run +``` + + +### Production + +The application requires a database to store the data. If MariaDB is already installed, make sure the database and +credentials are correctly configured in `application-prod.properties` and skip to step [Build the project](#build-the-project). + +#### Set up database + +You can quickly start a database using Docker and update its schema using the provided `update-schema.sql` file. ```sh docker run --name kickerelo-db -e MYSQL_ROOT_PASSWORT=root -e MYSQL_DATABASE=kickerelo -p 3306:3306 -d mariadb:latest +docker exec -i kickerelo-db mysql -u root -p kickerelo < update-schema.sql ``` -### 3️⃣ Build the project + +#### Build the project To generate the file `target/kickerelo.jar`: ```sh -mvn clean package +mvn clean package -Pproduction ``` -### 4️⃣ Run the application +### Run the application -- For testing (default): +You can run the application in two ways: -```sh -mvn spring-boot:run -``` - -- For production (requires MariaDB): +1. Using Maven: ```sh mvn spring-boot:run -Dspring-boot.run.profiles=production ``` -Alternatively, you can run the built .jar file: +2. Using the built .jar file: ```sh -java -jar target/kickerelo.jar +java -jar target/kickerelo.jar --spring.profiles.active=prod ``` From 6af65a669461892681e2b3246984c29081810d43 Mon Sep 17 00:00:00 2001 From: Moritz <34131471+Moritz921@users.noreply.github.com> Date: Fri, 4 Apr 2025 00:55:03 +0200 Subject: [PATCH 4/4] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1836e0e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 AJMicke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.