# nntrn/what-im-reading architecture

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

- Interactive diagram: https://gitdiagram.com/nntrn/what-im-reading
- Repository: https://github.com/nntrn/what-im-reading

## Overview

##### Main Components

a. Data Processing Layer
- Input: annotations.json (external data source)
- JQ Processing Scripts (scripts/annotations.jq, books.jq)
- Data Transformation Pipeline

b. Static Site Generation Layer
- Jekyll Engine
- Layouts (_layouts/)
- Components (_includes/)
- Page Templates (_pages/)

c. Asset Management
- CSS Assets
- JavaScript Components
- Data Files (books.json, genres.json, stats.json)

##### Flow and Relationships

**[External Annotation Data] → [Data Processing Scripts] → [Generated JSON Files]**
- ↓
**[Jekyll Templates] ←→ [Layouts] → [Static Site Generator] ← [Data Files]**
- ↓                                  ↓
**[Include Components] → [Final Static HTML/CSS/JS Output]**

##### Component Details

- Book data generation
- Activity data generation
- Genre data generation
- Statistics generation
- Word data processing

##### Architectural Patterns to Highlight

- Static Site Generation pattern
- Data Transform Pipeline pattern
- Component-based templating (Jekyll includes)
- GitHub Pages deployment model

##### Deployment/Hosting

- File types (JSON, HTML, CSS, JS)
- Process flows
- Build steps
- External dependencies

This will give other engineers a clear understanding of:
- How data flows through the system
- Where transformations occur
- How the static site is assembled
- Where customization points exist

Remember to indicate the GitHub Actions automation that can trigger updates via the repository dispatch event, as shown in the README's curl command example.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Data Processing Layer"
        AD[("Annotation Data")]
        JQS["JQ Processing Scripts"]:::scripts
        BPS["Build Pipeline Script"]:::scripts
        PDO["Processed Data Output"]:::data
        
        AD --> JQS
        JQS --> BPS
        BPS --> PDO
    end

    subgraph "Static Site Generation Layer"
        JC["Jekyll Config"]:::config
        LT["Layout Templates"]:::templates
        PT["Page Templates"]:::templates
        CP["Custom Plugins"]:::plugins
        
        JC --> LT
        JC --> PT
        JC --> CP
    end

    subgraph "Include Components"
        UI["UI Components"]:::includes
        JM["JavaScript Modules"]:::scripts
        CS["Core Scripts"]:::scripts
    end

    subgraph "Asset Management"
        CSS["CSS Styles"]:::styles
        SA["Static Assets"]:::assets
        DF["Data Files"]:::data
    end

    subgraph "Build & Deployment"
        GHA["GitHub Actions"]:::deployment
        DEP["Dependencies"]:::config
    end

    PDO --> DF
    LT --> UI
    PT --> UI
    UI --> SA
    JM --> SA
    CS --> SA
    CSS --> SA
    DF --> JC
    JC --> GHA
    DEP --> GHA

    classDef scripts fill:#2196F3,color:white
    classDef data fill:#FF9800,color:white
    classDef config fill:#4CAF50,color:white
    classDef templates fill:#9C27B0,color:white
    classDef plugins fill:#607D8B,color:white
    classDef includes fill:#795548,color:white
    classDef styles fill:#E91E63,color:white
    classDef assets fill:#00BCD4,color:white
    classDef deployment fill:#FF5722,color:white

    click JQS "https://github.com/nntrn/what-im-reading/blob/main/scripts/annotations.jq"
    click BPS "https://github.com/nntrn/what-im-reading/blob/main/scripts/build-data.sh"
    click PDO "https://github.com/nntrn/what-im-reading/tree/main/assets/data"
    click JC "https://github.com/nntrn/what-im-reading/blob/main/_config.yml"
    click LT "https://github.com/nntrn/what-im-reading/tree/main/_layouts"
    click PT "https://github.com/nntrn/what-im-reading/tree/main/_pages"
    click CP "https://github.com/nntrn/what-im-reading/blob/main/_plugins/datapage.rb"
    click UI "https://github.com/nntrn/what-im-reading/tree/main/_includes"
    click JM "https://github.com/nntrn/what-im-reading/tree/main/_includes/scripts"
    click CS "https://github.com/nntrn/what-im-reading/blob/main/_includes/script.js"
    click CSS "https://github.com/nntrn/what-im-reading/tree/main/_includes"
    click SA "https://github.com/nntrn/what-im-reading/tree/main/assets"
    click DF "https://github.com/nntrn/what-im-reading/tree/main/assets/data"
    click GHA "https://github.com/nntrn/what-im-reading/blob/main/.github/workflows/docs.yml"
    click DEP "https://github.com/nntrn/what-im-reading/tree/main/Gemfile"
```
