# ludat/conferer architecture

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

- Interactive diagram: https://gitdiagram.com/ludat/conferer
- Repository: https://github.com/ludat/conferer

## Overview

##### Main Components

a) Core Configuration Engine (packages/conferer):
- Sub-components:
- Config Management (Config.hs)
- Key Management (Key.hs)
- FromConfig Type Class System (FromConfig.hs)
- Source Management (Source.hs)

- Environment Variables (Source/Env.hs)
- CLI Arguments (Source/CLIArgs.hs)
- File-based Sources:
- JSON (packages/aeson)
- YAML (packages/yaml)
- Dhall (packages/dhall)
- Properties Files (Source/PropertiesFile.hs)

- Warp Integration
- Snap Integration
- Hedis Integration
- HSpec Integration

##### Relationships and Data Flow

- Configuration flow from sources to core engine
- Core engine to integration modules
- Internal relationships between core components

##### Architectural Patterns

- Plugin Architecture (show how sources and integrations plug into core)
- Type Class Based Design (FromConfig pattern)
- Layered Architecture:
- Source Layer
- Core Processing Layer
- Integration Layer

##### Implementation Details

- Type-safe configuration
- Multiple source support
- Hierarchical key structure
- Default values
- Override capability

- Multi-platform testing
- Multiple GHC version support
- Extensive test suite

##### Technical Notes

A small technical specifications section:
**Language: Haskell**
**Build Tool: Stack**
**Testing: HSpec**
**Platforms: Windows, Linux, macOS**
**GHC Versions: 8.0.2+**

## Diagram (Mermaid)

```mermaid
%%{init: {'theme': 'neutral', 'themeVariables': { 'fontSize': '16px'}}}%%
flowchart TB
    classDef core fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef source fill:#90EE90,stroke:#333,stroke-width:2px
    classDef integration fill:#FFB366,stroke:#333,stroke-width:2px
    classDef testing fill:#E6E6FA,stroke:#333,stroke-width:2px

    subgraph SourceLayer["Source Layer"]
        EnvVars["Environment Variables"]:::source
        CLIArgs["CLI Arguments"]:::source
        JSON["JSON Source"]:::source
        YAML["YAML Source"]:::source
        Dhall["Dhall Source"]:::source
        Props["Properties Files"]:::source
        InMem["In-Memory Source"]:::source
        Null["Null Source"]:::source
        Test["Test Source"]:::source
        Namespaced["Namespaced Source"]:::source
    end

    subgraph CoreLayer["Core Processing Layer"]
        Config["Config Management"]:::core
        Key["Key Management"]:::core
        FromConfig["FromConfig Type Class"]:::core
        Source["Source Management"]:::core
    end

    subgraph IntegrationLayer["Integration Layer"]
        Warp["Warp Integration"]:::integration
        Snap["Snap Integration"]:::integration
        Hedis["Hedis Integration"]:::integration
        HSpec["HSpec Integration"]:::integration
    end

    %% Source Layer connections
    EnvVars --> Source
    CLIArgs --> Source
    JSON --> Source
    YAML --> Source
    Dhall --> Source
    Props --> Source
    InMem --> Source
    Null --> Source
    Test --> Source
    Namespaced --> Source

    %% Core Layer internal connections
    Source --> Config
    Key --> Config
    FromConfig --> Config

    %% Integration Layer connections
    Config --> Warp
    Config --> Snap
    Config --> Hedis
    Config --> HSpec

    %% Technical Specifications
    subgraph TechSpecs["Technical Specifications"]
        Lang["Language: Haskell"]
        Build["Build Tool: Stack"]
        Testing["Testing: HSpec"]
        Platform["Platforms: Windows, Linux, macOS"]
        GHC["GHC Versions: 8.0.2+"]
    end

    %% Click events for component mapping
    click Config "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Config.hs"
    click Key "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Key.hs"
    click FromConfig "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/FromConfig.hs"
    click Source "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source.hs"
    click EnvVars "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/Env.hs"
    click CLIArgs "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/CLIArgs.hs"
    click JSON "https://github.com/ludat/conferer/blob/master/packages/aeson/src/Conferer/Source/Aeson.hs"
    click YAML "https://github.com/ludat/conferer/blob/master/packages/yaml/src/Conferer/Source/Yaml.hs"
    click Dhall "https://github.com/ludat/conferer/blob/master/packages/dhall/src/Conferer/Source/Dhall.hs"
    click Props "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/PropertiesFile.hs"
    click InMem "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/InMemory.hs"
    click Null "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/Null.hs"
    click Test "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/Test.hs"
    click Namespaced "https://github.com/ludat/conferer/blob/master/packages/conferer/src/Conferer/Source/Namespaced.hs"
    click Warp "https://github.com/ludat/conferer/blob/master/packages/warp/src/Conferer/FromConfig/Warp.hs"
    click Snap "https://github.com/ludat/conferer/blob/master/packages/snap/src/Conferer/FromConfig/Snap.hs"
    click Hedis "https://github.com/ludat/conferer/blob/master/packages/hedis/src/Conferer/FromConfig/Hedis.hs"
    click HSpec "https://github.com/ludat/conferer/blob/master/packages/hspec/src/Conferer/FromConfig/Hspec.hs"
```
