# leknoppix/xmltv_tnt_json_unit architecture

> Architecture diagram of the GitHub repository leknoppix/xmltv_tnt_json_unit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leknoppix/xmltv_tnt_json_unit
- Repository: https://github.com/leknoppix/xmltv_tnt_json_unit

## Overview

##### Main Components

a) Container Infrastructure Layer:
- Docker Container (primary runtime environment)
- S6 Overlay (indicated by install-s6.sh)
- Cron Service (indicated by service_crond)
- Unit Service (indicated by service_unitd)

b) Application Layer:
- Download and Conversion Service (indicated by dl_and_convert)
- Boot-time Download Service (indicated by dl_at_boot.sh)
- Configuration Management (config.json)
- Access Log Handler (set_access_log.sh)

c) CI/CD Layer:
- GitHub Actions Workflow (multiarch build system)
- Docker Hub Integration

##### Component Relationships

- Docker container as the outer boundary
- Inside Docker, show S6 Overlay as the process supervisor
- Under S6, show two main services:
- Cron Service
- Unit Service
- Dl_and_convert to both services
- Config.json feeding into the application components
- CI/CD pipeline flow from GitHub to Docker Hub

##### Important Architectural Notes

Aspects:
- Multi-architecture support (amd64, arm64, arm/v7)
- Service supervision hierarchy
- Automated deployment pipeline
- Configuration management
- Scheduled task execution

1. Build & Deploy (GitHub Actions → Docker Hub)
2. Runtime Container (Docker + S6)
3. Service Layer (Cron + Unit)
4. Application Layer (Scripts + Config)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CI ["Build & Deploy Layer"]
        GH["GitHub Actions"]
        DH["Docker Hub"]
        GH -->|Build & Push| DH
    end

    subgraph Container ["Container Infrastructure"]
        DC["Docker Container"]:::container
        S6["S6 Overlay Supervisor"]:::supervisor
        DC --> S6
    end

    subgraph Services ["Service Layer"]
        CRON["Cron Service"]:::service
        UNIT["Unit Service"]:::service
        S6 --> CRON
        S6 --> UNIT
    end

    subgraph App ["Application Layer"]
        DL["Download & Convert"]:::app
        BOOT["Boot Download"]:::app
        CONFIG["Configuration"]:::config
        LOG["Access Log Handler"]:::app
        
        CONFIG --> DL
        CONFIG --> BOOT
        CONFIG --> LOG
        
        CRON --> DL
        UNIT --> DL
        UNIT --> BOOT
    end

    DH -->|Deploy| DC

    classDef container fill:#1a73e8,color:white
    classDef supervisor fill:#7b1fa2,color:white
    classDef service fill:#ff7043,color:white
    classDef app fill:#43a047,color:white
    classDef config fill:#fdd835,color:black
    classDef ci fill:#78909c,color:white

    class GH,DH ci
    
    %% Click events for component mapping
    click DC "https://github.com/leknoppix/xmltv_tnt_json_unit/tree/main/Dockerfile"
    click S6 "https://github.com/leknoppix/xmltv_tnt_json_unit/blob/main/install-s6.sh"
    click CRON "https://github.com/leknoppix/xmltv_tnt_json_unit/tree/main/service_crond"
    click UNIT "https://github.com/leknoppix/xmltv_tnt_json_unit/tree/main/service_unitd"
    click DL "https://github.com/leknoppix/xmltv_tnt_json_unit/tree/main/dl_and_convert"
    click BOOT "https://github.com/leknoppix/xmltv_tnt_json_unit/blob/main/dl_at_boot.sh"
    click CONFIG "https://github.com/leknoppix/xmltv_tnt_json_unit/blob/main/config.json"
    click LOG "https://github.com/leknoppix/xmltv_tnt_json_unit/blob/main/set_access_log.sh"
    click GH "https://github.com/leknoppix/xmltv_tnt_json_unit/blob/main/.github/workflows/deploy.yml"
```
