Skip to content

Starter for domain-layer microservices — DDD, CQRS, SAGA orchestration, reactive event-driven architecture

License

Notifications You must be signed in to change notification settings

fireflyframework/fireflyframework-starter-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

211 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Firefly Framework - Domain Starter

CI License Java Spring Boot

Opinionated starter for domain-layer microservices — DDD patterns, CQRS, SAGA orchestration, and reactive event-driven architecture.


Table of Contents

Overview

Firefly Framework Domain Starter is an opinionated Spring Boot starter for building domain-layer microservices following Domain-Driven Design (DDD) principles. This starter brings together the essential capabilities needed for implementing business logic in a reactive, event-driven architecture.

Unlike a traditional library, this starter is designed to bootstrap domain-tier microservices with pre-configured integrations for:

  • Domain-Driven Design (DDD): Aggregate roots, value objects, domain events, and repository patterns
  • CQRS: Command/query separation with handler auto-discovery and execution context propagation
  • SAGA Orchestration: Distributed transactions via the transactional engine with step event publishing
  • Event-Driven Architecture: Reactive domain event publishing through Kafka, RabbitMQ, or other adapters
  • Service Communication: Resilient inter-service communication with circuit breakers and retries

This starter automatically wires up JSON structured logging, step event bridges for SAGA integration, and observability infrastructure. It serves as the architectural foundation for domain microservices that implement core business logic while participating in distributed workflows and event streams.

When to use this starter: Building domain-layer microservices that encapsulate business rules, coordinate distributed transactions, and emit domain events to drive downstream processing.

Features

  • DDD Building Blocks: Domain entities, aggregates, value objects, and repository abstractions
  • CQRS Integration: Automatic command/query bus wiring with fireflyframework-cqrs
  • SAGA Support: Step event publisher bridge for distributed transaction orchestration
  • Event-Driven Architecture: Seamless integration with fireflyframework-eda for domain event publishing
  • Service Client Framework: Reactive inter-service communication with resilience patterns
  • Observability: JSON structured logging, metrics, and distributed tracing auto-configuration
  • Reactive-First: Built on Project Reactor for non-blocking I/O and backpressure handling
  • Clean Architecture: Enforces separation between domain logic and infrastructure concerns

Requirements

  • Java 21+
  • Spring Boot 3.x
  • Maven 3.9+

Installation

<dependency>
    <groupId>org.fireflyframework</groupId>
    <artifactId>fireflyframework-starter-domain</artifactId>
    <version>26.02.06</version>
</dependency>

This starter transitively includes:

  • fireflyframework-cqrs for command/query handling
  • fireflyframework-eda for event publishing
  • fireflyframework-client for service communication
  • lib-transactional-engine integration for SAGA orchestration
  • fireflyframework-observability for metrics and tracing

Quick Start

@Service
public class AccountDomainService {

    private final StepEventPublisherBridge stepEvents;

    public AccountDomainService(StepEventPublisherBridge stepEvents) {
        this.stepEvents = stepEvents;
    }

    public Mono<Account> createAccount(CreateAccountRequest request) {
        return validateRequest(request)
            .flatMap(this::persistAccount)
            .flatMap(account -> stepEvents.publish("account-created", account)
                .thenReturn(account));
    }
}

Configuration

firefly:
  domain:
    json-logging:
      enabled: true
    step-events:
      enabled: true

Documentation

No additional documentation available for this project.

Contributing

Contributions are welcome. Please read the CONTRIBUTING.md guide for details on our code of conduct, development process, and how to submit pull requests.

License

Copyright 2024-2026 Firefly Software Solutions Inc.

Licensed under the Apache License, Version 2.0. See LICENSE for details.

About

Starter for domain-layer microservices — DDD, CQRS, SAGA orchestration, reactive event-driven architecture

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages