# kaleguy/leovue architecture

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

- Interactive diagram: https://gitdiagram.com/kaleguy/leovue
- Repository: https://github.com/kaleguy/leovue

## Overview

##### Main Components
- Source Code and Component Layer:
- The src folder contains the heart of the application. Include key submodules:
- Vue Components (e.g., App.vue, Header.vue, Dashboard.vue, specialized components like AccordionViewer.vue, D3Board.vue, Kanban.vue, etc.)
- Content Components (in src/content-components) and specialized libraries (in src/lib) that handle specific rendering tasks (D3 trees, MathJax processing, etc.).
- The Router (src/router) that defines URL routes and navigation.
- Vuex Store (src/store) that manages application state.
- Assets (CSS, SASS files, images) in both src/assets and static.

- Build System & Configuration:
- The build and config directories host Webpack configurations, environment variable files (dev, test, prod), and build scripts. These components are responsible for compiling, bundling, and serving the Vue application.

- Distribution & Deployment:
- The dist folder contains the built production output, including HTML files, static assets, and JavaScript bundles.
- There is also a static site generator feature (accessible via npm run build-static) that creates SEO-friendly HTML pages.
- Deployment scripts/tools such as the build-deploy command prepare the output for Github-Pages.

- External Dependencies & Services:
- Docker support is provided (Dockerfile, .dockerignore) to encapsulate the environment.

- Documentation & Examples:
- The docs and examples directories showcase usage scenarios, live examples, and instructional materials.

##### Establishing Relationships and Interactions
- The core Vue application (in src) makes use of the router and store to manage navigation and state.
- Vue components communicate with content services (src/services) which handle Leo file parsing and content fetching.
- During development and build, Webpack (configured in the build directory) compiles the source files, bundles dependencies, and outputs production files in dist.
- A static site builder process takes an outline (the Leo file) and produces plain HTML pages for SEO, placing them in dist/static.
- Docker is used to package and run the application in a consistent environment.

##### Architectural Patterns & Key Design Principles
- Separation of Concerns: Clear boundaries exist between the view layer (components), business logic (services, store), and configuration/build processes.
- Build and Deployment Flow: The use of Webpack and various configuration files (in config/ and build/) illustrates a systematic approach to environment management (development, production, test).
- Extensibility: The structure supports the addition of new directives and summary node types (for additional data visualizations) without overhauling the overall architecture.

##### Elements
- Clear Labels: Name each component (e.g., “Vue Components”, “Router", “Vuex Store”, “Build Pipeline”, “Static Site Builder”, “Docker Container”).
- Additional Notes: Call out special processes like static site generation for SEO or the role of Docker in deployment scenarios.

## Diagram (Mermaid)

```mermaid
flowchart TD
    user("User Interaction"):::external
    externalDeps("External Dependencies (CDN,npm)"):::external

    subgraph "Presentation Layer"
        vueComponents("Vue Components"):::presentation
        contentComponents("Content Components"):::presentation
        staticAssets("Static Assets"):::presentation
    end

    subgraph "Application Logic Layer"
        router("Router"):::logic
        vuexStore("Vuex Store"):::logic
        appServices("Application Services"):::logic
    end

    subgraph "Build/Configuration Layer"
        buildSys("Build System"):::build
        configFiles("Config Files"):::build
        dockerSupport("Docker Support"):::docker
    end

    subgraph "Distribution & Deployment"
        distArtifacts("Distribution Artifacts"):::deploy
        staticSiteGen("Static Site Generator"):::deploy
        docsExamples("Documentation & Examples"):::deploy
    end

    subgraph "Documentation"
        docs("Docs"):::deploy
        examples("Examples"):::deploy
    end

    %% Interactions
    user -->|"interacts"| vueComponents
    externalDeps -->|"feeds"| vueComponents
    externalDeps -->|"feeds"| appServices

    vueComponents -->|"navigates_via"| router
    vueComponents -->|"displays"| contentComponents
    staticAssets -->|"styles"| vueComponents

    router -->|"updates_state"| vuexStore
    vuexStore -->|"calls"| appServices

    appServices -->|"build_input"| buildSys
    appServices -->|"build_input"| configFiles

    buildSys -->|"compiles_into"| distArtifacts
    configFiles -->|"configures"| buildSys
    buildSys -->|"triggers"| staticSiteGen
    staticSiteGen -->|"generates_SEO_pages"| distArtifacts
    dockerSupport -->|"containers_run"| distArtifacts

    distArtifacts -->|"referenced_by"| docsExamples
    docsExamples -->|"documents"| docs
    docs -->|"coupled_with"| examples

    %% Click Events
    click vueComponents "https://github.com/kaleguy/leovue/tree/master/src/components"
    click contentComponents "https://github.com/kaleguy/leovue/tree/master/src/content-components"
    click router "https://github.com/kaleguy/leovue/blob/master/src/router/index.js"
    click vuexStore "https://github.com/kaleguy/leovue/blob/master/src/store/index.js"
    click appServices "https://github.com/kaleguy/leovue/blob/master/src/services/leo-file.js"
    click staticAssets "https://github.com/kaleguy/leovue/tree/master/src/assets"
    click buildSys "https://github.com/kaleguy/leovue/tree/master/build"
    click configFiles "https://github.com/kaleguy/leovue/blob/master/config/index.js"
    click distArtifacts "https://github.com/kaleguy/leovue/blob/master/dist/index.html"
    click staticSiteGen "https://github.com/kaleguy/leovue/blob/master/build/build-static.es6"
    click dockerSupport "https://github.com/kaleguy/leovue/tree/master/Dockerfile"
    click docs "https://github.com/kaleguy/leovue/tree/master/docs"
    click examples "https://github.com/kaleguy/leovue/tree/master/examples"

    %% Styles
    classDef presentation fill:#e0f7fa,stroke:#333,stroke-width:2px;
    classDef logic fill:#e8f5e9,stroke:#333,stroke-width:2px;
    classDef build fill:#fff3e0,stroke:#333,stroke-width:2px;
    classDef deploy fill:#fce4ec,stroke:#333,stroke-width:2px;
    classDef external fill:#f3e5f5,stroke:#333,stroke-width:2px;
    classDef docker fill:#ede7f6,stroke:#333,stroke-width:2px;
```
