# hobadee/emlparser architecture

> Architecture diagram of the GitHub repository hobadee/emlparser, 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/hobadee/emlparser
- Repository: https://github.com/hobadee/emlparser

## Overview

##### Main Components

a. Core Components:
- Header Field Parser System
- Header Factory
- IMF (Internet Message Format) Processor
- Type System (for typed header fields)

b. Module Structure:
- Public Interface Layer
- Private Implementation Layer
- Class Definitions
- Enumeration Types

##### Architectural Pattern Representation
The project follows a factory pattern and appears to be moving towards a plugin-based architecture. Show this by:
- Creating a central "Header Field Factory" component
- Including a "Plugin Registry" component (planned feature)
- Showing extension points for future header plugins

##### Component Relationships

1. Input Layer (EML File) → IMF Processor
2. IMF Processor → Header Factory
3. Header Factory → Specific Header Field Parsers
4. Header Field Parsers → Typed Header Fields
5. All components → Public Interface

##### Detailed Component Breakdown

Create sections for:
a. Input Processing:
- EML File Input
- Raw Message Parsing

b. Header Processing:
- Header Field Factory
- Individual Header Field Parsers
- Typed Header Field System

c. Public Interface:
- Exposed Methods
- Operation Handlers

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Core Processing]:::core
        L2[Public Interface]:::public
        L3[Factory Component]:::factory
        L4[Future Component]:::future
        L5[Type System]:::type
        L6[Test Component]:::test
    end

    subgraph "Input Layer"
        EML[EML File Input]
        PI["Public Interface"]:::public
        click PI "https://github.com/Hobadee/EMLParser/tree/main/Public/"
    end

    subgraph "Processing Layer"
        IMFP["IMF Processor"]:::core
        click IMFP "https://github.com/Hobadee/EMLParser/blob/main/Classes/03-Imf.ps1"
        
        HF["Header Field Factory"]:::factory
        click HF "https://github.com/Hobadee/EMLParser/blob/main/Classes/04-HeaderFieldFactory.ps1"
        
        HPS["Header Processing System"]:::core
        click HPS "https://github.com/Hobadee/EMLParser/blob/main/Classes/02-Headers.ps1"
    end

    subgraph "Implementation Layer"
        HFPS["Header Field Parser System"]:::core
        click HFPS "https://github.com/Hobadee/EMLParser/blob/main/Classes/01-HeaderField.ps1"
        
        TS["Type System"]:::type
        click TS "https://github.com/Hobadee/EMLParser/blob/main/Classes/01-TypedHeaderFields.ps1"
        
        PL["Private Implementation Layer"]:::core
        click PL "https://github.com/Hobadee/EMLParser/tree/main/Private/"
    end

    subgraph "Future Components"
        PR["Plugin Registry"]:::future
        EP["Extension Points"]:::future
    end

    subgraph "Testing Framework"
        TIP["Test Integration Points"]:::test
        click TIP "https://github.com/Hobadee/EMLParser/tree/main/Tests/"
        
        PRT["Private Tests"]:::test
        click PRT "https://github.com/Hobadee/EMLParser/tree/main/Tests/Private/"
        
        PUT["Public Tests"]:::test
        click PUT "https://github.com/Hobadee/EMLParser/tree/main/Tests/Public/"
    end

    subgraph "Module Definition"
        MD["Module Definition"]:::core
        click MD "https://github.com/Hobadee/EMLParser/blob/main/Imf.psd1"
    end

    EML --> IMFP
    IMFP --> HF
    HF --> HFPS
    HFPS --> TS
    HPS --> HFPS
    PI --> IMFP
    PL --> HFPS
    HF -.-> PR
    PR -.-> EP
    HFPS --> TIP
    PI --> TIP

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef public fill:#2ecc71,stroke:#27ae60,color:white
    classDef factory fill:#f1c40f,stroke:#f39c12,color:black
    classDef future fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef type fill:#9b59b6,stroke:#8e44ad,color:white
    classDef test fill:#e74c3c,stroke:#c0392b,color:white
```
