first commit
This commit is contained in:
170
unionflow-server-impl-quarkus/pom.xml
Normal file
170
unionflow-server-impl-quarkus/pom.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>dev.lions.unionflow</groupId>
|
||||
<artifactId>unionflow-server-impl-quarkus</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>UnionFlow Server Implementation (Quarkus)</name>
|
||||
<description>Implémentation Quarkus du serveur UnionFlow</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<quarkus.platform.version>3.15.1</quarkus.platform.version>
|
||||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<!-- Dépendance vers l'API -->
|
||||
<dependency>
|
||||
<groupId>dev.lions.unionflow</groupId>
|
||||
<artifactId>unionflow-server-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Quarkus Core -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-jackson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Base de données PostgreSQL -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-orm-panache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jdbc-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Sécurité JWT -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-jwt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Configuration et santé -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-config-yaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-health</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- OpenAPI/Swagger -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-openapi</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Validation -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Tests -->
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
<goal>generate-code</goal>
|
||||
<goal>generate-code-tests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>native</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>native-image</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -0,0 +1,35 @@
|
||||
package dev.lions.unionflow.server;
|
||||
|
||||
import io.quarkus.runtime.Quarkus;
|
||||
import io.quarkus.runtime.QuarkusApplication;
|
||||
import io.quarkus.runtime.annotations.QuarkusMain;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
/**
|
||||
* Application principale UnionFlow Server
|
||||
*
|
||||
* @author Lions Dev Team
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@QuarkusMain
|
||||
@ApplicationScoped
|
||||
public class UnionFlowServerApplication implements QuarkusApplication {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(UnionFlowServerApplication.class);
|
||||
|
||||
public static void main(String... args) {
|
||||
Quarkus.run(UnionFlowServerApplication.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int run(String... args) throws Exception {
|
||||
LOG.info("🚀 UnionFlow Server démarré avec succès!");
|
||||
LOG.info("📊 API disponible sur http://localhost:8080");
|
||||
LOG.info("📖 Documentation OpenAPI sur http://localhost:8080/q/swagger-ui");
|
||||
LOG.info("💚 Health check sur http://localhost:8080/health");
|
||||
|
||||
Quarkus.waitForExit();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package dev.lions.unionflow.server.resource;
|
||||
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.eclipse.microprofile.openapi.annotations.Operation;
|
||||
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Resource de santé pour UnionFlow Server
|
||||
*/
|
||||
@Path("/api/status")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@ApplicationScoped
|
||||
@Tag(name = "Status", description = "API de statut du serveur")
|
||||
public class HealthResource {
|
||||
|
||||
@GET
|
||||
@Operation(summary = "Vérifier le statut du serveur")
|
||||
public Response getStatus() {
|
||||
return Response.ok(Map.of(
|
||||
"status", "UP",
|
||||
"service", "UnionFlow Server",
|
||||
"version", "1.0.0",
|
||||
"timestamp", LocalDateTime.now().toString(),
|
||||
"message", "Serveur opérationnel"
|
||||
)).build();
|
||||
}
|
||||
}
|
||||
127
unionflow-server-impl-quarkus/src/main/resources/application.yml
Normal file
127
unionflow-server-impl-quarkus/src/main/resources/application.yml
Normal file
@@ -0,0 +1,127 @@
|
||||
# Configuration UnionFlow Server
|
||||
quarkus:
|
||||
application:
|
||||
name: unionflow-server
|
||||
version: 1.0.0
|
||||
|
||||
# Configuration HTTP
|
||||
http:
|
||||
port: 8080
|
||||
host: 0.0.0.0
|
||||
cors:
|
||||
~: true
|
||||
origins: "*"
|
||||
methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||||
headers: "Content-Type,Authorization"
|
||||
|
||||
# Configuration Base de données PostgreSQL
|
||||
datasource:
|
||||
db-kind: postgresql
|
||||
username: ${DB_USERNAME:unionflow}
|
||||
password: ${DB_PASSWORD:unionflow123}
|
||||
jdbc:
|
||||
url: ${DB_URL:jdbc:postgresql://localhost:5432/unionflow}
|
||||
min-size: 2
|
||||
max-size: 10
|
||||
|
||||
# Configuration Hibernate
|
||||
hibernate-orm:
|
||||
database:
|
||||
generation: update
|
||||
log:
|
||||
sql: false
|
||||
jdbc:
|
||||
timezone: UTC
|
||||
packages: dev.lions.unionflow.server.entity
|
||||
|
||||
# Configuration Flyway pour migrations
|
||||
flyway:
|
||||
migrate-at-start: true
|
||||
baseline-on-migrate: true
|
||||
baseline-version: 1.0.0
|
||||
|
||||
# Configuration Sécurité JWT
|
||||
smallrye-jwt:
|
||||
enabled: true
|
||||
|
||||
# Configuration OpenAPI
|
||||
smallrye-openapi:
|
||||
info-title: UnionFlow Server API
|
||||
info-version: 1.0.0
|
||||
info-description: API REST pour la gestion d'union
|
||||
servers: http://localhost:8080
|
||||
|
||||
# Configuration santé
|
||||
smallrye-health:
|
||||
root-path: /health
|
||||
|
||||
# Configuration JWT
|
||||
mp:
|
||||
jwt:
|
||||
verify:
|
||||
issuer: unionflow-api
|
||||
publickey:
|
||||
algorithm: RS256
|
||||
|
||||
# Configuration logging
|
||||
quarkus:
|
||||
log:
|
||||
console:
|
||||
enable: true
|
||||
level: INFO
|
||||
format: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{2.}] (%t) %s%e%n"
|
||||
category:
|
||||
"dev.lions.unionflow": INFO
|
||||
"org.hibernate": WARN
|
||||
"io.quarkus": INFO
|
||||
|
||||
---
|
||||
# Profil de développement
|
||||
"%dev":
|
||||
quarkus:
|
||||
datasource:
|
||||
username: unionflow_dev
|
||||
password: dev123
|
||||
jdbc:
|
||||
url: jdbc:postgresql://localhost:5432/unionflow_dev
|
||||
hibernate-orm:
|
||||
database:
|
||||
generation: drop-and-create
|
||||
log:
|
||||
sql: true
|
||||
log:
|
||||
category:
|
||||
"dev.lions.unionflow": DEBUG
|
||||
"org.hibernate.SQL": DEBUG
|
||||
|
||||
---
|
||||
# Profil de test
|
||||
"%test":
|
||||
quarkus:
|
||||
datasource:
|
||||
db-kind: h2
|
||||
username: sa
|
||||
password: ""
|
||||
jdbc:
|
||||
url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
|
||||
hibernate-orm:
|
||||
database:
|
||||
generation: drop-and-create
|
||||
flyway:
|
||||
migrate-at-start: false
|
||||
|
||||
---
|
||||
# Profil de production
|
||||
"%prod":
|
||||
quarkus:
|
||||
hibernate-orm:
|
||||
database:
|
||||
generation: validate
|
||||
log:
|
||||
sql: false
|
||||
log:
|
||||
console:
|
||||
level: WARN
|
||||
category:
|
||||
"dev.lions.unionflow": INFO
|
||||
root: WARN
|
||||
Reference in New Issue
Block a user