Skip to content

MateuszNaKodach/HeroesOfDomainDrivenDesign.EventSourcing.DCB.Kotlin.Axon5.Spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heroes of Domain-Driven Design (Kotlin)

Shows how to use Domain-Driven Design, Event Storming, Event Modeling and Event Sourcing in Heroes of Might & Magic III domain.

👉 See also implementations in:

👉 Let's explore the Heroes of Domain-Driven Design blogpost series

  • There you will get familiar with the whole Software Development process: from knowledge crunching with domain experts, designing solution using Event Modeling, to implementation using DDD Building Blocks.

This project probably won't be a fully functional HOMM3 engine implementation because it's done for educational purposes. If you'd like to talk with me about mentioned development practices, feel free to contact on linkedin.com/in/mateusznakodach/.

I'm focused on domain modeling on the backend, but I'm going to implement UI like below in the future.

Heroes3_CreatureRecruitment_ExampleGif

🚀 How to run the project locally?

  1. Install Java (at least version 21) on your machine
  2. ./mvnw install -DskipTests
  3. docker compose up
  4. Create Axon Server Context (details below)
  5. ./mvnw spring-boot:run or ./mvnw test

Create Axon Server Context

  • Open the Axon Server UI at http://localhost:8024
  • Go to: Event Store → Contexts
  • Click "Create Context"
  • Fill out details:
    • Name: heroesofddd
    • Replication group: Create new
    • Replication group name: heroesofddd
    • Nodes: axon-server
    • Role for axon-server: `PRIMARY'
    • DCB context (beta): checked!!! — this is essential for the DCB support

If you did not create the DCB context, the command execution will fail with the following error:

org.axonframework.commandhandling.CommandExecutionException: Exception while handling command
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE

Thanks to that, you will be able to browse stored events in the Axon Server UI and see the attached tags to each of them. AxonServer_EventStore_Search.png

🧱 Modules

Modules (mostly designed using Bounded Context heuristic) are designed and documented on EventModeling below. Each slice in a module is in certain color which shows the progress:

  • green -> completed
  • yellow -> implementation in progress
  • red -> to do
  • grey -> design in progress

List of modules you can see in package com.dddheroes.heroesofddd.

heroesofddd/
├── armies
├── astrologers
├── calendar
├── creature_recruitment

Each domain-focused module follows Vertical-Slice Architecture of three possible types: write, read and automation following Event Modeling nomenclature.

👾 Creature Recruitment

EventModeling_Module_CreatureRecruitment.png

Slices: