# kudrykv/latex-yearly-planner architecture

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

- Interactive diagram: https://gitdiagram.com/kudrykv/latex-yearly-planner
- Repository: https://github.com/kudrykv/latex-yearly-planner

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Application Components:
- Configuration Handler (cfg/)
- Template Engine (tpls/)
- Calendar Components (app/components/cal/)
- Page Composers (app/compose/)
- LaTeX Generators (app/tex, app/texx)
- Header Components (app/components/header/)

b) External Dependencies:
- LaTeX/PDFLaTeX Engine
- Go Runtime
- Nix Package Manager (optional)

**┌─ Input Layer ─────────┐    ┌─ Processing Layer ──────┐    ┌─ Output Layer ─┐**
- YAML Configurations │ -> │ - Calendar Components    │ -> │ - PDF Planner  │
- Template Files      │    │ - Page Composers        │    └───────────────┘
- Translations       │    │ - LaTeX Generation      │
- ┘    └─────────────────────────┘

##### Component Relationships

- Data flow (→): Configuration → Components → Output
- Dependencies (⇢): Component dependencies
- Generation flow (⇒): Template processing to final PDF

##### Specific Implementation Details

a) Configuration Flow:
**YAML Configs → Config Handler → Component Configuration**

b) Template Processing:
**Template Files → Template Engine → LaTeX Generation → PDF Output**

c) Component Hierarchy:
**Calendar Components → Page Composers → Document Assembly**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        Config["Configuration Files"]
        Templates["Template Files"]
        Trans["Translation Files"]
    end

    subgraph Core
        ConfigHandler["Configuration Handler"]
        TplEngine["Template Engine"]
        MainApp["Main Application"]
    end

    subgraph Components
        Calendar["Calendar Components"]
        Headers["Header Components"]
        Composers["Page Composers"]
    end

    subgraph Generation
        TexGen["LaTeX Generators"]
        BuildSystem["Build System"]
        PDFLatex["PDFLaTeX Engine"]
    end

    subgraph Output
        PDF["PDF Planner"]
    end

    %% Input Layer Relationships
    Config --> ConfigHandler
    Templates --> TplEngine
    Trans --> MainApp

    %% Core Layer Relationships
    ConfigHandler --> MainApp
    TplEngine --> MainApp
    MainApp --> Calendar
    MainApp --> Headers
    MainApp --> Composers

    %% Component Layer Relationships
    Calendar --> Composers
    Headers --> Composers
    Composers --> TexGen

    %% Generation Layer Relationships
    TexGen --> BuildSystem
    BuildSystem --> PDFLatex
    PDFLatex --> PDF

    %% Styling
    classDef input fill:#a8d1f0
    classDef core fill:#90ee90
    classDef component fill:#ffd700
    classDef generation fill:#ffa07a
    classDef output fill:#dda0dd

    class Config,Templates,Trans input
    class ConfigHandler,TplEngine,MainApp core
    class Calendar,Headers,Composers component
    class TexGen,BuildSystem,PDFLatex generation
    class PDF output

    %% Click Events
    click ConfigHandler "https://github.com/kudrykv/latex-yearly-planner/blob/main/app/config/config.go"
    click TplEngine "https://github.com/kudrykv/latex-yearly-planner/blob/main/app/tpls/tpl.go"
    click Calendar "https://github.com/kudrykv/latex-yearly-planner/tree/main/app/components/cal"
    click Headers "https://github.com/kudrykv/latex-yearly-planner/tree/main/app/components/header"
    click Composers "https://github.com/kudrykv/latex-yearly-planner/tree/main/app/compose"
    click TexGen "https://github.com/kudrykv/latex-yearly-planner/blob/main/app/tex/texfuncs.go"
    click BuildSystem "https://github.com/kudrykv/latex-yearly-planner/blob/main/build.sh"
    click MainApp "https://github.com/kudrykv/latex-yearly-planner/blob/main/cmd/plannergen/plannergen.go"
    click Templates "https://github.com/kudrykv/latex-yearly-planner/tree/main/tpls"
    click Trans "https://github.com/kudrykv/latex-yearly-planner/tree/main/translations"
    click Config "https://github.com/kudrykv/latex-yearly-planner/tree/main/cfg"

    %% Legend
    subgraph Legend
        Input_["Input Components"]:::input
        Core_["Core Components"]:::core
        Component_["Processing Components"]:::component
        Generation_["Generation Components"]:::generation
        Output_["Output Artifacts"]:::output
    end
```
