diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9930560 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 2 + +# backend +[*.{java,kt,xml}] +indent_size = 4 +ij_kotlin_allow_trailing_comma = true +ij_kotlin_allow_trailing_comma_on_call_site = true + +# markdown +[*.md] +max_line_length = off +trim_trailing_whitespace = false + +# misc +[*.{yml,yaml,json}] +indent_size = 2 diff --git a/.forgejo/workflows/backend.yaml b/.forgejo/workflows/backend.yaml index 16af266..16e7b3b 100644 --- a/.forgejo/workflows/backend.yaml +++ b/.forgejo/workflows/backend.yaml @@ -35,7 +35,11 @@ jobs: curl -L "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MAVEN_VERSION/apache-maven-$MAVEN_VERSION-bin.tar.gz" | tar -vxzC /opt echo "/opt/apache-maven-$MAVEN_VERSION/bin" >>$GITHUB_PATH - - name: run tests + - name: lint + working-directory: backend + run: mvn spotless:check + + - name: test working-directory: backend run: | mvn \ diff --git a/backend/.diktat-analysis.yaml b/backend/.diktat-analysis.yaml new file mode 100644 index 0000000..03c8f73 --- /dev/null +++ b/backend/.diktat-analysis.yaml @@ -0,0 +1,13 @@ +--- +- name: DIKTAT_COMMON + configuration: + domainName: at.beerbrawl.backend + testDirs: test + kotlinVersion: 2.0 + srcDirectories: main + +- name: TRAILING_COMMA + enabled: true + configuration: + valueArgument: true + valueParameter: true diff --git a/backend/.editorconfig b/backend/.editorconfig deleted file mode 100644 index 0e2a18d..0000000 --- a/backend/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -root = true - -[*] -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = false -charset = utf-8 -indent_style = space -indent_size = 4 -tab_width = 4 - -[*.{yml,yaml,json,sql}] -indent_size = 2 \ No newline at end of file diff --git a/backend/.gitattributes b/backend/.gitattributes deleted file mode 100644 index 69e1b2f..0000000 --- a/backend/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -package-lock.json binary \ No newline at end of file diff --git a/backend/.gitignore b/backend/.gitignore index ffdb6ad..ba7be4e 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -27,9 +27,6 @@ buildNumber.properties .mvn/timing.properties !maven-wrapper.jar -### npm ### -/node_modules - ### STS ### .apt_generated .classpath @@ -53,4 +50,4 @@ buildNumber.properties /.nb-gradle/ ### VS Code ### -.vscode/ \ No newline at end of file +.vscode/ diff --git a/backend/.license-header b/backend/.license-header new file mode 100644 index 0000000..ef0d129 --- /dev/null +++ b/backend/.license-header @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + diff --git a/backend/package-lock.json b/backend/package-lock.json deleted file mode 100644 index 5ace36e..0000000 --- a/backend/package-lock.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "name": "backend-dummy", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "backend-dummy", - "version": "1.0.0", - "license": "AGPL-3.0-or-later", - "devDependencies": { - "@prettier/plugin-xml": "^3.4.1", - "prettier": "^3.3.2", - "prettier-plugin-java": "^2.6.0" - } - }, - "node_modules/@chevrotain/cst-dts-gen": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz", - "integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==", - "dev": true, - "dependencies": { - "@chevrotain/gast": "11.0.3", - "@chevrotain/types": "11.0.3", - "lodash-es": "4.17.21" - } - }, - "node_modules/@chevrotain/gast": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.0.3.tgz", - "integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==", - "dev": true, - "dependencies": { - "@chevrotain/types": "11.0.3", - "lodash-es": "4.17.21" - } - }, - "node_modules/@chevrotain/regexp-to-ast": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz", - "integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==", - "dev": true - }, - "node_modules/@chevrotain/types": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz", - "integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==", - "dev": true - }, - "node_modules/@chevrotain/utils": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz", - "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==", - "dev": true - }, - "node_modules/@prettier/plugin-xml": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.4.1.tgz", - "integrity": "sha512-Uf/6/+9ez6z/IvZErgobZ2G9n1ybxF5BhCd7eMcKqfoWuOzzNUxBipNo3QAP8kRC1VD18TIo84no7LhqtyDcTg==", - "dev": true, - "dependencies": { - "@xml-tools/parser": "^1.0.11" - }, - "peerDependencies": { - "prettier": "^3.0.0" - } - }, - "node_modules/@xml-tools/parser": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.11.tgz", - "integrity": "sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==", - "dev": true, - "dependencies": { - "chevrotain": "7.1.1" - } - }, - "node_modules/@xml-tools/parser/node_modules/chevrotain": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.1.1.tgz", - "integrity": "sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==", - "dev": true, - "dependencies": { - "regexp-to-ast": "0.5.0" - } - }, - "node_modules/chevrotain": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz", - "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", - "dev": true, - "dependencies": { - "@chevrotain/cst-dts-gen": "11.0.3", - "@chevrotain/gast": "11.0.3", - "@chevrotain/regexp-to-ast": "11.0.3", - "@chevrotain/types": "11.0.3", - "@chevrotain/utils": "11.0.3", - "lodash-es": "4.17.21" - } - }, - "node_modules/chevrotain-allstar": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz", - "integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==", - "dev": true, - "dependencies": { - "lodash-es": "^4.17.21" - }, - "peerDependencies": { - "chevrotain": "^11.0.0" - } - }, - "node_modules/java-parser": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/java-parser/-/java-parser-2.3.0.tgz", - "integrity": "sha512-P6Ma4LU1w/e0Lr4SVM/0PtqCGoL2/i/KP9ZoiyLa824oBqhF0yGTgHDyZkLgp9GTzqR43wm5wabE56FF5X7cqg==", - "dev": true, - "dependencies": { - "chevrotain": "11.0.3", - "chevrotain-allstar": "0.3.1", - "lodash": "4.17.21" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "dev": true - }, - "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prettier-plugin-java": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier-plugin-java/-/prettier-plugin-java-2.6.0.tgz", - "integrity": "sha512-mHZ3Ub3WAyYSUe1mMbiGH85xYV+NtzJgNsrfLNYDKvL7NfvoKBuJiEW4Xa2MFG668f9uRdj38WEuPKmRu+nv/g==", - "dev": true, - "dependencies": { - "java-parser": "2.3.0", - "lodash": "4.17.21", - "prettier": "3.2.5" - } - }, - "node_modules/prettier-plugin-java/node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/regexp-to-ast": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", - "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", - "dev": true - } - } -} diff --git a/backend/package.json b/backend/package.json deleted file mode 100644 index 0106471..0000000 --- a/backend/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "backend-dummy", - "version": "1.0.0", - "private": true, - "description": "Dummy package for using prettier", - "license": "AGPL-3.0-or-later", - "scripts": { - "prettier:check": "prettier --check 'src/**/*.java' '*.json' '*.xml'", - "prettier:fix": "prettier --write 'src/**/*.java' '*.json' '*.xml'" - }, - "devDependencies": { - "@prettier/plugin-xml": "^3.4.1", - "prettier": "^3.3.2", - "prettier-plugin-java": "^2.6.0" - } -} diff --git a/backend/pom.xml b/backend/pom.xml index d514462..6511e0d 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -1,9 +1,5 @@ - - + + 4.0.0 at.beerbrawl @@ -15,12 +11,10 @@ UTF-8 21 - 3.5.0 - 3.3.0 - 3.13.0 - ${java.version} - ${java.version} - 3.6.3 + 2.0.0 + 2.0 + official + true 4.9.10 2.2.224 0.8.12 @@ -29,6 +23,16 @@ 6.5.2.Final 1.18.34 1.5.5.Final + 3.5.0 + 3.3.0 + 3.13.0 + ${java.version} + ${java.version} + 3.6.3 + 2.43.0 + 3.3.2 + 2.6.0 + 2.0.0 3.3.1 6.3.1 2.5.0 @@ -40,14 +44,29 @@ org.springframework.boot spring-boot-dependencies - pom ${spring.boot.version} + pom import + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-maven-lombok + ${kotlin.version} + org.springframework.boot spring-boot-starter-data-jpa @@ -142,6 +161,93 @@ + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + -Xjsr305=strict + + + all-open + jpa + no-arg + spring + + ${kotlin.language.version} + ${java.version} + + + + org.jetbrains.kotlin + kotlin-maven-lombok + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-maven-noarg + ${kotlin.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + + kapt + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + + + org.hibernate.orm + hibernate-jpamodelgen + ${jpamodelgen.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + + + + org.apache.maven.plugins maven-surefire-plugin @@ -187,18 +293,35 @@ -Amapstruct.defaultComponentModel=spring + + + default-compile + none + + + default-testCompile + none + + + java-compile + + compile + + compile + + + java-test-compile + + testCompile + + test-compile + + com.google.cloud.tools jib-maven-plugin ${jib-maven-plugin.version} - - - com.github.luben - zstd-jni - ${zstd-jni.version} - - @@ -216,11 +339,24 @@ + + + com.github.luben + zstd-jni + ${zstd-jni.version} + + pl.project13.maven git-commit-id-plugin ${git-commit-id-plugin.version} + + true + true + ${project.build.outputDirectory}/git.properties + true + get-the-git-infos @@ -229,14 +365,6 @@ - - true - true - - ${project.build.outputDirectory}/git.properties - - true - org.jacoco @@ -274,6 +402,59 @@ + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + ${spotless.prettier.version} + ${spotless.prettier-plugin-java.version} + + + 4 + 100 + java + prettier-plugin-java + + + + .license-header + + + + + + 100 + 4 + 4 + true + + + + ${spotless.diktat.version} + .diktat-analysis.yaml + + + .license-header + + + + + 4 + + + + + .diktat-analysis.yaml + src/**/*.yml + + + + + diff --git a/backend/src/main/java/at/beerbrawl/backend/BackendApplication.java b/backend/src/main/java/at/beerbrawl/backend/BackendApplication.java deleted file mode 100644 index d5608d0..0000000 --- a/backend/src/main/java/at/beerbrawl/backend/BackendApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: AGPL-3.0-or-later */ - -package at.beerbrawl.backend; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class BackendApplication { - - public static void main(String[] args) { - SpringApplication.run(BackendApplication.class, args); - } -} diff --git a/backend/src/main/kotlin/at/beerbrawl/backend/BackendApplication.kt b/backend/src/main/kotlin/at/beerbrawl/backend/BackendApplication.kt new file mode 100644 index 0000000..0df8f07 --- /dev/null +++ b/backend/src/main/kotlin/at/beerbrawl/backend/BackendApplication.kt @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +package at.beerbrawl.backend + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.runApplication + +/** + * Main Spring Boot entry point. + */ +@SpringBootApplication +class BackendApplication + +fun main(args: Array) { + runApplication(*args) +} diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 3d6549d..ce1e04d 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -34,7 +34,7 @@ spring: security: auth: header: Authorization - prefix: 'Bearer ' + prefix: "Bearer " login-uri: /api/v1/authentication jwt: secret: ?E(H+MbQeThWmZq4t7w!z%C*F-J@NcRfUjXn2r5u8x/A?D(G+KbPdSgVkYp3s6v9 diff --git a/backend/src/test/resources/application-test.yml b/backend/src/test/resources/application-test.yml index a6ba304..7c24f60 100644 --- a/backend/src/test/resources/application-test.yml +++ b/backend/src/test/resources/application-test.yml @@ -10,4 +10,4 @@ spring: show-sql: true properties: hibernate: - format-sql: TRUE \ No newline at end of file + format-sql: TRUE diff --git a/e2e/.editorconfig b/e2e/.editorconfig deleted file mode 100644 index ff9b6fc..0000000 --- a/e2e/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -max_line_length = off -trim_trailing_whitespace = false diff --git a/frontend/.editorconfig b/frontend/.editorconfig deleted file mode 100644 index 6e87a00..0000000 --- a/frontend/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# Editor configuration, see http://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -max_line_length = off -trim_trailing_whitespace = false