# enqueuer-land/enqueuer architecture

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

- Interactive diagram: https://gitdiagram.com/enqueuer-land/enqueuer
- Repository: https://github.com/enqueuer-land/enqueuer

## Overview

##### Project Type and Purpose
- Enqueuer is an automated end-to-end testing platform designed to help ensure that a set of services is operating correctly.
- It supports multiple protocols (HTTP, UDP, TCP, UDS, etc.), chainable message flows, and is extensible via plugins.
- The goal is to simulate inputs (via “sensors”) and validate outputs (via “actuators”, “asserters” and “reporters”), driven by configuration details and dynamic task executions.

##### Core Components from the File Structure
- The file tree is organized into a “src” folder with many submodules. Key directories include:
- actuators (components that simulate outputs or trigger events)
- sensors (components that simulate inputs, e.g., HTTP-sensor, UDP-sensor)
- asserters (logic that validates expected outcomes)
- code-generators (for dynamic code or configuration generation)
- configurations (parsing command-line or file configurations)
- dynamic-functions (runtime extendable functions)
- events (handling messages and events across components)
- handlers (for stream or event handling)
- http-authentications (managing different authentication schemes)
- loggers (tracking runtime behavior and debug information)
- models (definitions for input, output, events, tasks, etc.)
- outputs (formatting and generating test/report outputs)
- plugins (managing extensibility and dynamic integration of third-party features)
- task-runners (parsing and executing test tasks)
- reporters (producing detailed reports based on testing outcomes)
- pools and protocols (managing and abstracting protocol-specific behavior)
- Outside “src”, directories like “conf”, “docs”, “examples”, and “misc” provide configuration samples, documentation, and extra utilities, which help illustrate usage and set up.

##### Architectural Patterns and Design Principles
- Modularity: The clear separation into “sensors,” “actuators,” “asserters,” and supporting modules enforces a modular architecture where each module has a single responsibility.
- Extensibility: The “plugins” directory and dynamic function management indicate that the system is built to be extended, supporting external modules seamlessly.
- Event-Driven Messaging: The presence of “events” and “handlers” suggests that data flows throughout the system following an event-driven or message-passing paradigm.
- Configuration and Code Generation: With dedicated modules for handling configurations and generating code, the system emphasizes flexibility in both setup and runtime behavior.

- Surrounding the core, create blocks for:
– Configuration Management (from “src/configurations”) that feeds runtime settings to the system.
– Task Runners & Parsers (from “src/task-runners” and “src/code-generators”) that interpret and manage test task definitions.
– Sensors (from “src/sensors”) that simulate input sources. These feed events into the system.
– Actuators (from “src/actuators”) that simulate outputs or responses.
– Asserters (from “src/asserters”) that validate expectations after task execution.
– Event and Message Handling (from “src/events” and “src/handlers”) to manage communication between modules.
– Protocol Management (from “src/protocols” and “src/http-authentications”) that abstracts the multi-protocol support.
– Reporting and Output generation (from “src/reporters” and “src/outputs”) to produce test results and logs.
– Plugin Manager (from “src/plugins”) that allows integration of third-party modules and additional capabilities.
– For example, configuration data flows into the task runners.
– Sensors generate events that are routed to the core, which in turn dispatches them to actuators and asserters.
– Reporters collect output from actuators, asserters, and logging modules.
- Dependencies:
– The dynamic functions and code generation modules may feed into both configuration and task runners.
– The pool and container sub-components (e.g., “src/pools”) ensure efficient management of protocol sessions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input and Configuration Layer
    C["Configuration Management"]:::config
    T["Task Runners & Parsers"]:::config
    S["Sensors"]:::sensor
    P["Protocol Management"]:::protocol

    %% Core Engine and Plugins
    E["Enqueuer Core"]:::core
    L["Plugin Manager"]:::plugin

    %% Event and Processing Layer
    H["Event & Message Handling"]:::event

    %% Output and Validation Layer
    A["Actuators"]:::output
    X["Asserters"]:::output
    R["Reporting & Output Generation"]:::output

    %% Data Flow
    C --> T
    T --> E
    S --> E
    P --> S
    L --> E
    E --> H
    H --> A
    H --> X
    P --> A
    A --> R
    X --> R

    %% Click Events for Configuration Management
    click C "https://github.com/enqueuer-land/enqueuer/blob/master/src/configurations/configuration.ts"
    click C "https://github.com/enqueuer-land/enqueuer/blob/master/src/configurations/command-line-configuration.ts"

    %% Click Events for Task Runners & Parsers
    click T "https://github.com/enqueuer-land/enqueuer/blob/master/src/task-runners/task-runner.ts"
    click T "https://github.com/enqueuer-land/enqueuer/blob/master/src/task-runners/task-parser.ts"

    %% Click Events for Sensors
    click S "https://github.com/enqueuer-land/enqueuer/blob/master/src/sensors/http-sensor.ts"
    click S "https://github.com/enqueuer-land/enqueuer/blob/master/src/sensors/udp-sensor.ts"

    %% Click Events for Protocol Management
    click P "https://github.com/enqueuer-land/enqueuer/blob/master/src/protocols/protocol.ts"
    click P "https://github.com/enqueuer-land/enqueuer/blob/master/src/http-authentications/http-basic-authentication.ts"

    %% Click Events for Enqueuer Core
    click E "https://github.com/enqueuer-land/enqueuer/blob/master/src/index.ts"
    click E "https://github.com/enqueuer-land/enqueuer/blob/master/src/enqueuer-runner.ts"

    %% Click Events for Plugin Manager
    click L "https://github.com/enqueuer-land/enqueuer/blob/master/src/plugins/asserter-manager.ts"
    click L "https://github.com/enqueuer-land/enqueuer/blob/master/src/plugins/protocol-manager.ts"

    %% Click Events for Event & Message Handling
    click H "https://github.com/enqueuer-land/enqueuer/blob/master/src/events/event-executor.ts"
    click H "https://github.com/enqueuer-land/enqueuer/blob/master/src/handlers/handler-listener.ts"

    %% Click Events for Actuators
    click A "https://github.com/enqueuer-land/enqueuer/blob/master/src/actuators/http-actuator.ts"
    click A "https://github.com/enqueuer-land/enqueuer/blob/master/src/actuators/udp-actuator.ts"

    %% Click Events for Asserters
    click X "https://github.com/enqueuer-land/enqueuer/blob/master/src/asserters/expect-to-be-equal-to-asserter.ts"

    %% Click Events for Reporting & Output Generation
    click R "https://github.com/enqueuer-land/enqueuer/blob/master/src/reporters/task-report-generator.ts"
    click R "https://github.com/enqueuer-land/enqueuer/blob/master/src/outputs/summary-test-output.ts"

    %% Class Definitions
    classDef config fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef core fill:#A9DFBF,stroke:#1D8348,stroke-width:2px;
    classDef sensor fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef event fill:#D7BDE2,stroke:#7D3C98,stroke-width:2px;
    classDef output fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef protocol fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef plugin fill:#D1F2EB,stroke:#117864,stroke-width:2px;
```
