This is the canonical source of truth for AI-assisted development on the REMSFAL Backend. Tool-specific files (
CLAUDE.md,.github/copilot-instructions.md) reference or copy this file. Edit here when architecture or conventions change — do not edit the tool-specific wrappers directly.
REMSFAL Backend is a multi-module Maven project implementing a microservices architecture using Quarkus for facility management. It works with the remsfal-frontend repository.
- remsfal-core: Core business models (
de.remsfal.core.model) and API interfaces (de.remsfal.core.api) shared across all services - remsfal-test: Shared test utilities and base classes
- remsfal-common: Shared implementations for authentication, JWT handling, and common utilities
- remsfal-platform: Primary microservice handling user auth, metadata storage, and core CRUD operations (port 8080, PostgreSQL database)
- remsfal-ticketing: Document storage and ticketing functionality (port 8081, Cassandra database)
- remsfal-notification: Email and notification services (port 8082, Kafka-based)
- Services communicate asynchronously via Kafka (topics:
user-notification,ocr.documents.*) - Each microservice has its own port, database, and configuration
- JWT tokens are shared across services using SmallRye JWT with cookie-based authentication (
remsfal_access_token) - Platform service must be running for other services to validate JWTs via JWKS endpoint at
GET /api/v1/authentication/jwks
- JWT Authentication: Platform service generates tokens, other services validate using JWKS endpoint
- Cookie-based sessions: Access/refresh token pattern using
SessionManager - Principal injection: Use
RemsfalPrincipal(implementsUserModel) for authenticated user context - Google OAuth: Integrated via
GoogleAuthenticatorfor social login - Use
@Authenticatedannotation on JAX-RS resources requiring login
# Start infrastructure (PostgreSQL, Kafka, Cassandra, MinIO, Grafana)
docker compose up -dNote: Requires newer Docker Compose version with include: directive support.
# Build all modules
./mvnw clean install
# Package the application
./mvnw package
# Start platform service in dev mode (port 8080)
./mvnw compile quarkus:dev -pl remsfal-services/remsfal-platform
# Start ticketing service in dev mode (port 8081)
./mvnw compile quarkus:dev -pl remsfal-services/remsfal-ticketing
# Start notification service in dev mode (port 8082)
./mvnw compile quarkus:dev -pl remsfal-services/remsfal-notificationDev UI available at http://localhost:{port}/q/dev/ when running in dev mode.
# Run all tests
./mvnw test
# Run tests for specific module
./mvnw test -pl remsfal-services/remsfal-platform
# Run specific test class
./mvnw test -Dtest=UserControllerTest -pl remsfal-services/remsfal-platform# Run Checkstyle
./mvnw checkstyle:checkstyleCheckstyle configuration: src/main/style/checkstyle.xml
- Core interfaces:
de.remsfal.core.api.*Endpoint- JAX-RS endpoint interfaces with OpenAPI annotations - JSON DTOs:
de.remsfal.core.json.*- Immutable DTOs using@ImmutableStyleand Jackson - Service implementations:
de.remsfal.service.boundary.*Resource- Implement core endpoint interfaces - Business logic:
de.remsfal.service.control.*Controller- Business logic layer - Data access:
de.remsfal.service.entity.dao.*Repository- Data repositories extendingAbstractRepository - JPA Entities:
de.remsfal.service.entity.dto.*Entity- All JPA entities end withEntitysuffix
When implementing a new feature:
- Define the API contract in
remsfal-core/src/main/java/de/remsfal/core/api/*Endpoint.java - Create immutable JSON DTOs in
remsfal-core/src/main/java/de/remsfal/core/json/*Json.javausing@ImmutableStyle - Implement the endpoint in
remsfal-services/remsfal-{service}/src/main/java/de/remsfal/service/boundary/*Resource.java - Add business logic in
de.remsfal.service.control/*Controller.java - Create repository methods in
de.remsfal.service.entity.dao/*Repository.java - Define JPA entities in
de.remsfal.service.entity.dto/*Entity.java
- Platform Service: PostgreSQL with Liquibase migrations in
remsfal-services/remsfal-platform/src/main/resources/META-INF/liquibase-changelog*.xml - Ticketing Service: Cassandra for document/chat storage with Liquibase migrations in
remsfal-services/remsfal-ticketing/src/main/resources/META-INF/liquibase-changelog*.xml - All JPA entities extend from base classes and must end with
Entitysuffix - JSON DTOs use
@Immutablewith@ImmutableStyleannotation and Jackson for serialization
- Platform service tests: Extend
AbstractServiceTestfor transaction management - Kafka tests: Extend
AbstractKafkaTestfor messaging-related tests - Ticketing tests: Extend
AbstractTicketingTest - Use
@QuarkusTestwith appropriate test resources (KafkaCompanionResource,CassandraTestResource) - Test data constants should be defined in
TestDataclass
Use application.properties with profile-specific overrides:
%dev.*- Development profile%test.*- Test profile- Production values (no prefix)
- JWT:
de.remsfal.auth.*,mp.jwt.* - Database: Connection pooling and timezone handling for PostgreSQL
- Kafka: Bootstrap servers on
localhost:39092for dev - Notification Service: SMTP configuration via
.envfile inremsfal-services/remsfal-notification/.env(not committed to Git)
- GitHub Actions checks code quality using SonarCloud
- Must pass Quality Gates before PR merge
- Test coverage > 80% tracked via JaCoCo
- Checkstyle violations fail the build
- Container images published to GitHub Container Registry
- Services communicate via Kafka topics, not direct HTTP calls
- JWT tokens use cookie authentication, not Authorization headers
- Platform service must be running for other services to validate JWTs
- Docker Compose requires newer versions supporting
include:directive - Notification service requires SMTP configuration in
.envfile to send emails
- OpenTelemetry integration with Grafana LGTM stack on port 3000
- Kafka UI available on port 8090
- Standard Quarkus health endpoints available
- OpenAPI specs generated in
target/openapi/for each service
This project uses a single source of truth pattern for AI instructions:
AGENT.md(this file) — tool-agnostic, the only file to editCLAUDE.md— thin wrapper; instructs Claude Code to readAGENT.md.github/copilot-instructions.md— thin wrapper; instructs GitHub Copilot to readAGENT.md
When adding support for a new AI tool (Cursor, Windsurf, Aider, etc.), create a thin wrapper that instructs the tool to read AGENT.md, then document it in this section.