# zuramai/mazer architecture

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

- Interactive diagram: https://gitdiagram.com/zuramai/mazer
- Repository: https://github.com/zuramai/mazer

## Overview

##### Project Type and Purpose
- This is a **static front-end admin dashboard template** built with **Bootstrap 5**, **SCSS**, and **Vanilla JS**, packaged and served via **Vite** (with Docker support). There is **no backend**—it’s purely client-side assets and HTML templates.

##### File Structure
- Top-level build/config files:
- Dockerfile, .dockerignore
- vite.config.js, package.json
- Source folder (`src/`):
- HTML pages and layout templates (`*.html`, `layouts/`, `partials/`)
- JSON files for menus (`sidebar-items.json`, `horizontal-menu-items.json`)
- Assets:
– SCSS modules under `assets/scss/` (variables, components, pages, themes)
– JavaScript under `assets/js/` (application logic)
– Static assets under `assets/static/` (fonts, images, static JS)
- Build scripts & workflows in `.github/workflows/` for demo, release, stale checks.

##### README for Additional Insights
- **Dev workflow**: `npm install` → `npm run dev` (Vite dev server at localhost:5173)
- **Production**: `npm run build` outputs compiled CSS/JS; can be served via Docker container or CDN.
- **External libs**: ApexCharts, Perfect Scrollbar, various editors (Quill, CKEditor), Leaflet, Datatables, SweetAlert2, Toastify, Iconly, Dripicons.

##### Main Components & Their Relationships
a. Developer Workstation
- Source code (HTML/SCSS/JS)
- Vite tool + Node.js/npm
b. Build Pipeline (Vite)
- Reads SCSS modules, JS modules, HTML entry points
- Outputs compiled assets (CSS, JS), optimized HTML
c. Asset Bundles
- `dist/` folder (production bundle)
d. Deployment Targets
- Static file server (Nginx inside Docker)
- CDN (jsdelivr) for compiled assets
e. End User Browser
- Requests HTML → pulls CSS/JS → renders dashboard

##### Important Architectural Patterns
- **Modular SCSS**: `components/`, `pages/`, `themes/`—compile into a single app.css and app-dark.css.
- **Vanilla JS modules**: `assets/js/app.js` handles global behaviors; `assets/static/js/pages/*.js` for per-page scripts.
- **Template-based HTML**: Reusable `layouts/` and `partials/` for consistent header/sidebar/footer.
- **CI/CD**: GitHub workflows for demo site, releases, stale PR management.

##### Detailed Capture of Essential Elements
- Don’t just lump “Assets” together; separate CSS pipeline, JS pipeline, and HTML templating.
- That the SCSS tree under `assets/scss` and JS under `assets/static/js/pages` feed into distinct bundles.
- Two CSS outputs: `app.css` and `app-dark.css` (theme switching via `initTheme.js`).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Workstation" 
        direction TB
        DevWS["Developer Workstation"]:::dev
        PKG["package.json"]:::dev
        VITECFG["vite.config.js"]:::dev
    end

    click PKG "https://github.com/zuramai/mazer/blob/main/package.json"
    click VITECFG "https://github.com/zuramai/mazer/blob/main/vite.config.js"

    %% Source Code
    subgraph "Source Code" 
        direction TB
        %% HTML Templates
        HTML["HTML Templates"]:::dev
        LAYOUTS["src/layouts/"]:::dev
        PARTIALS["src/partials/"]:::dev

        %% JSON Menus
        SIDEBARJSON["sidebar-items.json"]:::dev
        HORJSON["horizontal-menu-items.json"]:::dev

        %% SCSS Modules
        SCSS_APP["src/assets/scss/app.scss"]:::dev
        SCSS_BOOT["src/assets/scss/bootstrap.scss"]:::dev
        SCSS_VARS["_variables.scss"]:::dev
        SCSS_UTIL["_utilities.scss"]:::dev
        SCSS_FONTS["_fonts.scss"]:::dev
        SCSS_MAZER["_mazer.scss"]:::dev
        SCSS_COMP["src/assets/scss/components/"]:::dev
        SCSS_PAGES["src/assets/scss/pages/"]:::dev
        SCSS_THEMES["src/assets/scss/themes/dark/"]:::dev
        SCSS_WIDGETS["src/assets/scss/widgets/"]:::dev

        %% JS Modules
        JS_APP["src/assets/js/app.js"]:::dev
        JS_MAZER["src/assets/js/mazer.js"]:::dev

        %% Static Assets
        SFONTS["src/assets/static/fonts/"]:::dev
        SIMAGES["src/assets/static/images/"]:::dev
        SCOMP["src/assets/static/js/components/"]:::dev
        SHELPER["src/assets/static/js/helper/isDesktop.js"]:::dev
        SINIT["src/assets/static/js/initTheme.js"]:::dev
        SPAGES["src/assets/static/js/pages/"]:::dev
    end

    click LAYOUTS "https://github.com/zuramai/mazer/tree/main/src/layouts/"
    click PARTIALS "https://github.com/zuramai/mazer/tree/main/src/partials/"
    click SIDEBARJSON "https://github.com/zuramai/mazer/blob/main/src/sidebar-items.json"
    click HORJSON "https://github.com/zuramai/mazer/blob/main/src/horizontal-menu-items.json"
    click SCSS_APP "https://github.com/zuramai/mazer/blob/main/src/assets/scss/app.scss"
    click SCSS_BOOT "https://github.com/zuramai/mazer/blob/main/src/assets/scss/bootstrap.scss"
    click SCSS_VARS "https://github.com/zuramai/mazer/blob/main/src/assets/scss/_variables.scss"
    click SCSS_UTIL "https://github.com/zuramai/mazer/blob/main/src/assets/scss/_utilities.scss"
    click SCSS_FONTS "https://github.com/zuramai/mazer/blob/main/src/assets/scss/_fonts.scss"
    click SCSS_MAZER "https://github.com/zuramai/mazer/blob/main/src/assets/scss/_mazer.scss"
    click SCSS_COMP "https://github.com/zuramai/mazer/tree/main/src/assets/scss/components/"
    click SCSS_PAGES "https://github.com/zuramai/mazer/tree/main/src/assets/scss/pages/"
    click SCSS_THEMES "https://github.com/zuramai/mazer/tree/main/src/assets/scss/themes/dark/"
    click SCSS_WIDGETS "https://github.com/zuramai/mazer/tree/main/src/assets/scss/widgets/"
    click JS_APP "https://github.com/zuramai/mazer/blob/main/src/assets/js/app.js"
    click JS_MAZER "https://github.com/zuramai/mazer/blob/main/src/assets/js/mazer.js"
    click SFONTS "https://github.com/zuramai/mazer/tree/main/src/assets/static/fonts/"
    click SIMAGES "https://github.com/zuramai/mazer/tree/main/src/assets/static/images/"
    click SCOMP "https://github.com/zuramai/mazer/tree/main/src/assets/static/js/components/"
    click SHELPER "https://github.com/zuramai/mazer/blob/main/src/assets/static/js/helper/isDesktop.js"
    click SINIT "https://github.com/zuramai/mazer/blob/main/src/assets/static/js/initTheme.js"
    click SPAGES "https://github.com/zuramai/mazer/tree/main/src/assets/static/js/pages/"

    %% Build & CI
    subgraph "Build & CI" 
        direction TB
        VITE_DEV["Vite Dev Server\n(Node.js + Vite)"]:::buildCI
        VITE_BUILD["Vite Build Tool"]:::buildCI
        GH_ACTIONS["GitHub Actions\n(demo.yml, release.yml, stale.yml)"]:::buildCI
    end

    click GH_ACTIONS "https://github.com/zuramai/mazer/blob/main/.github/workflows/demo.yml"
    click GH_ACTIONS "https://github.com/zuramai/mazer/blob/main/.github/workflows/release.yml"
    click GH_ACTIONS "https://github.com/zuramai/mazer/blob/main/.github/workflows/stale.yml"

    %% Production / Hosting
    subgraph "Production Hosting" 
        direction TB
        DIST["dist/ (Bundle)"]:::prod
        DOCKER["Docker + Nginx"]:::prod
        CDN["CDN\n(jsdelivr)"]:::prod
    end

    click DOCKER "https://github.com/zuramai/mazer/tree/main/Dockerfile"
    click DOCKER "https://github.com/zuramai/mazer/blob/main/.dockerignore"

    %% Runtime
    Browser["End User Browser"]:::runtime

    %% Relationships
    DevWS -->|develops| HTML
    DevWS -->|develops| SCSS_APP
    DevWS -->|develops| JS_APP
    DevWS -->|runs npm run dev| VITE_DEV
    HTML -->|served by| VITE_DEV
    SCSS_APP -->|compiled by| VITE_DEV
    JS_APP -->|bundled by| VITE_DEV
    VITE_DEV -->|live reload| Browser

    DevWS -->|runs npm run build| VITE_BUILD
    HTML -->|input to| VITE_BUILD
    SCSS_APP -->|input to| VITE_BUILD
    JS_APP -->|input to| VITE_BUILD
    SIDEBARJSON -->|input to| VITE_BUILD
    HORJSON -->|input to| VITE_BUILD
    VITE_BUILD -->|outputs| DIST

    GH_ACTIONS -->|triggers build| VITE_BUILD
    GH_ACTIONS -->|deploy demo| DOCKER

    DIST -->|deployed to| DOCKER
    DIST -->|published to| CDN

    Browser -->|GET HTML/assets| DOCKER
    Browser -->|GET CSS/JS| CDN

    %% Styles
    classDef dev fill:#E3F2FD,stroke:#90CAF9,color:#0D47A1
    classDef buildCI fill:#FFF3E0,stroke:#FFB74D,color:#E65100
    classDef prod fill:#E8F5E9,stroke:#66BB6A,color:#1B5E20
    classDef runtime fill:#F3E5F5,stroke:#BA68C8,color:#4A148C
```
