# dekelund/gomate architecture

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

- Interactive diagram: https://gitdiagram.com/dekelund/gomate
- Repository: https://github.com/dekelund/gomate

## Overview

##### Main Components Identification

a) Compiler Package
- Feature Parser
- Definition Handler
- Code Generator

b) Unbrokenwing Package (Runtime/Execution)
- Test Driver
- Error Handler
- Type System

c) Internal Support Systems
- Highlighter (for pretty printing)
- Logging System

**[Feature Files] → [Gomate Core] → [Generated Test Binary] → [Test Execution]**

##### Component Relationships

a) Input Processing Flow:
- Feature files (.feature) → Compiler/Feature Parser
- Step Definition files (.go) → Compiler/Definition Handler

b) Compilation Flow:
- Parser outputs → Code Generator
- Generated Code → Go Compiler → Executable Binary

c) Execution Flow:
- Test Binary → Unbrokenwing Driver
- Driver → Test Results

##### Important Elements

- Blue: Input files and sources
- Green: Processing components
- Yellow: Generated artifacts
- Red: Error handling components
- Purple: Support systems

b) Component Types:
- Use rectangles for processing units

##### Specific Implementation Details

Key architectural elements:
- Feature file processing pipeline
- Step definition compilation process
- Test execution environment
- Logging and output formatting system

##### The support systems (logging, highlighting) as cross-cutting concerns

Key Relationships to Show:
- How the compiler package processes both feature files and step definitions
- How the unbrokenwing package provides the runtime environment
- How the logging system integrates across all components
- How the highlighter affects output presentation

Level of Detail:
- Keep main components visible at the top level
- Clear boundaries between compile-time and runtime components
- Integration points with the Go toolchain

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        FF[Feature Files]
        SD[Step Definition Files]
    end

    subgraph "Compiler Layer"
        FP["Feature Parser"]:::compiler
        DH["Definition Handler"]:::compiler
        CG["Code Generator"]:::compiler
    end

    subgraph "Runtime Layer"
        TD["Test Driver"]:::runtime
        EH["Error Handler"]:::runtime
        TS["Type System"]:::runtime
        KH["Keywords Handler"]:::runtime
    end

    subgraph "Support Systems"
        direction TB
        subgraph "Highlighter"
            direction TB
            CM["Color Management"]:::support
            DHL["Definition Highlighter"]:::support
            FHL["Feature Highlighter"]:::support
        end
        
        subgraph "Logging"
            direction TB
            LC["Core Logging"]:::support
            LF["Logging Functions"]:::support
            LS["Logging Configuration"]:::support
        end
    end

    MA["Main Application"]:::main

    %% Relationships
    FF --> FP
    SD --> DH
    FP --> CG
    DH --> CG
    CG --> MA
    MA --> TD
    TD --> EH
    TD --> TS
    TD --> KH

    %% Support System Integration
    CM --> DHL
    CM --> FHL
    LC --> LF
    LF --> LS
    DHL -.-> DH
    FHL -.-> FP
    LC -.-> MA

    %% Styling
    classDef compiler fill:#a8e6cf
    classDef runtime fill:#ffd3b6
    classDef support fill:#dcedc1
    classDef main fill:#ff8b94

    %% Click Events
    click FP "https://github.com/dekelund/gomate/blob/master/compiler/feature/parse.go"
    click DH "https://github.com/dekelund/gomate/blob/master/compiler/definition/definition.go"
    click CG "https://github.com/dekelund/gomate/blob/master/compiler/definition/snippet.go"
    click TD "https://github.com/dekelund/gomate/blob/master/unbrokenwing/driver.go"
    click EH "https://github.com/dekelund/gomate/blob/master/unbrokenwing/errors.go"
    click TS "https://github.com/dekelund/gomate/blob/master/unbrokenwing/types.go"
    click CM "https://github.com/dekelund/gomate/blob/master/internal/highlighter/colors.go"
    click DHL "https://github.com/dekelund/gomate/blob/master/internal/highlighter/definition.go"
    click FHL "https://github.com/dekelund/gomate/blob/master/internal/highlighter/feature.go"
    click LC "https://github.com/dekelund/gomate/blob/master/logging/log.go"
    click LF "https://github.com/dekelund/gomate/blob/master/logging/functions.go"
    click LS "https://github.com/dekelund/gomate/blob/master/logging/settings.go"
    click MA "https://github.com/dekelund/gomate/blob/master/gomate.go"
    click KH "https://github.com/dekelund/gomate/blob/master/unbrokenwing/keywords.go"
```
