# daehyeoni/holidays-kr architecture

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

- Interactive diagram: https://gitdiagram.com/daehyeoni/holidays-kr
- Repository: https://github.com/daehyeoni/holidays-kr

## Overview

##### Main Components

a. Data Source Layer:
- Public Data Portal (한국천문연구원) API
- As an external system component

b. Data Processing Layer:
- GitHub Actions Workflows
- Data Update Pipeline
- JSON Storage

c. Service Layer:
- ICS File Generator
- Web Server/Hosting

d. Client Layer:
- Google Calendar (as consumer)
- Other Calendar Applications

##### Component Relationships

- Public Data Portal → GitHub Actions
- GitHub Actions → JSON Files
- JSON Files → ICS Generator
- ICS File → Calendar Clients
- GitHub Actions Schedule → Update Pipeline

##### Specific Implementation Details

- GitHub Actions Workflows (highlight two workflows):
- update-holidays.yml
- deploy.yml
- Data Storage:
- JSON files (2023.json through 2026.json)
- Output:
- holidays.ics

##### Additional Elements

Supporting details:
- Automation Schedule
- Data Format Transformations
- Hosting Environment

**[External Data Source]**
- ↓
**[Automation Layer]**
- ↓
**[Data Storage]**
- ↓
**[Service Layer]**
- ↓
**[Client Layer]**

Key Considerations:

##### Automation
- Automated nature of the system
- Clear separation between update and deployment processes

##### Data Flow
- Demonstrate how data moves from source to final ICS format
- Where transformations occur

##### Integration Points
- Webcal:// endpoint
- How calendar clients can consume the service

##### Infrastructure
- Hosting/deployment environment
- Where the ICS file is served from

Remember to:
- Use consistent symbols throughout
- Version or last update information
- Error handling paths where relevant

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef external fill:#3498db,stroke:#2980b9,color:white
    classDef storage fill:#2ecc71,stroke:#27ae60,color:white
    classDef process fill:#e67e22,stroke:#d35400,color:white
    classDef output fill:#9b59b6,stroke:#8e44ad,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white

    %% External Data Source Layer
    subgraph DataSource["Data Source Layer"]
        PublicAPI["Public Data Portal\n(한국천문연구원)"]:::external
    end

    %% Automation Layer
    subgraph Automation["Automation Layer"]
        GHA["GitHub Actions"]:::process
        click GHA "https://github.com/DaeHyeoNi/holidays-kr/tree/master/.github/workflows/"
        UpdateWorkflow["Update Holidays\nWorkflow"]:::process
        click UpdateWorkflow "https://github.com/DaeHyeoNi/holidays-kr/blob/master/.github/workflows/update-holidays.yml"
        DeployWorkflow["Deploy\nWorkflow"]:::process
        click DeployWorkflow "https://github.com/DaeHyeoNi/holidays-kr/blob/master/.github/workflows/deploy.yml"
    end

    %% Storage Layer
    subgraph Storage["Storage Layer"]
        JSON["JSON Storage"]:::storage
        click JSON "https://github.com/DaeHyeoNi/holidays-kr/tree/master/data/"
        JSON2023["2023.json"]:::storage
        JSON2024["2024.json"]:::storage
        JSON2025["2025.json"]:::storage
        JSON2026["2026.json"]:::storage
        click JSON2023 "https://github.com/DaeHyeoNi/holidays-kr/blob/master/data/2023.json"
        click JSON2024 "https://github.com/DaeHyeoNi/holidays-kr/blob/master/data/2024.json"
        click JSON2025 "https://github.com/DaeHyeoNi/holidays-kr/blob/master/data/2025.json"
        click JSON2026 "https://github.com/DaeHyeoNi/holidays-kr/blob/master/data/2026.json"
    end

    %% Service Layer
    subgraph Service["Service Layer"]
        ICSGen["ICS Generator"]:::process
        click ICSGen "https://github.com/DaeHyeoNi/holidays-kr/blob/master/main.py"
        ICSFile["holidays.ics"]:::output
        click ICSFile "https://github.com/DaeHyeoNi/holidays-kr/blob/master/holidays.ics"
        Docker["Container Runtime"]:::config
        click Docker "https://github.com/DaeHyeoNi/holidays-kr/tree/master/Dockerfile"
        EnvConfig["Environment Config"]:::config
        click EnvConfig "https://github.com/DaeHyeoNi/holidays-kr/blob/master/.env.example"
        Dependencies["Dependencies"]:::config
        click Dependencies "https://github.com/DaeHyeoNi/holidays-kr/tree/master/Pipfile"
        DeployScripts["Deployment Scripts"]:::config
        click DeployScripts "https://github.com/DaeHyeoNi/holidays-kr/blob/master/scripts/create-index.sh"
    end

    %% Client Layer
    subgraph Clients["Client Layer"]
        GoogleCal["Google Calendar"]:::external
        OtherCal["Other Calendar\nApplications"]:::external
    end

    %% Relationships
    PublicAPI --> |"Data Fetch"| UpdateWorkflow
    UpdateWorkflow --> |"Store"| JSON
    JSON --> JSON2023 & JSON2024 & JSON2025 & JSON2026
    JSON2023 & JSON2024 & JSON2025 & JSON2026 --> ICSGen
    ICSGen --> ICSFile
    ICSFile --> GoogleCal
    ICSFile --> OtherCal
    DeployWorkflow --> |"Triggers"| Docker
    Docker --> |"Runs"| ICSGen
    EnvConfig -.- Docker
    Dependencies -.- Docker
    DeployScripts -.- Docker

    %% Legend
    subgraph Legend["Legend"]
        L1["External Systems"]:::external
        L2["Storage Components"]:::storage
        L3["Processing Components"]:::process
        L4["Output Components"]:::output
        L5["Configuration"]:::config
    end
```
