# jasiek/dmr-codeplug-gen architecture

> Architecture diagram of the GitHub repository jasiek/dmr-codeplug-gen, 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/jasiek/dmr-codeplug-gen
- Repository: https://github.com/jasiek/dmr-codeplug-gen

## Overview

##### Flow Representation

- External data sources → Datasource Handlers
- Datasource Handlers → Cache
- Cache → Generators
- Generators → Aggregators
- Aggregators → Writers
- Writers → Final Codeplug

##### Component Details

For each major component, include:
- Name
- Primary function
- Key dependencies
- Data format handled

##### Technical Elements

Integration points with:
- qdmr (external dependency)
- Python 3.11 runtime
- Poetry dependency management

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Title
    title[DMR Codeplug Generator - System Architecture]
    
    %% Input Layer
    subgraph InputLayer[Input Layer]
        direction TB
        BM["Brandmeister API"]:::external
        PZ["Przemienniki DB"]:::external
        BC["Base Config"]:::config
        UI["User Inputs<br/>(CALLSIGN, DMRID)"]:::config
    end

    %% Processing Layer
    subgraph ProcessingLayer[Processing Layer]
        direction TB
        
        subgraph DataHandlers[Data Source Handlers]
            BMH["Brandmeister<br/>Handler"]:::handler
            PZH["Przemienniki<br/>Handler"]:::handler
            Cache["Cache System"]:::cache
        end

        subgraph Generators[Generators]
            direction TB
            ACG["Analog Channel<br/>Generator"]:::generator
            DCG["Digital Channel<br/>Generator"]:::generator
            CG["Contacts<br/>Generator"]:::generator
            ZG["Zones<br/>Generator"]:::generator
            AG["APRS<br/>Generator"]:::generator
            RG["Roaming<br/>Generator"]:::generator
            GLG["Group Lists<br/>Generator"]:::generator
        end

        Models["Models"]:::support
        Recipe["Recipe System"]:::support
        Agg["Aggregators"]:::processor
    end

    %% Output Layer
    subgraph OutputLayer[Output Layer]
        Writers["Writers"]:::output
        Codeplug["Final Codeplug<br/>(YAML)"]:::output
    end

    %% Connections
    BM --> BMH
    PZ --> PZH
    BMH --> Cache
    PZH --> Cache
    BC --> Generators
    UI --> Generators
    Cache --> Generators
    
    ACG & DCG & CG & ZG & AG & RG & GLG --> Agg
    Models --> Generators
    Recipe --> Generators
    Agg --> Writers
    Writers --> Codeplug

    %% Click Events
    click BMH "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/datasources/brandmeister.py"
    click PZH "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/datasources/przemienniki.py"
    click Cache "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/datasources/cache.py"
    click BC "https://github.com/jasiek/dmr-codeplug-gen/blob/master/blank_radio/uv878_base.yml"
    click ACG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/analogchan.py"
    click DCG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/digitalchan.py"
    click CG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/contacts.py"
    click ZG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/zones.py"
    click AG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/aprs.py"
    click RG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/roaming.py"
    click GLG "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/generators/grouplists.py"
    click Agg "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/aggregators.py"
    click Models "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/models.py"
    click Writers "https://github.com/jasiek/dmr-codeplug-gen/blob/master/codeplug/writers.py"
    click Recipe "https://github.com/jasiek/dmr-codeplug-gen/tree/master/codeplug/recipes/"

    %% Styling
    classDef external fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef config fill:#FFA500,stroke:#333,stroke-width:2px
    classDef handler fill:#90EE90,stroke:#333,stroke-width:2px
    classDef cache fill:#FFD700,stroke:#333,stroke-width:2px
    classDef generator fill:#98FB98,stroke:#333,stroke-width:2px
    classDef processor fill:#3CB371,stroke:#333,stroke-width:2px
    classDef support fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef output fill:#BA55D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        direction TB
        L1["External Services"]:::external
        L2["Configuration"]:::config
        L3["Handlers"]:::handler
        L4["Cache"]:::cache
        L5["Generators"]:::generator
        L6["Processors"]:::processor
        L7["Support Systems"]:::support
        L8["Output Components"]:::output
    end
```
