# jasperfx/wolverine architecture

> Architecture diagram of the GitHub repository jasperfx/wolverine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jasperfx/wolverine
- Repository: https://github.com/jasperfx/wolverine

## Overview

##### Principal modules
- Core Wolverine Library – This is the heart of the system; it contains the mediator, message bus, pipeline orchestration, dynamic handler discovery, error handling (e.g. circuit breakers, retries, fallbacks), middleware configuration, and logging.
- Transports Layer – Multiple directories (e.g. Transports/AWS, Transports/Azure, Transports/RabbitMQ, Transports/Kafka, Transports/MQTT, Transports/Pulsar, etc.) indicate that Wolverine supports many messaging protocols and external integration endpoints. Each transport module encapsulates sender/receiver logic, endpoint configuration, and adapter patterns.
- Persistence and Durability – A large set of folders in “src/Persistence” (including modules for Marten, Postgresql, RavenDb, SqlServer, RDBMS, etc.) shows that Wolverine offers various durable message storage implementations, outbox/inbox patterns, sagas, and durability agents for reliable message processing.
- Code Generation and Configuration – Directories under “build” and “src/Wolverine/Codegen” denote that part of the system dynamically generates handler chains and optimized serialization routines.
- Testing, Samples, and Documentation – There are many “Tests” and “Samples” directories for integration tests, benchmarks, and sample applications (e.g. CQRSWithMarten, KitchenSink, etc.) along with a full documentation site in “docs”.

– Message Mediation Core: Routes incoming messages to the correct handlers through a configurable middleware pipeline. Include details like dynamic handler discovery, error-handling policies, and continuation logic.
– Messaging Endpoints: Represent how messages enter/exit the system (HTTP endpoints, local queues, etc.).
– Pipeline & Middleware: A sub-component handling retries, circuit breakers, side effects, auditing, and logging.
- Optionally, include an “API / Integration” container for sample apps and administrative endpoints (for example, the HTTP demonstration projects and Admin APIs shown under src/Http and other sample projects).
- “Developer Tools & Build” – the use of Bullseye for the build pipeline, automated tests via GitHub workflows, Docker Compose for test integration, and code snippet generation for documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Wolverine Runtime Layer
    subgraph "Wolverine Runtime"
        direction TB
        endpoints["Messaging Endpoints"]:::core
        mediator["Message Mediation Core"]:::core
        pipeline["Pipeline & Middleware"]:::middleware
    end

    %% Transports Layer
    subgraph "Transports Layer"
        direction TB
        transModule["Transports Module"]:::transport
        transportRabbit["Transport: RabbitMQ"]:::transport
        transportKafka["Transport: Kafka"]:::transport
        transportAzure["Transport: Azure Service Bus"]:::transport
        transportAWS["Transport: AWS SQS"]:::transport
        transportMQTT["Transport: MQTT"]:::transport
        transportPulsar["Transport: Pulsar"]:::transport
    end

    %% Persistence & Durability
    subgraph "Persistence & Durability"
        direction TB
        durability["Durability & Sagas"]:::persistence
        dbMarten["Database: Marten"]:::database
        dbPostgresql["Database: Postgresql"]:::database
        dbRaven["Database: RavenDb"]:::database
        dbSqlServer["Database: SQL Server"]:::database
    end

    %% API / Integration
    subgraph "API / Integration"
        direction TB
        api["Admin API / HTTP Endpoints"]:::integration
        integrationSamples["Sample Applications"]:::integration
    end

    %% Developer Tools & Build
    subgraph "Developer Tools & Build"
        direction TB
        subgraph "Build Tools"
            direction TB
            codegen["Code Generation & Config"]:::codegen
            buildPipeline["Build Pipeline"]:::build
        end
        subgraph "Quality & Docs"
            direction TB
            testingSuite["Testing Suite"]:::testing
            samples["Samples"]:::testing
            documentation["Documentation"]:::documentation
        end
    end

    %% Connections - Main Flow
    endpoints -->|"routes"| mediator
    mediator -->|"executes"| pipeline
    pipeline -->|"dispatches"| transModule
    pipeline -->|"persists"| durability
    mediator -->|"exposes"| api

    %% Transports Layer Internal
    transModule --> transportRabbit
    transModule --> transportKafka
    transModule --> transportAzure
    transModule --> transportAWS
    transModule --> transportMQTT
    transModule --> transportPulsar

    %% Persistence Layer Internal
    durability --> dbMarten
    durability --> dbPostgresql
    durability --> dbRaven
    durability --> dbSqlServer

    %% API / Integration Internal
    api -->|"invokes"| integrationSamples

    %% Integration with Developer Tools
    mediator -->|"integrates"| codegen
    buildPipeline -->|"orchestrates"| codegen
    testingSuite -->|"validates"| mediator
    documentation -->|"guides"| mediator
    samples -->|"demonstrates"| api

    %% Styles
    classDef core fill:#D1C4E9,stroke:#333,stroke-width:2px,color:#000
    classDef middleware fill:#C8E6C9,stroke:#333,stroke-width:2px,color:#000
    classDef transport fill:#BBDEFB,stroke:#333,stroke-width:2px,color:#000
    classDef persistence fill:#FFCDD2,stroke:#333,stroke-width:2px,color:#000
    classDef database fill:#FFE082,stroke:#333,stroke-width:2px,color:#000
    classDef integration fill:#F0F4C3,stroke:#333,stroke-width:2px,color:#000
    classDef codegen fill:#D7CCC8,stroke:#333,stroke-width:2px,color:#000
    classDef build fill:#B3E5FC,stroke:#333,stroke-width:2px,color:#000
    classDef testing fill:#DCEDC8,stroke:#333,stroke-width:2px,color:#000
    classDef documentation fill:#FFF9C4,stroke:#333,stroke-width:2px,color:#000

    %% Click Events
    click mediator "https://github.com/jasperfx/wolverine/tree/main/src/Wolverine"
    click transModule "https://github.com/jasperfx/wolverine/tree/main/src/Transports"
    click durability "https://github.com/jasperfx/wolverine/tree/main/src/Persistence"
    click codegen "https://github.com/jasperfx/wolverine/tree/main/src/Wolverine/Codegen"
    click buildPipeline "https://github.com/jasperfx/wolverine/tree/main/build"
    click testingSuite "https://github.com/jasperfx/wolverine/tree/main/src/Testing"
    click samples "https://github.com/jasperfx/wolverine/tree/main/src/Samples"
    click documentation "https://github.com/jasperfx/wolverine/tree/main/docs"
```
