# huahill/jfoundry architecture

> Architecture diagram of the GitHub repository huahill/jfoundry, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/huahill/jfoundry
- Repository: https://github.com/huahill/jfoundry

## Overview

JFoundry is a composable Java DDD framework, not a full application framework. Its principal use is to model aggregates and application boundaries, run use cases with transaction and event capabilities, persist aggregates, and optionally deliver messages reliably. Runtime-neutral contracts sit inward of persistence and runtime adapters; Spring, Quarkus, and Helidon assemble selected capabilities. The graph retains the README’s architecture, web, messaging, reliable-messaging, and runtime branches. Several subsystem links are documented capabilities rather than inspected calls; source excerpts were limited, so those links cite the README.

Main entry points: [`jfoundry-runtime`](https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime) (Runtime assembly), [`jfoundry-core/jfoundry-application/jfoundry-application-core/src/main/java/org/jfoundry/application/ApplicationService.java`](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-application-core/src/main/java/org/jfoundry/application/ApplicationService.java) (Application boundary), [`jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence`](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence) (Persistence lifecycle), [`jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java`](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java) (Outbox dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_domain_arch["Domain and architecture"]
  node_domain_model["Domain model"]
  node_aggregate_repository["Repository contract"]
  node_architecture_styles["Architecture semantics"]
  node_cqrs["CQRS contracts"]
end

subgraph group_application["Application capabilities"]
  node_application_service["Application boundary"]
  node_transactions["Transaction SPI"]
  node_domain_events["Domain event dispatch"]
  node_distributed_locks["Distributed locks"]
  node_messaging_spi["Message transport SPI"]
end

subgraph group_infrastructure["Infrastructure adapters"]
  node_persistence_spi["Persistence lifecycle"]
  node_jpa_persistence["JPA adapter"]
  node_mybatis_persistence["MyBatis adapter"]
  node_web_capabilities["Web errors and logging"]
  node_message_stores[("Outbox and inbox stores")]
end

subgraph group_reliable["Reliable messaging"]
  node_outbox["Outbox dispatch"]
  node_inbox["Inbox idempotency"]
  node_event_externalization["Event externalization"]
end

subgraph group_runtime["Runtime integrations"]
  node_runtime_assembly["Runtime assembly"]
  node_spring_web["Spring web adapter"]
  node_helidon_runtime["Helidon integration"]
  node_quarkus_runtime["Quarkus integration"]
  node_spring_runtime["Spring integration"]
end

node_developer(("Application developer"))
node_external_transport(("Message broker"))

node_developer -->|"models"| node_domain_model
node_developer -->|"defines use cases"| node_application_service
node_domain_model -->|"uses contract"| node_aggregate_repository
node_application_service -->|"sets boundaries"| node_transactions
node_application_service -->|"orchestrates events"| node_domain_events
node_application_service -->|"persists aggregates"| node_aggregate_repository
node_application_service -.->|"may dispatch"| node_cqrs
node_developer -->|"marks boundaries"| node_architecture_styles
node_aggregate_repository -->|"implemented by"| node_persistence_spi
node_persistence_spi -->|"implemented by"| node_jpa_persistence
node_persistence_spi -->|"implemented by"| node_mybatis_persistence
node_application_service -.->|"may acquire"| node_distributed_locks
node_domain_events -->|"composed with"| node_event_externalization
node_event_externalization -.->|"records events"| node_outbox
node_outbox -->|"claims and updates"| node_message_stores
node_outbox -->|"sends messages"| node_messaging_spi
node_messaging_spi -->|"delivers messages"| node_external_transport
node_inbox -.->|"stores claims"| node_message_stores
node_runtime_assembly -->|"assembles"| node_transactions
node_runtime_assembly -->|"assembles"| node_domain_events
node_runtime_assembly -->|"binds adapters"| node_persistence_spi
node_runtime_assembly -->|"assembles optionally"| node_outbox
node_spring_runtime -->|"configures"| node_runtime_assembly
node_quarkus_runtime -->|"configures"| node_runtime_assembly
node_helidon_runtime -->|"configures"| node_runtime_assembly
node_spring_web -->|"maps errors"| node_web_capabilities

click node_domain_model "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain"
click node_aggregate_repository "https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain/repository/AggregateRepository.java"
click node_architecture_styles "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-architecture"
click node_cqrs "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-architecture/jfoundry-cqrs/src/main/java/org/jfoundry/architecture/cqrs"
click node_application_service "https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-application-core/src/main/java/org/jfoundry/application/ApplicationService.java"
click node_transactions "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-transaction-core/src/main/java/org/jfoundry/application/transaction"
click node_domain_events "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-domain-event-core/src/main/java/org/jfoundry/application/event"
click node_distributed_locks "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-lock-core/src/main/java/org/jfoundry/application/lock"
click node_persistence_spi "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence"
click node_jpa_persistence "https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-jpa/src/main/java/org/jfoundry/infrastructure/persistence/jpa/JpaAggregateRepository.java"
click node_mybatis_persistence "https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-mybatis-plus/src/main/java/org/jfoundry/infrastructure/persistence/mybatis/MybatisPlusAggregateRepository.java"
click node_web_capabilities "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure/jfoundry-web/src/main/java/org/jfoundry/http"
click node_messaging_spi "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-messaging-core/src/main/java/org/jfoundry/application/messaging"
click node_outbox "https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java"
click node_inbox "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-inbox-core/src/main/java/org/jfoundry/application/inbox"
click node_event_externalization "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-domain-event-outbox-core/src/main/java/org/jfoundry/application/event/externalization"
click node_message_stores "https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure"
click node_runtime_assembly "https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime"
click node_spring_web "https://github.com/huahill/jfoundry/blob/main/jfoundry-runtime/jfoundry-spring/runtime/jfoundry-webmvc-spring/src/main/java/org/jfoundry/webmvc/spring/ProblemDetailsExceptionHandler.java"
click node_helidon_runtime "https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-helidon"
click node_quarkus_runtime "https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-quarkus"
click node_spring_runtime "https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-spring"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_domain_model,node_aggregate_repository,node_architecture_styles,node_cqrs toneBlue
class node_application_service,node_transactions,node_domain_events,node_distributed_locks,node_messaging_spi toneAmber
class node_persistence_spi,node_jpa_persistence,node_mybatis_persistence,node_web_capabilities,node_message_stores toneMint
class node_outbox,node_inbox,node_event_externalization toneRose
class node_runtime_assembly,node_spring_web,node_helidon_runtime,node_quarkus_runtime,node_spring_runtime,node_developer,node_external_transport toneIndigo
```

## Components

### Domain and architecture

- [Domain model](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain): `jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain`
- [Repository contract](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain/repository/AggregateRepository.java): `jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain/repository/AggregateRepository.java`
- [Architecture semantics](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-architecture): `jfoundry-core/jfoundry-architecture`
- [CQRS contracts](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-architecture/jfoundry-cqrs/src/main/java/org/jfoundry/architecture/cqrs): `jfoundry-core/jfoundry-architecture/jfoundry-cqrs/src/main/java/org/jfoundry/architecture/cqrs`

### Application capabilities

- [Application boundary](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-application-core/src/main/java/org/jfoundry/application/ApplicationService.java): `jfoundry-core/jfoundry-application/jfoundry-application-core/src/main/java/org/jfoundry/application/ApplicationService.java`
- [Transaction SPI](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-transaction-core/src/main/java/org/jfoundry/application/transaction): `jfoundry-core/jfoundry-application/jfoundry-transaction-core/src/main/java/org/jfoundry/application/transaction`
- [Domain event dispatch](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-domain-event-core/src/main/java/org/jfoundry/application/event): `jfoundry-core/jfoundry-application/jfoundry-domain-event-core/src/main/java/org/jfoundry/application/event`
- [Distributed locks](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-lock-core/src/main/java/org/jfoundry/application/lock): `jfoundry-core/jfoundry-application/jfoundry-lock-core/src/main/java/org/jfoundry/application/lock`
- [Message transport SPI](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-messaging-core/src/main/java/org/jfoundry/application/messaging): `jfoundry-core/jfoundry-application/jfoundry-messaging-core/src/main/java/org/jfoundry/application/messaging`

### Infrastructure adapters

- [Persistence lifecycle](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence): `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence`
- [JPA adapter](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-jpa/src/main/java/org/jfoundry/infrastructure/persistence/jpa/JpaAggregateRepository.java): `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-jpa/src/main/java/org/jfoundry/infrastructure/persistence/jpa/JpaAggregateRepository.java`
- [MyBatis adapter](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-mybatis-plus/src/main/java/org/jfoundry/infrastructure/persistence/mybatis/MybatisPlusAggregateRepository.java): `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-mybatis-plus/src/main/java/org/jfoundry/infrastructure/persistence/mybatis/MybatisPlusAggregateRepository.java`
- [Web errors and logging](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure/jfoundry-web/src/main/java/org/jfoundry/http): `jfoundry-core/jfoundry-infrastructure/jfoundry-web/src/main/java/org/jfoundry/http`
- [Outbox and inbox stores](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-infrastructure): `jfoundry-core/jfoundry-infrastructure`

### Reliable messaging

- [Outbox dispatch](https://github.com/huahill/jfoundry/blob/main/jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java): `jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java`
- [Inbox idempotency](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-inbox-core/src/main/java/org/jfoundry/application/inbox): `jfoundry-core/jfoundry-application/jfoundry-inbox-core/src/main/java/org/jfoundry/application/inbox`
- [Event externalization](https://github.com/huahill/jfoundry/tree/main/jfoundry-core/jfoundry-application/jfoundry-domain-event-outbox-core/src/main/java/org/jfoundry/application/event/externalization): `jfoundry-core/jfoundry-application/jfoundry-domain-event-outbox-core/src/main/java/org/jfoundry/application/event/externalization`

### Runtime integrations

- [Runtime assembly](https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime): `jfoundry-runtime`
- [Spring web adapter](https://github.com/huahill/jfoundry/blob/main/jfoundry-runtime/jfoundry-spring/runtime/jfoundry-webmvc-spring/src/main/java/org/jfoundry/webmvc/spring/ProblemDetailsExceptionHandler.java): `jfoundry-runtime/jfoundry-spring/runtime/jfoundry-webmvc-spring/src/main/java/org/jfoundry/webmvc/spring/ProblemDetailsExceptionHandler.java`
- [Helidon integration](https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-helidon): `jfoundry-runtime/jfoundry-helidon`
- [Quarkus integration](https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-quarkus): `jfoundry-runtime/jfoundry-quarkus`
- [Spring integration](https://github.com/huahill/jfoundry/tree/main/jfoundry-runtime/jfoundry-spring): `jfoundry-runtime/jfoundry-spring`

### Other components

- **Application developer**
- **Message broker**

## Connections

- Application developer → Domain model: models (evidence: `README.md`)
- Application developer → Application boundary: defines use cases (evidence: `README.md`)
- Domain model → Repository contract: uses contract (evidence: `jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain/repository/AggregateRepository.java`)
- Application boundary → Transaction SPI: sets boundaries (evidence: `README.md`)
- Application boundary → Domain event dispatch: orchestrates events (evidence: `README.md`)
- Application boundary → Repository contract: persists aggregates (evidence: `jfoundry-core/jfoundry-domain/src/main/java/org/jfoundry/domain/repository/AggregateRepository.java`)
- Application boundary → CQRS contracts: may dispatch (evidence: `README.md`)
- Application developer → Architecture semantics: marks boundaries (evidence: `README.md`)
- Repository contract → Persistence lifecycle: implemented by (evidence: `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-core/src/main/java/org/jfoundry/infrastructure/persistence/AbstractAggregateRepository.java`)
- Persistence lifecycle → JPA adapter: implemented by (evidence: `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-jpa/src/main/java/org/jfoundry/infrastructure/persistence/jpa/JpaAggregateRepository.java`)
- Persistence lifecycle → MyBatis adapter: implemented by (evidence: `jfoundry-core/jfoundry-infrastructure/jfoundry-persistence-mybatis-plus/src/main/java/org/jfoundry/infrastructure/persistence/mybatis/MybatisPlusAggregateRepository.java`)
- Application boundary → Distributed locks: may acquire (evidence: `README.md`)
- Domain event dispatch → Event externalization: composed with (evidence: `README.md`)
- Event externalization → Outbox dispatch: records events (evidence: `README.md`)
- Outbox dispatch → Outbox and inbox stores: claims and updates (evidence: `jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java`)
- Outbox dispatch → Message transport SPI: sends messages (evidence: `jfoundry-core/jfoundry-application/jfoundry-outbox-core/src/main/java/org/jfoundry/application/outbox/DefaultOutboxDispatchService.java`)
- Message transport SPI → Message broker: delivers messages (evidence: `README.md`)
- Inbox idempotency → Outbox and inbox stores: stores claims (evidence: `README.md`)
- Runtime assembly → Transaction SPI: assembles (evidence: `README.md`)
- Runtime assembly → Domain event dispatch: assembles (evidence: `README.md`)
- Runtime assembly → Persistence lifecycle: binds adapters (evidence: `README.md`)
- Runtime assembly → Outbox dispatch: assembles optionally (evidence: `README.md`)
- Spring integration → Runtime assembly: configures (evidence: `README.md`)
- Quarkus integration → Runtime assembly: configures (evidence: `README.md`)
- Helidon integration → Runtime assembly: configures (evidence: `README.md`)
- Spring web adapter → Web errors and logging: maps errors (evidence: `jfoundry-runtime/jfoundry-spring/runtime/jfoundry-webmvc-spring/src/main/java/org/jfoundry/webmvc/spring/ProblemDetailsExceptionHandler.java`)
