This repository contains an experimental Java/Spring based client/server Klondike Solitaire game written in the Domain Driven Design style discussed in Implementing Domain Driven Design. The Solitaire Domain was chosen arbitrarily but actually ended up being a decent domain to play in.
This codebase was written as a way to explore various Domain Driven Design concepts and techniques like using domain events to implement eventual consistency boundaries between aggregate roots. The game is fully playable but the code is not intended to be complete. I have not taken the time to fully test or account for robust messaging.
I plan to continue building out the sample to include integration with a separate remote bounded context.
Note
|
UI/JavaScript code was written several years ago and is in need of major revamping. |
Included in this repository is a JavaScript/HTML5 based UI packaged into an executable JAR. Its design is not very important from a DDD perspective, it was only built in order to be able to play the game. The JSON data contracts used to communicate with the server are worth exploring from a DDD Published Language perspective. It attempts to leverage the Polymer library, but it was my first time experimenting with it and I may have misused it a bit. As a result the UI currently only works in Chrome.
The game leverages Spring Boot and provides a docker-compose
configuration to kickstart. The game leverages PostgreSQL and RabbitMQ alongside the backend.
patience> mvn install ... [INFO] patience-parent .................................... SUCCESS [ 0.211 s] [INFO] common ............................................. SUCCESS [ 2.146 s] [INFO] integration-test ................................... SUCCESS [ 2.229 s] [INFO] klondike ........................................... SUCCESS [ 2.624 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
patience> docker-compose up -d
Once the containers start, the UI application will be accessible at http://localhost:8000/
If you have ChromeDriver installed you should be able kick off the following integration test and watch an automated play through.
patience> mvn failsafe:integration-test -Dtest=KlondikeSpec