# birteliu/morgengruen_tw architecture

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

- Interactive diagram: https://gitdiagram.com/birteliu/morgengruen_tw
- Repository: https://github.com/birteliu/morgengruen_tw

## Overview

##### Project type and purpose
- This is a static front-end website (“山山綠”) built with a simple static-site generator/workflow.
- It uses npm+Gulp to compile SCSS, process HTML templates, bundle JS and copy assets into a deployable `dist/` folder.

##### File structure
- Top-level
– `src/` – all authoring artifacts: HTML pages, Nunjucks‐style templates & macros, SCSS, JS, images, fonts
– `dist/` – the output of your build (mirrors `src/` structure but with compiled CSS, processed HTML, bundled JS, maps, etc.)
– `gulpfile.js` – defines dev/watch/build tasks
– `package.json` – Node dependencies (gulp, plugins, bootstrap)
– `readme.md` – build instructions and third-party libs
- Patterns
– Templates + macros → HTML pages
– SCSS partials/components → compiled CSS + sourcemaps
– JS sources (jQuery + main.js) → concatenated/bundled JS
– Static assets (fonts/images) → copied

##### README for additional insights
- Build commands:
- `npm install`
- `gulp dev` – compile once
- `gulp watch` – live‐reload watch
- Third-party:
- Bootstrap v5.2.0
- Custom fonts from FakePearl repo

##### Detail
- Break out each `src/` subfolder as its own node.
- Individual Gulp tasks (sass, templates, js, assets, watch).
- Live‐reload dev server as a distinct component.
- Final dist/ structure so viewers see exactly what’s deployed.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Source Layer
    subgraph "Source (Blue)"
        direction TB
        SRC_SCSS_ENTRY["style.scss"]:::source
        SRC_SCSS_CUSTOM["_custom.scss"]:::source
        SRC_SCSS_MIXIN["_mixin.scss"]:::source
        SRC_SCSS_NAV["_nav.scss"]:::source
        SRC_SCSS_VARS["_variables.scss"]:::source

        SRC_TPL_LAYOUT["layout.html"]:::source
        SRC_TPL_MACRO_NAV["macros/nav.html"]:::source

        SRC_PAGE_INDEX["index.html"]:::source
        SRC_PAGE_PLANT["plant.html"]:::source
        SRC_PAGE_CREATURE["creature.html"]:::source

        SRC_JS_JQUERY["jquery.js"]:::source
        SRC_JS_MAIN["main.js"]:::source

        SRC_FONTS["fonts/"]:::source
        SRC_IMAGES_CREATURE["images/creature/"]:::source
        SRC_IMAGES_PLANT["images/plant/"]:::source
    end

    %% Build Tasks Layer
    subgraph "Build Pipeline (Green)"
        direction TB
        SASS_TASK["sass compile + autoprefix + sourcemaps"]:::build
        TPL_TASK["HTML processing"]:::build
        JS_TASK["concat + minify"]:::build
        ASSETS_TASK["copy assets"]:::build
        WATCH_TASK["watch + live-reload"]:::build
        DEV_SERVER["dev server"]:::build
    end

    %% Output Layer
    subgraph "Output (Orange)"
        direction TB
        OUT_CSS["css/style.css + .map"]:::output
        OUT_HTML_PAGES["*.html"]:::output
        OUT_HTML_TPL["templates/layout.html & macros/nav.html"]:::output
        OUT_JS["js/jquery.js & main.js"]:::output
        OUT_FONTS["fonts/"]:::output
        OUT_IMAGES["images/"]:::output
    end

    %% External Tools
    subgraph "External Tools & Deployment (Gray)"
        direction TB
        NODE_NPM["Node.js + npm"]:::external
        GULP["Gulp"]:::external
        BOOTSTRAP["Bootstrap v5.2.0"]:::external
        JQUERY["jQuery"]:::external
        STATIC_HOST["Static Host/CDN"]:::external
    end

    %% Flows
    SRC_SCSS_ENTRY --> SASS_TASK
    SRC_SCSS_CUSTOM --> SASS_TASK
    SRC_SCSS_MIXIN --> SASS_TASK
    SRC_SCSS_NAV --> SASS_TASK
    SRC_SCSS_VARS --> SASS_TASK

    SRC_TPL_LAYOUT --> TPL_TASK
    SRC_TPL_MACRO_NAV --> TPL_TASK

    SRC_PAGE_INDEX --> TPL_TASK
    SRC_PAGE_PLANT --> TPL_TASK
    SRC_PAGE_CREATURE --> TPL_TASK

    SRC_JS_JQUERY --> JS_TASK
    SRC_JS_MAIN --> JS_TASK

    SRC_FONTS --> ASSETS_TASK
    SRC_IMAGES_CREATURE --> ASSETS_TASK
    SRC_IMAGES_PLANT --> ASSETS_TASK

    SASS_TASK --> OUT_CSS
    TPL_TASK --> OUT_HTML_PAGES
    TPL_TASK --> OUT_HTML_TPL
    JS_TASK --> OUT_JS
    ASSETS_TASK --> OUT_FONTS
    ASSETS_TASK --> OUT_IMAGES

    WATCH_TASK --> DEV_SERVER
    SRC_SCSS_ENTRY --> WATCH_TASK
    SRC_TPL_LAYOUT --> WATCH_TASK
    SRC_JS_MAIN --> WATCH_TASK
    SRC_PAGE_INDEX --> WATCH_TASK

    OUT_CSS --> STATIC_HOST
    OUT_HTML_PAGES --> STATIC_HOST
    OUT_HTML_TPL --> STATIC_HOST
    OUT_JS --> STATIC_HOST
    OUT_FONTS --> STATIC_HOST
    OUT_IMAGES --> STATIC_HOST

    %% Dependencies
    NODE_NPM --> GULP
    NODE_NPM --> SASS_TASK
    GULP --> SASS_TASK
    GULP --> TPL_TASK
    GULP --> JS_TASK
    GULP --> ASSETS_TASK
    GULP --> WATCH_TASK

    BOOTSTRAP --> SRC_SCSS_ENTRY
    JQUERY --> SRC_JS_JQUERY

    %% Click Events
    click SRC_SCSS_ENTRY "https://github.com/birteliu/morgengruen_tw/blob/main/src/scss/style.scss"
    click SRC_SCSS_CUSTOM "https://github.com/birteliu/morgengruen_tw/blob/main/src/scss/_custom.scss"
    click SRC_SCSS_MIXIN "https://github.com/birteliu/morgengruen_tw/blob/main/src/scss/_mixin.scss"
    click SRC_SCSS_NAV "https://github.com/birteliu/morgengruen_tw/blob/main/src/scss/_nav.scss"
    click SRC_SCSS_VARS "https://github.com/birteliu/morgengruen_tw/blob/main/src/scss/_variables.scss"

    click SRC_TPL_LAYOUT "https://github.com/birteliu/morgengruen_tw/blob/main/src/templates/layout.html"
    click SRC_TPL_MACRO_NAV "https://github.com/birteliu/morgengruen_tw/blob/main/src/templates/macros/nav.html"

    click SRC_PAGE_INDEX "https://github.com/birteliu/morgengruen_tw/blob/main/src/index.html"
    click SRC_PAGE_PLANT "https://github.com/birteliu/morgengruen_tw/blob/main/src/plant.html"
    click SRC_PAGE_CREATURE "https://github.com/birteliu/morgengruen_tw/blob/main/src/creature.html"

    click SRC_JS_JQUERY "https://github.com/birteliu/morgengruen_tw/blob/main/src/js/jquery.js"
    click SRC_JS_MAIN "https://github.com/birteliu/morgengruen_tw/blob/main/src/js/main.js"

    click SRC_FONTS "https://github.com/birteliu/morgengruen_tw/tree/main/src/fonts/"
    click SRC_IMAGES_CREATURE "https://github.com/birteliu/morgengruen_tw/tree/main/src/images/creature/"
    click SRC_IMAGES_PLANT "https://github.com/birteliu/morgengruen_tw/tree/main/src/images/plant/"

    click SASS_TASK "https://github.com/birteliu/morgengruen_tw/blob/main/gulpfile.js"
    click TPL_TASK "https://github.com/birteliu/morgengruen_tw/blob/main/gulpfile.js"
    click JS_TASK "https://github.com/birteliu/morgengruen_tw/blob/main/gulpfile.js"
    click ASSETS_TASK "https://github.com/birteliu/morgengruen_tw/blob/main/gulpfile.js"
    click WATCH_TASK "https://github.com/birteliu/morgengruen_tw/blob/main/gulpfile.js"

    click NODE_NPM "https://github.com/birteliu/morgengruen_tw/blob/main/package.json"
    click GULP "https://github.com/birteliu/morgengruen_tw/blob/main/package.json"
    click BOOTSTRAP "https://github.com/birteliu/morgengruen_tw/blob/main/readme.md"
    click JQUERY "https://github.com/birteliu/morgengruen_tw/blob/main/readme.md"
    click STATIC_HOST "https://github.com/birteliu/morgengruen_tw/tree/main/dist/"

    %% Styles
    classDef source fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef build fill:#DFF5D0,stroke:#228B22,color:#228B22
    classDef output fill:#FFE8B0,stroke:#FF8C00,color:#FF8C00
    classDef external fill:#E0E0E0,stroke:#707070,color:#707070
```
