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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b64edc --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# 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 + +### Clone the repository +```sh +git clone https://github.com/your-repo/kickerelo.git +cd kickerelo +``` + +If you want to run the application in production mode, you can skip to [Production](#production) and set up the database. + + +### 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_PASSWORD=root -e MYSQL_DATABASE=kickerelo -p 3306:3306 -d mariadb:latest +docker exec -i kickerelo-db mysql -u root -p kickerelo < update-schema.sql +``` + + +#### Build the project + +To generate the file `target/kickerelo.jar`: + +```sh +mvn clean package -Pproduction +``` + +### Run the application + +You can run the application in two ways: + +1. Using Maven: + +```sh +mvn spring-boot:run -Dspring-boot.run.profiles=production +``` + +2. Using the built .jar file: + +```sh +java -jar target/kickerelo.jar --spring.profiles.active=prod +```