# thepkuhub/pkuhub_developer_tutorial architecture

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

- Interactive diagram: https://gitdiagram.com/thepkuhub/pkuhub_developer_tutorial
- Repository: https://github.com/thepkuhub/pkuhub_developer_tutorial

## Overview

##### Project type and purpose
- This is a monorepo holding several “PKUHUB Developer Tutorial” slide‐deck projects plus code examples and notes.
- It is not a web application or a runtime service. Instead, it’s a documentation/slide‐generation system with three different slide engines (Typst, Vue/Vite, Vue/Netlify) plus a Rust code‐example crate and some raw notes.

##### File structure
- Top‐level:
- lecture1-3-4-6/        – A Typst‐based slide deck
- lecture2/              – A Vite + Vue slide deck
- lecture5/              – A pnpm/Vue slide deck with Netlify/Vercel configs
- rust-examples/         – A Cargo project with example .rs files
- speech_notes/          – Raw notes in Typst and Markdown
- readme.md              – Monorepo overview
- Each slide‐deck directory contains its own source files, configuration, dependencies, and build scripts.
- There are no direct runtime dependencies between directories—they are loosely grouped artifacts built and deployed independently.

##### README for additional insights
- The global README focuses on the Typst deck (lecture1-3-4-6), recommending VSCode plugins (Tinymist Typst, Typst Companion) and showing the template/sections pattern.
- It calls out a four‐file pattern: globals.typ, main.typ, sections/_template.typ, sections/*.typ.

- Monorepo Root
– Contains slide subprojects, code examples, notes
- Slide Deck: Typst Engine (lecture1-3-4-6)
– Inputs: globals.typ, main.typ, sections/*.typ, images
– Tool: Typst CLI / VSCode Plugins
– Output: PDF slides
- Slide Deck: Vue/Vite Engine (lecture2)
– Inputs: components/*.vue, layouts/*.vue, slides.config.ts, style.css
– Tool: Vite + Vue, NPM
– Output: Static HTML/CSS/JS site
- Slide Deck: pnpm/Vue + Hosting (lecture5)
– Inputs: components/*.vue, slides.md, style.css, netlify.toml, vercel.json
– Tool: pnpm workspace, Vue, Netlify CLI, Vercel CLI
– Output: Hosted site on Netlify/Vercel
- Rust Examples (rust-examples)
– Inputs: Cargo.toml, src/*.rs
– Tool: cargo build / run
– Output: Command‐line executable or library
- Speech Notes (speech_notes)
– Inputs: .typ, .md files
– Tool: VSCode / Typst / Markdown viewer
– Output: Notes for speakers

- Root → Each subproject (structure containment)
- Each subproject → Its build tool (Typst CLI, Vite, pnpm, cargo)
- Build tool → Output artifact (PDF or static site or binary)

c. Architectural patterns / design principles:
- Monorepo pattern: co-located independent modules
- Polyglot tooling: different slide engines side by side
- Source→Build→Artifact pipeline per module
- Clear separation of concerns: slide content vs. build config vs. deployment config

d. Key technologies and frameworks:
- Typst (Typst CLI, Tinymist Typst, Typst Companion)
- Node.js / pnpm / NPM / Vite / Vue 3
- Netlify & Vercel for hosting
- Rust & Cargo for examples
- Markdown for raw notes

##### Elements
- Blue for source files/modules
- Green for build tools
- Orange for outputs/artifacts
- Purple for external services (Netlify, Vercel)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Monorepo Root
    Root["Monorepo Root"]:::source
    click Root "https://github.com/thepkuhub/pkuhub_developer_tutorial/blob/master/.gitignore"
    click Root "https://github.com/thepkuhub/pkuhub_developer_tutorial/blob/master/readme.md"

    %% Lecture1: Typst Deck
    subgraph "Typst Deck (lecture1-3-4-6)"
        Lecture1Src["globals.typ\nmain.typ\nsections/_template.typ\nsections/*.typ\nimages/\n速查表.md"]:::source
        Lecture1Build["Typst CLI\nVSCode Plugins"]:::build
        Lecture1Out["PDF Slides"]:::output
    end
    click Lecture1Src "https://github.com/thepkuhub/pkuhub_developer_tutorial/tree/master/lecture1-3-4-6/"
    
    %% Lecture2: Vue/Vite Deck
    subgraph "Vue/Vite Deck (lecture2)"
        Lecture2Src["components/*.vue\nlayouts/*.vue\nslides.config.ts\nstyle.css\npackage.json\nvite.config.ts"]:::source
        Lecture2Build["Vite + Vue\nNPM"]:::build
        Lecture2Out["Static HTML/CSS/JS"]:::output
    end
    click Lecture2Src "https://github.com/thepkuhub/pkuhub_developer_tutorial/tree/master/lecture2/"

    %% Lecture5: pnpm/Vue + Hosting
    subgraph "pnpm/Vue Deck (lecture5)"
        Lecture5Src["components/*.vue\nglobal-top.vue\nslides.md\nstyle.css\nnetlify.toml\nvercel.json\npackage.json\npnpm-workspace.yaml\npnpm-lock.yaml"]:::source
        Lecture5Build["pnpm & Vue\nNetlify CLI\nVercel CLI"]:::build
        Lecture5Out["Static Site"]:::output
        Lecture5Deploy["Netlify\nVercel"]:::external
    end
    click Lecture5Src "https://github.com/thepkuhub/pkuhub_developer_tutorial/tree/master/lecture5/"

    %% Rust Examples
    subgraph "Rust Examples (rust-examples)"
        RustSrc["src/*.rs\nCargo.toml\nCargo.lock"]:::source
        RustBuild["Cargo"]:::build
        RustOut["Binary / Library"]:::output
    end
    click RustSrc "https://github.com/thepkuhub/pkuhub_developer_tutorial/tree/master/rust-examples/"

    %% Speech Notes
    subgraph "Speech Notes (speech_notes)"
        NotesSrc[".typ files\n.md files\n产品需求文档 (PRD) AI代码重构与讲解工具.md"]:::source
        NotesTool["VSCode\nTypst Plugin\nMarkdown Viewer"]:::build
        NotesOut["Speaker Notes"]:::output
    end
    click NotesSrc "https://github.com/thepkuhub/pkuhub_developer_tutorial/tree/master/speech_notes/"

    %% Relationships
    Root --> Lecture1Src
    Lecture1Src --> Lecture1Build --> Lecture1Out

    Root --> Lecture2Src
    Lecture2Src --> Lecture2Build --> Lecture2Out

    Root --> Lecture5Src
    Lecture5Src --> Lecture5Build --> Lecture5Out --> Lecture5Deploy

    Root --> RustSrc
    RustSrc --> RustBuild --> RustOut

    Root --> NotesSrc
    NotesSrc --> NotesTool --> NotesOut

    %% Styles
    classDef source fill:#E0F7FA,stroke:#039BE5,color:#000;
    classDef build fill:#C8E6C9,stroke:#2E7D32,color:#000;
    classDef output fill:#FFE0B2,stroke:#EF6C00,color:#000;
    classDef external fill:#E1BEE7,stroke:#8E24AA,color:#000;
```
