<h1 align="center">
<a href="https://prompts.chat">
A distributed, event-driven matchmaking platform built with Spring Boot, Spring Modulith, and Kafka.
Sign in to like and favorite skills
A distributed, event-driven matchmaking platform built with Spring Boot, Spring Modulith, and Kafka.
This project implements Domain-Driven Design with four bounded contexts:
# Build the project ./gradlew build # Run the application ./gradlew bootRun # Run unit tests (fast) ./gradlew test # Run integration tests (with Testcontainers) ./gradlew integrationTest # Run all tests ./gradlew check # Clean build artifacts ./gradlew clean
Start local infrastructure (Kafka, etc.):
docker compose up -d
Run the application:
./gradlew bootRun
Access health check:
curl http://localhost:8080/actuator/health
We follow Test-Driven Development (TDD) with Spock Framework for BDD-style tests.
All tests use given-when-then narratives:
def "player with MMR 1500 should match with players between 1400-1600"() { given: "a player with MMR 1500 enters the queue" def player = new Player(mmr: 1500) when: "matchmaking runs" def matches = matchmaker.findMatches() then: "player is matched with compatible player" matches[0].players.contains(player) }
src/test/groovy - Fast, isolated tests with mocked dependenciessrc/integrationTest/groovy - Full Spring context with TestcontainersOur GitLab CI/CD pipeline follows DORA best practices with these stages:
We follow Kent Beck's TDD + Tidy First approach:
Examples:
refactor: extract matchmaking policy to separate classfeat: add MMR-based matchmakingsrc/ ├── main/ │ ├── java/ # Production code (Java) │ │ └── org/robbiemcarthur/multiplayermatchmakerservice/ │ │ ├── player/ # Player bounded context │ │ ├── matchmaking/ # Matchmaking bounded context │ │ ├── match/ # Match lifecycle bounded context │ │ └── gameevents/ # Game events bounded context │ └── resources/ │ └── application.yml # Application configuration ├── test/ │ └── groovy/ # Unit tests (Spock) └── integrationTest/ └── groovy/ # Integration tests (Spock + Testcontainers)
Main configuration:
src/main/resources/application.yml
Profile-specific configs:
application-dev.yml - Local developmentapplication-test.yml - Test environmentapplication-prod.yml - ProductionBuild Docker image:
docker build -t multiplayer-matchmaker-service .
Run container:
docker run -p 8080:8080 multiplayer-matchmaker-service
Please read CLAUDE.md for development guidelines and architectural decisions.
See GIT_WORKFLOW.md for TDD commit workflow.
[Add your license here]