Skip to content

Commit

Permalink
Merge pull request #81 from SecretJ12/development
Browse files Browse the repository at this point in the history
First stable release v0.0.1
  • Loading branch information
jonastahl authored Oct 5, 2024
2 parents 6786ede + 5801afd commit ba28ba0
Show file tree
Hide file tree
Showing 311 changed files with 30,414 additions and 5,994 deletions.
49 changes: 12 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,38 @@ jobs:
name: Validate format of backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 22
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Validate backend format
run: mvn formatter:validate
buildBackend:
name: Build backend
runs-on: ubuntu-latest
needs: formatBackend
steps:
- uses: actions/checkout@v3
- name: Set up JDK 22
uses: actions/setup-java@v3
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Build backend
run: cd backend && mvn package
run: mvn spotless:check

formatFrontend:
name: Validate format of frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install frontend dependencies
run: cd frontend/app && npm install
run: cd src/main/webui && npm install
- name: Validate frontend linter
run: cd frontend/app && npm run lint:validate
run: cd src/main/webui && npm run lint:validate
- name: Validate frontend prettier
run: cd frontend/app && npm run prettier:validate
buildFrontend:
name: Build frontend
runs-on: ubuntu-latest
needs: formatFrontend
steps:
- uses: actions/checkout@v3
- name: Set up JDK 22
uses: actions/setup-java@v3
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Build frontend
run: cd frontend && mvn package
run: cd src/main/webui && npm run prettier:validate

buildAll:
name: Build whole application
runs-on: ubuntu-latest
needs:
- formatBackend
- formatFrontend
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 22
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Push Docker Image

on:
push:
tags:
- 'v*.*.*'


jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}

- name: Set up JDK 22
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven

- name: Set versions
run: |
TAG_VERSION=${{ github.ref }}
VERSION=${TAG_VERSION#refs/tags/v}
mvn versions:set -DnewVersion=$VERSION
mvn versions:commit
jq --arg version "$VERSION" '.version= $version' src/main/webui/package.json > tmp.$$.json && mv tmp.$$.json src/main/webui/package.json
- name: Build with Maven
run: mvn package

- name: Build and push
uses: docker/build-push-action@v6
with:
file: ./src/main/docker/Dockerfile.jvm
context: .
cache-from: |
user/app:cache
type=local,src=.
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ nb-configuration.xml
.env

# Frontend
node_modules/**
package-lock.json
**/node_modules/**
auto-imports.d.ts
components.d.ts
src/main/webui/dist/**

keycloak/**
keycloak-19.0.1/**
backend/.mvn
backend/.mvn
/src/main/webui/node_modules/*
File renamed without changes.
File renamed without changes.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Tournament planer

# Tournament Planner

This project is a comprehensive tournament planning application that leverages modern web technologies like Vue3 (in the frontend),
Quarkus (for the backend), Keycloak (for authentication) to provide a seamless user experience.

## Getting Started
This application is a monorepo that contains both the frontend and backend code. The frontend is a Vue3 application that
is located in the `frontend/app` directory, while the backend is a Quarkus application located in the `backend` directory.
The application supports mail sending for verification and reminder mails.

For this create a `.env` file under backend with the following content:
```
MAIL_FROM=${ your mail address }
MAIL_HOST=${ your mail host }
MAIL_USER=${ your mail address }
MAIL_PASS=${ your mail password }
```
For admin verification the application uses keycloak before deploying this application for production you need to
set up the admin username and password. For this create a `.env` file under the folder `keycloak` with the following content:
```env
KEYCLOAK_ADMIN_USER=${ your keycloak admin user }
KEYCLOAK_ADMIN_PASS=${ your keycloak admin password }
KC_DB_USERNAME=${ the username for the keycloak database }
KC_DB_PASSWORD=${ the password for the keycloak database }
```

# Starting the application in development mode
The application can be started in development mode by following the steps below:
## Vue
```shell
mvn compile -DfrontendDev -DnoFrontendComp
```

```shell
cd frontend/app
npm install
```

For compilation and hot reload
```shell
npm run dev
```

## Quarkus
The Quarkus application starts in development mode also a keycloak container, which is used for user authentication:
```shell
cd backend
mvn compile quarkus:dev -DbackendDev
```

## Build Quarkus+Vue
To build the whole application:
```shell
mvn package
```

Don't compile frontend
```shell
mvn package -DnoFrontendComp
```
Don't compile backend
```shell
mvn package -DnoBackendComp
```

## Clean
```shell
mvn clean
```

# Starting the application in production mode
First start the keycloak service by running the following command in the `keycloak` directory:
```shell
docker compose up
```
Then you need to import the Quarkus realm under:
- Realm settings in the menu.
- Point to the Action menu in the top right corner of the realm settings screen, and select Partial import.
- A prompt then appears where you can select the file you want to import.
Based on this file, you see the resources you can import along with the realm settings.
- Click Import.

After that you can start the Quarkus application by running the following command in the `backend` directory:
```shell
./mvnw install
java -jar target/quarkus-app/quarkus-run.jar
```

Finally, start the Vue application by running the following command in the `frontend/app` directory:
TBD

49 changes: 0 additions & 49 deletions Readme.md

This file was deleted.

5 changes: 0 additions & 5 deletions backend/.dockerignore

This file was deleted.

60 changes: 0 additions & 60 deletions backend/README.md

This file was deleted.

Loading

0 comments on commit ba28ba0

Please sign in to comment.