# github/training-kit architecture

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

- Interactive diagram: https://gitdiagram.com/github/training-kit
- Repository: https://github.com/github/training-kit

## Overview

##### Project type and purpose
- This is an open-source, static site project built with Jekyll.
- It serves as a content repository (“GitHub Training Kit”) containing Git and GitHub cheat sheets, multilingual downloads, guides, and templates.
- It’s designed for both local preview (via `script/server`) and global hosting (GitHub Pages or any static‐file web server).

##### File structure
- Top‐level directories:
- `assets` – SCSS, CSS, fonts (static assets)
- `_includes` / `_layouts` / `_pages` – Jekyll templates and page fragments
- `downloads` / `git-guides` – content in Markdown, organized by language
- `script` – build and dev scripts (`bootstrap`, `build`, `server`, `package`)
- `.github/workflows` – CI/CD (CodeQL analysis, dependency review, Jekyll build)
- Config & metadata:
- `_config.yml` – Jekyll site configuration
- `Gemfile` / `Gemfile.lock` – Ruby/Jekyll dependencies
- `package.json` / `package-lock.json` – Node.js / asset‐pipeline dependencies
- Recognize the asset pipeline: SCSS compiled to CSS, then Jekyll merges assets + Markdown into HTML.

##### README for additional insights
- Confirms use of Jekyll and Markdown.
- Mentions Primer CSS toolkit for styling.
- Provides instructions for packaging (using `script/package`) and local server startup.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Local Development Environment
    subgraph "Local Development"
        direction TB
        Dev["Developer"]:::tools
        BS["script/bootstrap"]:::tools
        NU["script/server"]:::tools
        RB["Ruby/Bundler"]:::tools
        NP["Node/npm"]:::tools
        JE["Jekyll Engine"]:::tools
        LS["Local Preview Server"]:::hosting
        Dev -->|"runs"| BS
        Dev -->|"runs"| NU
        BS -->|"installs gems"| RB
        BS -->|"installs npm deps"| NP
        NU -->|"starts"| LS
        RB -->|"provides Jekyll"| JE
        NP -->|"compiles SCSS"| JE
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        direction TB
        Repo["GitHub Repo"]:::cicd
        WF[".github/workflows"]:::cicd
        QL["CodeQL Analysis"]:::cicd
        DR["Dependency Review"]:::cicd
        JB["Jekyll Build"]:::cicd
        Repo -->|"pushes"| WF
        WF --> QL
        WF --> DR
        WF --> JB
    end

    %% Build Pipeline
    subgraph "Automated Build"
        direction TB
        RB2["Ruby/Bundler"]:::tools
        NP2["Node/npm"]:::tools
        BS2["script/build"]:::tools
        PK["script/package"]:::tools
        JE2["Jekyll Engine"]:::tools
        RB2 --> JE2
        NP2 --> JE2
        BS2 --> JE2
        JE2 --> PK
    end

    %% Content Sources
    subgraph "Content (Markdown)" 
        direction TB
        DL["downloads/**"]:::content
        GG["git-guides/*.md"]:::content
        PG["_pages/404.md"]:::content
    end

    %% Templates & Includes
    subgraph "Templates & Includes"
        direction TB
        LO1["_layouts/cheat-sheet.html"]:::templates
        LO2["_layouts/default.html"]:::templates
        IN["_includes/*.html"]:::templates
    end

    %% Static Assets
    subgraph "Static Assets"
        direction TB
        SCSS["assets/_scss/*.scss"]:::templates
        CSS["assets/css/*.scss"]:::templates
        FN["assets/fonts/*"]:::templates
    end

    %% Jekyll Generation
    subgraph "Site Generation"
        direction TB
        JE3["Jekyll Engine"]:::tools
        OUT["_site Output"]:::hosting
        JE3 --> OUT
    end

    %% Hosting
    subgraph "Hosting"
        direction TB
        GP["GitHub Pages"]:::hosting
        HS["Static HTTP Server"]:::hosting
        OUT --> GP
        OUT --> HS
        CNAME["CNAME"]:::hosting
    end

    %% Flows into Jekyll
    RB2 --> JE3
    NP2 --> JE3
    LO1 --> JE3
    LO2 --> JE3
    IN --> JE3
    DL --> JE3
    GG --> JE3
    PG --> JE3
    SCSS --> JE3
    CSS --> JE3
    FN --> JE3

    %% Version Config & Metadata
    subgraph "Configuration & Metadata"
        direction TB
        GI[".gitignore"]:::cicd
        CFG["_config.yml"]:::templates
        GMB["Gemfile"]:::tools
        GML["Gemfile.lock"]:::tools
        PKJ["package.json"]:::tools
        PKL["package-lock.json"]:::tools
        GI
        CFG
        GMB
        GML
        PKJ
        PKL
    end

    %% Developer push to repo
    Dev -->|"git push"| Repo

    click WF "https://github.com/github/training-kit/tree/main/.github/workflows"
    click QL "https://github.com/github/training-kit/blob/main/.github/workflows/codeql.yml"
    click DR "https://github.com/github/training-kit/blob/main/.github/workflows/dependency-review.yml"
    click JB "https://github.com/github/training-kit/blob/main/.github/workflows/jekyll.yml"
    click GI "https://github.com/github/training-kit/blob/main/.gitignore"
    click CFG "https://github.com/github/training-kit/blob/main/_config.yml"
    click GMB "https://github.com/github/training-kit/tree/main/Gemfile"
    click GML "https://github.com/github/training-kit/blob/main/Gemfile.lock"
    click PKJ "https://github.com/github/training-kit/blob/main/package.json"
    click PKL "https://github.com/github/training-kit/blob/main/package-lock.json"
    click BS "https://github.com/github/training-kit/tree/main/script/bootstrap"
    click BS2 "https://github.com/github/training-kit/tree/main/script/build"
    click NU "https://github.com/github/training-kit/tree/main/script/server"
    click PK "https://github.com/github/training-kit/tree/main/script/package"
    click LO1 "https://github.com/github/training-kit/blob/main/_layouts/cheat-sheet.html"
    click LO2 "https://github.com/github/training-kit/blob/main/_layouts/default.html"
    click IN "https://github.com/github/training-kit/tree/main/_includes/"
    click PG "https://github.com/github/training-kit/blob/main/_pages/404.md"
    click DL "https://github.com/github/training-kit/tree/main/downloads/"
    click GG "https://github.com/github/training-kit/tree/main/git-guides/"
    click SCSS "https://github.com/github/training-kit/tree/main/assets/_scss/"
    click CSS "https://github.com/github/training-kit/tree/main/assets/css/"
    click FN "https://github.com/github/training-kit/tree/main/assets/fonts/"
    click CNAME "https://github.com/github/training-kit/tree/main/CNAME"

    classDef tools fill:#ADD8E6,stroke:#000
    classDef content fill:#90EE90,stroke:#000
    classDef templates fill:#FFA500,stroke:#000
    classDef cicd fill:#DDA0DD,stroke:#000
    classDef hosting fill:#D8BFD8,stroke:#000
```
