/package-by-component

Implementation of the Gurps role playing game implemented using "package by component'

Primary LanguageKotlinApache License 2.0Apache-2.0

Overview

This project is an implementation of the GURPS 4th Edition rules using an idea from Modular Monoliths where implementation of components live in their own package, exporting a single public interface. The reason I’ve created this project is because I’ve worked on systems that started small, became very successful and became painful to maintain as they grew. One was successfully rewritten but many failed the same exercise. What I want to understand is how to create a monolith that is easier to tease apart into microservices when the time comes. GURPS is my proxy for a product manager and is a domain I find interesting.

  • all code in a singular project, built by Maven

  • features are used to define boundaries

  • each boundary lives in its own Maven module, generating a library

  • inter-feature communication is done entirely via messaging (Event messages)

  • state change requests done via Command messages

  • each boundary has its own logical datastore (schema, tenancy, etc.)

  • leverage Spring projects, reducing the amount of code to be written

  • leverage new features of Spring 3 release, observability, etc.

  • Kotlin in production code

  • Java 17 in test code

Prerequisites

  • JDK 17 or greater

Building

  • ./mvnw -DskipTests --batch-mode --update-snapshots --errors clean package spring-boot:build-image

  • ./mvnw -DskipTests --batch-mode --update-snapshots --errors clean install

  • ./mvnw -pl gurps-online spring-boot:run

Installation

Tips and Tricks

Architectural Diagrams

docker run --pull always --interactive --tty --rm --name structurizr --publish 8080:8080 --env STRUCTURIZR_WORKSPACE_PATH=architectural-diagrams --volume $(pwd):/usr/local/structurizr structurizr/lite:latest

Guidebook

Specification By Example

The Cucumber tests are…​

Troubleshooting

  • Inbound channel adapters are used for one-way integration to bring data into the messaging application.

  • Outbound channel adapters are used for one-way integration to send data out of the messaging application.

  • Inbound gateways are used for a bidirectional integration flow, where some other system invokes the messaging application and receives a reply.

  • Outbound Gateways are used for a bidirectional integration flow, where the messaging application invokes some external service or entity and expects a result.

Contributing

License and Credits