# daehun-swing/get-holidays architecture

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

- Interactive diagram: https://gitdiagram.com/daehun-swing/get-holidays
- Repository: https://github.com/daehun-swing/get-holidays

## Overview

##### Main Components

A. Client-Side Components:
- Pages Layer (app/page.tsx)
- Layout Layer (app/layout.tsx)
- Component Layer (src/components/*)
- Utils Layer (src/utils/*)

B. Server-Side Components:
- Next.js Server Runtime
- Server Actions (app/actions.ts)

C. Build & Configuration:
- Next.js Build System
- TypeScript Compilation
- CSS Processing (Tailwind)

**┌─ Client Layer ─────────────────────┐**
- Browser                            │
- ┬───────────────────┘
- ↓
**┌─ Next.js App Layer ────────────────┐**
- ┌─ Layout (layout.tsx) ───────────┐│

- ┌─ Page (page.tsx) ───────────┐ ││

- ┌─ Components ────────────┐ │ ││
- HolidayList          │ │ ││
- HolidayItem          │ │ ││
- CopyButton           │ │ ││
- ┘ │ ││
- ┘ ││
- ┘│
- ┬───────────────────┘
- ↓
**┌─ Server Layer ──────────────────────┐**
- Server Actions                    │
- API Routes                        │
- ┬───────────────────┘
- ↓
**┌─ Build System ─────────────────────┐**
- Next.js Compiler                 │
- TypeScript                       │
- Tailwind CSS                     │
- ┘

##### Important Elements to Highlight

a. Component Hierarchy:
- Nested structure of components
- Which components are client vs. server components
- Data flow between components

b. Data Flow:
- How the clipboard utility is used
- State management flow

##### Notes for Implementation

- Version numbers for major dependencies
- Optimization features (font loading, CSS processing)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Browser"]
    end

    subgraph "Next.js App"
        Layout["Layout"]:::client
        Page["Page"]:::client
        
        subgraph Components
            HolidayList["Holiday List"]:::client
            HolidayItem["Holiday Item"]:::client
            CopyButton["Copy Button"]:::client
        end
        
        subgraph Utils
            Clipboard["Clipboard Utility"]:::util
        end
        
        subgraph Types
            HolidayTypes["Holiday Types"]:::types
        end
    end

    subgraph "Server Layer"
        ServerActions["Server Actions"]:::server
        APIRoutes["API Routes"]:::server
    end

    subgraph "Build System"
        NextCompiler["Next.js Compiler"]:::build
        TypeScript["TypeScript"]:::build
        TailwindCSS["Tailwind CSS"]:::build
        FontSystem["Font System"]:::build
    end

    Browser --> Layout
    Layout --> Page
    Page --> HolidayList
    HolidayList --> HolidayItem
    HolidayItem --> CopyButton
    CopyButton --> Clipboard
    HolidayList --> ServerActions
    HolidayItem --> HolidayTypes
    
    TailwindCSS --> Layout
    FontSystem --> Layout
    TypeScript --> NextCompiler
    TailwindCSS --> NextCompiler

    %% Component Mappings
    click Layout "https://github.com/daehun-swing/get-holidays/blob/main/src/app/layout.tsx"
    click Page "https://github.com/daehun-swing/get-holidays/blob/main/src/app/page.tsx"
    click HolidayList "https://github.com/daehun-swing/get-holidays/blob/main/src/components/HolidayList.tsx"
    click HolidayItem "https://github.com/daehun-swing/get-holidays/blob/main/src/components/HolidayItem.tsx"
    click CopyButton "https://github.com/daehun-swing/get-holidays/blob/main/src/components/CopyButton.tsx"
    click Clipboard "https://github.com/daehun-swing/get-holidays/blob/main/src/utils/clipboard.ts"
    click ServerActions "https://github.com/daehun-swing/get-holidays/blob/main/src/app/actions.ts"
    click HolidayTypes "https://github.com/daehun-swing/get-holidays/blob/main/src/@types/holiday.d.ts"
    click TailwindCSS "https://github.com/daehun-swing/get-holidays/blob/main/tailwind.config.ts"
    click FontSystem "https://github.com/daehun-swing/get-holidays/tree/main/src/app/fonts"

    %% Styling
    classDef client fill:#3b82f6,color:white
    classDef server fill:#22c55e,color:white
    classDef build fill:#f97316,color:white
    classDef util fill:#6366f1,color:white
    classDef types fill:#a855f7,color:white

    %% Legend
    subgraph Legend
        Client1["Client Component"]:::client
        Server1["Server Component"]:::server
        Build1["Build Component"]:::build
        Util1["Utility"]:::util
        Type1["Type Definition"]:::types
    end
```
