How medical-informatics-platform/platform-backend works
Purpose and Runtime
This repository is the Java backend for the MIP platform. It is a Spring-based HTTP service packaged as a Docker image, configured for PostgreSQL persistence, Keycloak authentication, and an external Exaflow server. Application bootstrap is src/main/java/hbp/mip/MIPApplication.java; runtime defaults and environment-variable binding are in src/main/resources/application.yml and config/application.tmpl.
API Layer
REST-facing components are organized by domain:
• Algorithms: src/main/java/hbp/mip/algorithm/AlgorithmsAPI.java
• Data models: src/main/java/hbp/mip/datamodel/DataModelAPI.java
• Experiments: src/main/java/hbp/mip/experiment/ExperimentAPI.java
• Active user context: src/main/java/hbp/mip/user/ActiveUserAPI.java
These APIs receive requests, use DTOs as boundary contracts, and delegate business work to services rather than directly managing persistence or remote calls.
Experiment Orchestration
Experiments are the central persisted execution domain. src/main/java/hbp/mip/experiment/ExperimentService.java coordinates experiment creation/retrieval and execution-oriented behavior, while src/main/java/hbp/mip/experiment/ExperimentDAO.java and src/main/java/hbp/mip/experiment/ExperimentRepository.java separate data access from service logic. Execution payloads are represented by src/main/java/hbp/mip/experiment/ExperimentExecutionDTO.java.
The principal flow is API request → experiment service → repository/DAO and, where execution is required, the configured Exaflow endpoint.
Algorithm and Data-Model Catalogs
Algorithm requests/specifications are handled through src/main/java/hbp/mip/algorithm/AlgorithmService.java, src/main/java/hbp/mip/algorithm/AlgorithmsSpecs.java, and DTOs in the same package. Data-model access is similarly isolated in src/main/java/hbp/mip/datamodel/DataModelService.java and src/main/java/hbp/mip/datamodel/DataModelDTO.java.
These components form the input-definition boundary for experiments: algorithm specifications and data-model metadata are resolved before or alongside experiment execution.
Identity and Authorization Boundary
Security configuration and authentication integration reside in src/main/java/hbp/mip/configurations/SecurityConfiguration.java, src/main/java/hbp/mip/configurations/AuthenticationEventListener.java, and src/main/java/hbp/mip/configurations/SpaRedirectAuthenticationSuccessHandler.java. Keycloak is the external identity provider; its URL, realm, client ID, and secret are supplied at deployment time.
User identity is converted into platform-level user state through src/main/java/hbp/mip/user/ActiveUserService.java, src/main/java/hbp/mip/user/UserRepository.java, and claim helpers in src/main/java/hbp/mip/utils/ClaimUtils.java. Authentication can be disabled for development.
Persistence and Schema
PostgreSQL is required in both development and container deployments. Persistence wiring is centralized in src/main/java/hbp/mip/configurations/PersistenceConfiguration.java; initial schema creation is versioned in src/main/resources/db/migration/V1__InitialSchema.sql. Repository/DAO pairs in the experiment and user domains provide the persistence boundary.
Operational Boundaries
The service is containerized by Dockerfile. Logging is configured through src/main/resources/log4j2.yml; log levels are environment-controlled. API documentation configuration is located at src/main/java/hbp/mip/configurations/OpenApiConfig.java. Cross-cutting request failures are normalized by src/main/java/hbp/mip/utils/ControllerExceptionHandler.java.
CI includes image publishing and security scanning workflows under .github/workflows/publish_images.yml, .github/workflows/sast.yml, and .github/workflows/container-scan.yml.
Main entry points: ExperimentService.java Experiment Service · MIPApplication.java MIP Application · SecurityConfiguration.java Security Configuration · application.yml Runtime Configuration
Components 22
HTTP API
- Algorithms API
src/main/java/hbp/mip/algorithm/AlgorithmsAPI.java - Data Models API
src/main/java/hbp/mip/datamodel/DataModelAPI.java - Experiments API
src/main/java/hbp/mip/experiment/ExperimentAPI.java - Active User API
src/main/java/hbp/mip/user/ActiveUserAPI.java - Exception Handler
src/main/java/hbp/mip/utils/ControllerExceptionHandler.java
Application Core
- MIP Application
src/main/java/hbp/mip/MIPApplication.java - Algorithm Service · Resolves algorithm specifications and DTOs.
src/main/java/hbp/mip/algorithm/AlgorithmService.java - Algorithm Specs
src/main/java/hbp/mip/algorithm/AlgorithmsSpecs.java - Data Model Service
src/main/java/hbp/mip/datamodel/DataModelService.java - Experiment Service · Coordinates persisted experiments and execution requests.
src/main/java/hbp/mip/experiment/ExperimentService.java - Execution DTO
src/main/java/hbp/mip/experiment/ExperimentExecutionDTO.java
Identity & Security
- Security Configuration · Authentication may be disabled for development.
src/main/java/hbp/mip/configurations/SecurityConfiguration.java - Active User Service · Converts authenticated claims into platform user state.
src/main/java/hbp/mip/user/ActiveUserService.java
Persistence
- Experiment DAO & Repository
src/main/java/hbp/mip/experiment/ExperimentDAO.java - User Repository
src/main/java/hbp/mip/user/UserRepository.java - Persistence Configuration
src/main/java/hbp/mip/configurations/PersistenceConfiguration.java - Initial Schema
src/main/resources/db/migration/V1__InitialSchema.sql
External Systems
- Keycloak
- PostgreSQL
- Exaflow Server
Operations
- Runtime Configuration · Binds environment settings for database, identity, and Exaflow.
src/main/resources/application.yml - Docker Image
Dockerfile
Connections 24
- MIP Application → Security Configuration: initializes
- MIP Application → Persistence Configuration: initializes
- MIP Application → Runtime Configuration: loads
- Algorithms API → Algorithm Service: delegates
- Data Models API → Data Model Service: delegates
- Experiments API → Experiment Service: delegates
- Active User API → Active User Service: delegates
- Algorithm Service → Algorithm Specs: resolves
- Experiment Service → Algorithm Service: resolves algorithm
- Experiment Service → Data Model Service: resolves data model
- Experiment Service → Execution DTO: builds
- Experiment Service → Experiment DAO & Repository: persists and retrieves
- Experiment Service → Exaflow Server: submits execution
- Security Configuration → Keycloak: authenticates via
- Security Configuration → Active User Service: establishes identity
- Active User Service → User Repository: loads user state
- Persistence Configuration → PostgreSQL: connects
- Experiment DAO & Repository → PostgreSQL: reads and writes
- User Repository → PostgreSQL: reads and writes
- Initial Schema → PostgreSQL: creates schema
- Runtime Configuration → Keycloak: configures
- Runtime Configuration → Exaflow Server: configures endpoint
- Docker Image → MIP Application: packages
- Exception Handler → Experiments API: normalizes failures from