first commit

This commit is contained in:
DahoudG
2025-08-20 21:00:35 +00:00
commit b2a23bdf89
583 changed files with 243074 additions and 0 deletions

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View 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