# shingzhanho/comp2120-notes architecture

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

- Interactive diagram: https://gitdiagram.com/shingzhanho/comp2120-notes
- Repository: https://github.com/shingzhanho/comp2120-notes

## Overview

##### Project type and purpose
- This is a LaTeX‐based static documentation repository for COMP2120 revision notes and a cheatsheet.
- It uses build scripts and a CI pipeline to compile `.tex` sources into PDF assets and publishes them via GitHub Pages.

##### File structure
- Top‐level directories:
- `.github/workflows/compile.yml` → CI pipeline definition on GitHub Actions
- `build/` → shell scripts and config to install dependencies and drive the LaTeX build
- `cheatsheet/` → source `.tex` files for the exam cheat‐sheet
- `notes/` → organized chapter subdirectories and main `.tex` for the full lecture notes
- `gh-pages/` → published HTML/PDF artifacts served as the site
- Configuration:
- `build/apt-list.txt` and `build/requirements.txt` (system and Python deps)
- `build/download-hash.sh`, `build/add-disclaimer.sh` (post-processing of generated PDFs)
- `.gitignore`, `README.md`

##### README for additional insights
- Describes automatic compilation and GitHub Pages publication.
- Points to the generated PDFs for notes and cheatsheet.
- Emphasizes that materials are for personal use.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Source Content Layer"
        Notes["Lecture Notes"]:::content
        Cheatsheet["Cheat Sheet"]:::content
    end

    subgraph "Project Configuration & Documentation"
        Readme["README.md"]:::config
        Gitignore[".gitignore"]:::config
    end

    subgraph "Build Layer"
        subgraph "Dependency Installation"
            APTList["apt-list.txt"]:::config
            Requirements["requirements.txt"]:::config
        end
        AddDisclaimer["add-disclaimer.sh"]:::script
        DownloadHash["download-hash.sh"]:::script
        TeX["LaTeX Toolchain"]:::script
    end

    subgraph "CI/CD Layer"
        CIWorkflow["compile.yml"]:::ci
        Runner["GitHub Actions Runner"]:::ci
    end

    subgraph "Output & Hosting Layer"
        PDFs[(Compiled PDFs)]:::artifact
        ghPagesDir["gh-pages/"]:::artifact
    end

    subgraph "External Services"
        GitHub["GitHub"]:::external
        GitHubPages["GitHub Pages"]:::external
    end

    GitHub -->|"push triggers"| CIWorkflow
    CIWorkflow --> Runner
    Runner --> APTList
    Runner --> Requirements
    Runner --> DownloadHash
    Runner --> AddDisclaimer
    Runner --> TeX
    Notes --> TeX
    Cheatsheet --> TeX
    APTList --> TeX
    Requirements --> TeX
    DownloadHash --> TeX
    AddDisclaimer --> TeX
    TeX --> PDFs
    PDFs --> ghPagesDir
    Runner --> ghPagesDir
    ghPagesDir --> GitHubPages

    click Notes "https://github.com/shingzhanho/comp2120-notes/tree/master/notes/"
    click Cheatsheet "https://github.com/shingzhanho/comp2120-notes/tree/master/cheatsheet/"
    click AddDisclaimer "https://github.com/shingzhanho/comp2120-notes/blob/master/build/add-disclaimer.sh"
    click DownloadHash "https://github.com/shingzhanho/comp2120-notes/blob/master/build/download-hash.sh"
    click APTList "https://github.com/shingzhanho/comp2120-notes/blob/master/build/apt-list.txt"
    click Requirements "https://github.com/shingzhanho/comp2120-notes/blob/master/build/requirements.txt"
    click CIWorkflow "https://github.com/shingzhanho/comp2120-notes/blob/master/.github/workflows/compile.yml"
    click ghPagesDir "https://github.com/shingzhanho/comp2120-notes/tree/master/gh-pages/"
    click Readme "https://github.com/shingzhanho/comp2120-notes/blob/master/README.md"
    click Gitignore "https://github.com/shingzhanho/comp2120-notes/blob/master/.gitignore"

    classDef content fill:#bbdefb,stroke:#0d47a1,color:#0d47a1
    classDef script fill:#ffe0b2,stroke:#e65100,color:#e65100
    classDef config fill:#fff3e0,stroke:#ef6c00,color:#ef6c00
    classDef ci fill:#c5cae9,stroke:#3f51b5,color:#3f51b5
    classDef artifact fill:#c8e6c9,stroke:#2e7d32,color:#2e7d32
    classDef external fill:#e1bee7,stroke:#6a1b9a,color:#6a1b9a
```
