Map Service OpenAPI
The REST API of the Map Service.
Provides maps in the Microservice Dungeon system.
The service follows hexagonal architecture (ports and adapters) principles, using Spring Modulith for module discipline and jMolecules for DDD annotations.
map, planet, maptemplate, game) contain the business logic and domain services. Domain services act as the ports — no explicit port interfaces are introduced.rest/ handles HTTP requests, usecases/infrastructure/ handles Kafka events.persistence/ sub-packages handle database access, outbox writers handle event publishing.The domain never depends on adapter concerns. Adapters freely depend on domain services. REST controllers and event listeners are cross-cutting — they live in top-level packages (rest/, usecases/) rather than inside aggregate packages, because their payload structure is shaped by client and integration needs, not by aggregate boundaries.
Tests are separated into three categories by source directory, allowing them to be run independently.
src/test)Pure unit tests that run without Spring or any external infrastructure. These are designed to be fast (sub-second for the full suite).
mvn testsrc/test/java*Test.javamaven-surefire-plugin (runs in the test phase)src/testIntegration)Tests that require the Spring application context to start, but do not require any external infrastructure like database or Kafka message broker. The integration tests includes Spring Modulith architecture verification and ArchUnit rule checks that need Spring’s classpath scanning.
The reason that these tests are handled separately is that they take longer to run, usually a minute or so, so that you probably don’t run them after each step of your development. On the other hand, they still can be run locally without requiring any external infrastructure, so that they are a good means of verifying the code integrity before a commit, or provide an entry point for new developers looking at the code and trying to understand it.
mvn verify (runs unit tests first, then integration tests)src/testIntegration/java*IT.javamaven-failsafe-plugin (runs in the integration-test phase)src/testIntegration/resources/application.ymlNote: As of now (2025), if you run these integration tests from within JetBrains IntelliJ, you need to provide explicit instructions to execute the byte body plugin for the Spring Modulith tags. This is due to the fact that IntelliJ does not use the standard Maven implementation, but its own native implementation, which does not read the plug-in section of the POM XML correctly. See these instructions for the configuration in IntelliJ.
src/testSystem)Tests that require the Spring application context and external infrastructure, such as a PostgreSQL database. The database is started and stopped automatically via Testcontainers, so Docker must be running on your machine.
mvn verify (runs unit tests first, then integration and system tests)src/testSystem/java*ST.javamaven-failsafe-plugin (runs in the integration-test phase)src/testSystem/resources/application.ymlNote: The same IntelliJ ByteBuddy configuration required for integration tests also applies here. See these instructions for the configuration in IntelliJ.
The application uses PostgreSQL as its database. For local development, a docker-compose.yml is
provided that starts a PostgreSQL 17 instance with matching credentials.
docker-compose up -d
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev
The dev profile (application-dev.yml) provides default connection settings that match the
Docker Compose configuration (localhost:5432, database/user/password all set to map),
so no environment variables need to be set.
In production, the main application.yml expects the connection details to be provided via
environment variables (POSTGRES_HOST, POSTGRES_PORT, POSTGRES_TABLE, POSTGRES_USER,
POSTGRES_PASS).
The REST API of the Map Service.
The events the Map Service publishes.