# startbootstrap/startbootstrap-landing-page architecture

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

- Interactive diagram: https://gitdiagram.com/startbootstrap/startbootstrap-landing-page
- Repository: https://github.com/startbootstrap/startbootstrap-landing-page

## Overview

##### Project Type and Purpose
- Type: A static front-end landing‐page template built with Pug, SCSS, and JavaScript.
- Purpose: Provide a Bootstrap-based multipurpose landing page; authors work in `src/`, then compile into deployable static files in `dist/`.

##### File Structure
- Top-level:
– `src/` – source assets:
- `src/pug/` – Pug templates → HTML
- `src/scss/` – SCSS styles → CSS
- `src/js/` – custom scripts → JS
- `src/assets/img/` – images
– `scripts/` – custom Node.js build‐and‐dev utilities
– `dist/` – generated output: ready‐to‐serve HTML, CSS, JS, images
– `package.json` – npm scripts and dependencies
- Build Pattern: a pipeline that transforms `src/` via multiple tasks (build‐assets, build-pug, build-scss, build-scripts) into `dist/`.
- Dev Server: `npm start` spins up live preview + watchers.

##### Inspect the README for Insights
- Confirms static site generator‐style build: authors edit `src/`, run npm scripts to produce `dist/`.
- Lists key npm scripts mapping to pipeline stages.
- No backend or database—purely client‐side.

##### Main Components and Their Relationships
a. Components:
1. Source Layer (src/)
2. Build Toolchain (scripts/ + npm)
3. Output Layer (dist/)
4. Development Server & Watcher (npm start)
5. External Tools/Libraries (Node.js, NPM, Pug, Sass, Bootstrap)
b. Data Flows:
– Pug templates → HTML (build‐pug)
– SCSS → CSS (build‐scss)
– JS source → bundled JS (build‐scripts)
– Static assets copied (build‐assets)
– All outputs → dist/
– Dev Server reads dist/, serves to browser, watches src/ for changes → triggers rebuild steps → live‐reload browser
c. Architectural Patterns:
– Static‐site generator pipeline
– Clear separation of concerns: templating, styling, scripting, assets
– Task‐based build system
d. Technologies & Frameworks:
– Node.js & npm as orchestrator
– Pug (templating)
– Sass/SCSS (styling)
– Bootstrap (UI framework)
– Plain JavaScript + any browser APIs
– Optional live‐reload tool (Browsersync or custom watcher)

##### Key Details to Capture
- The separation between author‐facing `src/` and deployable `dist/`.
- The role of the `scripts/` folder as the customizable build pipeline.
- The live‐reload dev server’s loop between dist and src.
- External dependencies like Node/npm, Pug, Sass, and Bootstrap.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Layer
    subgraph "Source Layer"
        direction TB
        PugTemplates["Pug Templates"]:::source
        SCSS["SCSS Stylesheets"]:::source
        JSFiles["JavaScript Scripts"]:::source
        Assets["Static Assets (Images)"]:::source
    end

    %% Build Toolchain
    subgraph "Build Toolchain" 
        direction TB
        Clean["Clean Output Directory"]:::task
        BuildPug["Build Pug Task"]:::task
        BuildScss["Build SCSS Task"]:::task
        BuildScripts["Build Scripts Task"]:::task
        BuildAssets["Build Assets Task"]:::task
        RenderPug["Render Helpers: Pug"]:::task
        RenderScss["Render Helpers: SCSS"]:::task
        RenderScripts["Render Helpers: Scripts"]:::task
        RenderAssets["Render Helpers: Assets"]:::task
        Watcher["Watcher / Live-Reload"]:::task
    end

    %% Output Layer
    subgraph "Output Layer"
        direction TB
        DistFolder["dist/ (Generated Output)"]:::output
        HTML["Generated HTML"]:::output
        CSS["Generated CSS"]:::output
        JSOut["Generated JS"]:::output
        AssetsOut["Copied Assets"]:::output
    end

    %% Dev Server & Deployment
    subgraph "Dev Server & Deployment"
        direction TB
        DevServer["Dev Server & Live-Reload"]:::server
        CDN["Static Hosting (CDN/GitHub Pages)"]:::external
        Browser["Browser"]:::external
    end

    %% Orchestration
    Orchestrator["package.json (npm scripts)"]:::external

    %% Data Flows
    PugTemplates -->|triggers| BuildPug
    SCSS -->|triggers| BuildScss
    JSFiles -->|triggers| BuildScripts
    Assets -->|triggers| BuildAssets

    BuildPug -->|uses| RenderPug --> DistFolder
    BuildScss -->|uses| RenderScss --> DistFolder
    BuildScripts -->|uses| RenderScripts --> DistFolder
    BuildAssets -->|uses| RenderAssets --> DistFolder

    Clean --> BuildPug
    Clean --> BuildScss
    Clean --> BuildScripts
    Clean --> BuildAssets

    Watcher -->|on change| BuildPug
    Watcher -->|on change| BuildScss
    Watcher -->|on change| BuildScripts
    Watcher -->|on change| BuildAssets
    Watcher --> DevServer

    DistFolder --> HTML
    DistFolder --> CSS
    DistFolder --> JSOut
    DistFolder --> AssetsOut

    DistFolder --> DevServer
    DevServer -->|serves| Browser
    Browser -->|interacts| DevServer

    DistFolder -->|deploys| CDN

    Orchestrator --> Clean
    Orchestrator --> BuildPug
    Orchestrator --> BuildScss
    Orchestrator --> BuildScripts
    Orchestrator --> BuildAssets
    Orchestrator --> Watcher
    Orchestrator --> DevServer

    %% Click Events
    click PugTemplates "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/src/pug/index.pug"
    click SCSS "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/src/scss/styles.scss"
    click JSFiles "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/src/js/scripts.js"
    click Assets "https://github.com/startbootstrap/startbootstrap-landing-page/tree/master/src/assets/img/"
    click BuildPug "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/build-pug.js"
    click BuildScss "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/build-scss.js"
    click BuildScripts "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/build-scripts.js"
    click BuildAssets "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/build-assets.js"
    click Clean "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/clean.js"
    click RenderPug "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/render-pug.js"
    click RenderScss "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/render-scss.js"
    click RenderScripts "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/render-scripts.js"
    click RenderAssets "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/render-assets.js"
    click Watcher "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/sb-watch.js"
    click DevServer "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/scripts/start.js"
    click HTML "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/dist/index.html"
    click CSS "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/dist/css/styles.css"
    click JSOut "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/dist/js/scripts.js"
    click AssetsOut "https://github.com/startbootstrap/startbootstrap-landing-page/tree/master/dist/assets/img/"
    click Orchestrator "https://github.com/startbootstrap/startbootstrap-landing-page/blob/master/package.json"

    %% Styles
    classDef source fill:#cce5ff,stroke:#0366d6,color:#0366d6;
    classDef task fill:#ffe5cc,stroke:#d66f0a,color:#d66f0a;
    classDef output fill:#d4edda,stroke:#22863a,color:#22863a;
    classDef server fill:#e2e3e5,stroke:#6a737d,color:#6a737d;
    classDef external fill:#f5f5f5,stroke:#bbbbbb,color:#333333;
```
