# theo-hafsaoui/anemon architecture

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

- Interactive diagram: https://gitdiagram.com/theo-hafsaoui/anemon
- Repository: https://github.com/theo-hafsaoui/anemon

## Overview

##### External Layer (Adapters)
- Input Adapters:
- CLI Interface
- Markdown Tree Reader
- YAML Configuration Reader
- Output Adapters:
- LaTeX Writer
- PDF Compiler

##### Core Layer
- CV Generation Logic
- Port Interfaces

##### File System Integration
- CV Content (Markdown files)
- Configuration (params.yml)
- LaTeX Templates

##### Component Relationships
- CLI → Input Adapters → Core → Output Adapters → PDF Output

##### Detailed Elements
a. Input Side:
- CLI Interface (main entry point)
- Markdown Parser (reads CV content)
- YAML Parser (reads configuration)

b. Core:
- Generation Logic
- Port Interfaces
- CV Data Models

c. Output Side:
- LaTeX Template Engine
- PDF Compilation System

##### Infrastructure Layer
- GitHub Actions Workflow
- Docker Container
- File System Storage

Important Considerations:

##### Hexagonal Architecture
- Clear boundaries between layers
- Dependency direction (always pointing inward)
- Interface ports clearly

##### Multi-language Support
- How different language versions are handled
- Relationship between language-specific content and the core

##### Variant Processing
- Keyword emphasis mechanism
- How content filtering works

##### Build Process
- CI/CD pipeline flow
- Docker container boundaries

##### Both runtime and build-time relationships

Remember to maintain a balance between:
- Showing the hexagonal architecture pattern
- Illustrating the practical CV generation flow
- Depicting infrastructure components

This will provide a comprehensive view of how Anemon transforms markdown content into formatted PDFs while maintaining clean architecture principles.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input_Adapters
        CLI["CLI Interface"]:::input
        MDReader["Markdown Tree Reader"]:::input
        YAMLReader["YAML Config Reader"]:::input
    end

    subgraph Core_Domain
        GenLogic["CV Generation Logic"]:::core
        Ports["Port Interfaces"]:::core
    end

    subgraph Output_Adapters
        LaTeXWriter["LaTeX Writer"]:::output
        PDFCompiler["PDF Compiler"]:::output
    end

    subgraph File_System
        CVContent["CV Content Storage"]:::storage
        subgraph Language_Content
            EnglishCV["English CV"]:::storage
            FrenchCV["French CV"]:::storage
        end
        Templates["LaTeX Templates"]:::storage
        Config["Configuration File"]:::storage
        LaTeXOutput["LaTeX Output Directory"]:::storage
    end

    subgraph Infrastructure
        Docker["Docker Container"]:::infra
        CICD["CI/CD Workflows"]:::infra
    end

    %% Relationships
    CLI --> MDReader
    CLI --> YAMLReader
    MDReader --> GenLogic
    YAMLReader --> GenLogic
    GenLogic --> Ports
    Ports --> LaTeXWriter
    LaTeXWriter --> PDFCompiler
    PDFCompiler --> LaTeXOutput

    %% File System Connections
    CVContent --> MDReader
    EnglishCV --> MDReader
    FrenchCV --> MDReader
    Config --> YAMLReader
    Templates --> LaTeXWriter

    %% Infrastructure Connections
    Docker --> CLI
    CICD --> Docker

    %% Click Events
    click CLI "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/adapters/input/cli.go"
    click MDReader "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/adapters/input/markdown_tree_reader.go"
    click YAMLReader "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/adapters/input/yaml.go"
    click LaTeXWriter "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/adapters/output/latex_writer.go"
    click PDFCompiler "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/adapters/output/compiler.go"
    click GenLogic "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/core/generate.go"
    click Ports "https://github.com/Theo-Hafsaoui/Anemon/blob/main/internal/core/ports.go"
    click CVContent "https://github.com/Theo-Hafsaoui/Anemon/tree/main/cv/"
    click Templates "https://github.com/Theo-Hafsaoui/Anemon/blob/main/assets/latex/template/template.tex"
    click Config "https://github.com/Theo-Hafsaoui/Anemon/blob/main/params.yml"
    click CICD "https://github.com/Theo-Hafsaoui/Anemon/tree/main/.github/workflows/"
    click Docker "https://github.com/Theo-Hafsaoui/Anemon/tree/main/Dockerfile"
    click EnglishCV "https://github.com/Theo-Hafsaoui/Anemon/tree/main/cv/eng/"
    click FrenchCV "https://github.com/Theo-Hafsaoui/Anemon/tree/main/cv/fr/"
    click LaTeXOutput "https://github.com/Theo-Hafsaoui/Anemon/tree/main/assets/latex/output/"

    %% Styling
    classDef core fill:#FFE873,stroke:#333,stroke-width:2px
    classDef input fill:#90EE90,stroke:#333,stroke-width:2px
    classDef output fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef infra fill:#DEB887,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Input Adapters"]:::input
        L3["Output Adapters"]:::output
        L4["Storage"]:::storage
        L5["Infrastructure"]:::infra
    end
```
