Refactor: first iteration of modular and dockerized approach

This commit is contained in:
ivfrost
2026-01-24 15:14:16 +01:00
parent 43e55f9f18
commit 938877d852
147 changed files with 4103 additions and 3044 deletions

400
pom.xml
View File

@@ -1,177 +1,229 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>dev.ivfrost</groupId>
<artifactId>hydro-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>hydro-backend</name>
<description>Backend API for Hydro UI: user accounts, device linking, QR code verification</description>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2025.0.0</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Extra dependencies -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.20.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-crypto -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>6.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.12.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>4.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.bucket4j/bucket4j_jdk17-core -->
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j_jdk17-core</artifactId>
<version>8.15.0</version>
</dependency>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>hydro-api</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
</path>
</annotationProcessorPaths>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>native-maven-plugin</artifactId>
<groupId>org.graalvm.buildtools</groupId>
</plugin>
<plugin>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
</exclude>
</excludes>
</configuration>
<groupId>org.springframework.boot</groupId>
</plugin>
<plugin>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<configuration>
<apiDocsUrl>http://localhost:8080/v3/api-docs</apiDocsUrl>
<outputDir>${project.build.directory}</outputDir>
<outputFileName>openapi.json</outputFileName>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<id>integration-test</id>
</execution>
</executions>
<groupId>org.springdoc</groupId>
<version>1.5</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-boot-starter-security</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-boot-starter-webmvc</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-cloud-starter-vault-config</artifactId>
<groupId>org.springframework.cloud</groupId>
</dependency>
<dependency>
<artifactId>spring-modulith-starter-core</artifactId>
<groupId>org.springframework.modulith</groupId>
</dependency>
<dependency>
<artifactId>spring-modulith-starter-jdbc</artifactId>
<groupId>org.springframework.modulith</groupId>
</dependency>
<dependency>
<artifactId>spring-modulith-starter-test</artifactId>
<groupId>org.springframework.modulith</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>postgresql</artifactId>
<groupId>org.postgresql</groupId>
<scope>runtime</scope>
</dependency>
<dependency>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
<optional>true</optional>
</dependency>
<dependency>
<artifactId>spring-boot-starter-security-test</artifactId>
<groupId>org.springframework.boot</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<groupId>org.springframework.boot</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>spring-modulith-starter-test</artifactId>
<groupId>org.springframework.modulith</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>spring-modulith-events-amqp</artifactId>
<groupId>org.springframework.modulith</groupId>
</dependency>
<dependency>
<artifactId>rest-assured</artifactId>
<groupId>io.rest-assured</groupId>
<scope>test</scope>
<version>6.0.0</version>
</dependency>
<dependency>
<artifactId>hamcrest</artifactId>
<groupId>org.hamcrest</groupId>
<scope>test</scope>
<version>3.0</version>
</dependency>
<dependency>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.20.0</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-validation</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>java-jwt</artifactId>
<groupId>com.auth0</groupId>
<scope>compile</scope>
<version>4.5.0</version>
</dependency>
<dependency>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<groupId>org.springdoc</groupId>
<scope>compile</scope>
<version>3.0.1</version>
</dependency>
<dependency>
<artifactId>swagger-annotations</artifactId>
<groupId>io.swagger.core.v3</groupId>
<scope>compile</scope>
<version>2.2.41</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-data-redis</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-boot-starter-cache</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-boot-starter-amqp</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>spring-rabbit-test</artifactId>
<groupId>org.springframework.amqp</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>h2</artifactId>
<groupId>com.h2database</groupId>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<artifactId>spring-cloud-dependencies</artifactId>
<groupId>org.springframework.cloud</groupId>
<scope>import</scope>
<type>pom</type>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<artifactId>spring-modulith-bom</artifactId>
<groupId>org.springframework.modulith</groupId>
<scope>import</scope>
<type>pom</type>
<version>${spring-modulith.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<description>Hydro API</description>
<developers>
<developer/>
</developers>
<groupId>dev.ivfrost</groupId>
<licenses>
<license/>
</licenses>
<modelVersion>4.0.0</modelVersion>
<name>hydro-api</name>
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<relativePath/>
<version>4.0.1</version> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>21</java.version>
<spring-cloud.version>2025.1.0</spring-cloud.version>
<spring-modulith.version>2.0.1</spring-modulith.version>
</properties>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<url/>
<version>0.0.1-SNAPSHOT</version>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-60</artifactId>
<version>2.21.1</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
<buildpacks>
<buildpack>paketobuildpacks/oracle</buildpack>
<buildpack>paketobuildpacks/java-native-image</buildpack>
</buildpacks>
</image>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>