# nelson820125/jordium-gantt-vue3 architecture

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

- Interactive diagram: https://gitdiagram.com/nelson820125/jordium-gantt-vue3
- Repository: https://github.com/nelson820125/jordium-gantt-vue3

## Overview

##### Project Type & Purpose
- This is a Vue 3 + TypeScript component library (“jordium-gantt-vue3”) that exposes a Gantt chart UI component.
- It ships as an npm package and is demonstrated via two demo apps (`demo/` and `packageDemo/`).
- There’s no backend—this is purely a UI library with build/config pipelines, documentation, and CI/CD for publishing to npm and GitHub Pages.

##### High-Level File Structure Analysis
- **src/**: Core library source
- components/ (GanttChart.vue, TaskList.vue, Timeline.vue, TaskBar.vue, MilestonePoint.vue, …)
- models/ (data classes and config interfaces)
- composables/ (useI18n, useMessage)
- utils/ (predecessorUtils)
- styles/ (CSS, theme variables)
- index.ts (export entry)
- **demo/** & **packageDemo/**: Two demo applications that consume the built library locally
- **docs/** & **design/**: Documentation and UI mockups
- **.github/workflows/**: CI/CD pipeline (build, test, deploy to GitHub Pages)
- **vite.config.lib.ts** & **vite.config.ts**: Build configurations for library and demos
- **package.json**: Scripts for dev, build:lib, test, deploy

##### README Insights
- Exposes a single `<GanttChart>` component with many props/events for tasks, milestones, toolbar, i18n, theming.
- Core abstractions: Task and Milestone (both TypeScript interfaces), TimelineConfig, ToolbarConfig, composables for i18n and messaging.

a. **Main Components**
1. Developer Machine / IDE
2. Source Code Layers
- UI Components
- Models (data types & configs)
- Composables (i18n, message)
- Utils (predecessor logic)
- Styles & Themes
3. Build System (Vite + TypeScript)
4. Distribution Artifacts
- ESM/CJS bundles (`dist/`)
- Type declarations
5. Demo Applications
- Demo A (`demo/`)
- Demo B (`packageDemo/`)
6. CI/CD Pipeline
- GitHub Actions (build/test/publish)
- Deployment to npm and GitHub Pages
7. End User Applications
- Any external Vue 3 app importing `jordium-gantt-vue3`

b. **Relationships & Data Flows**
- Developer updates `src/` → Vite build → `dist/` packages
- Demo apps import built library (or local src alias) → render `<GanttChart>`
- CI pipeline triggers on push → runs tests → publishes npm package → deploys demo on GH Pages
- End users install from npm → import `<GanttChart>` → provide `tasks`, `milestones`, handle events

c. **Architectural Patterns & Principles**
- **Modular Component Design**: Each UI feature (task bar, timeline, toolbar) is a standalone Vue component.
- **Composition API**: Shared logic in composables (i18n, messaging).
- **Type-Safe Model Layer**: Task/Milestone classes and config interfaces decouple data from presentation.
- **Theming & Styles**: CSS variables and theme files allow easy customization.
- **Demo Driven**: Two parallel demo projects validate API and build outputs.
- **CI/CD Automation**: Ensures consistency between source, built artifacts, documentation, and live demo.

d. **Key Technologies**
- Vue 3 Composition API
- TypeScript 5.x
- Vite (library + app modes)
- GitHub Actions for CI/CD
- GitHub Pages for demo hosting
- npm for package distribution

##### Critical Details to Capture
- Separation between **library core** and **demos/clients**
- Build steps and targets (lib vs. demo)
- Data flow: props/events lifecycle inside `<GanttChart>`
- CI/CD triggers and outputs
- Integration points: where users hook into events and theme/i18n composables

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer
    Dev["Developer Machine / IDE"]:::external

    %% Source Code Layer
    subgraph "Source Code" 
        direction TB
        subgraph "UI Components" 
            direction TB
            GC["GanttChart.vue"]:::source
            TL["TaskList.vue"]:::source
            TM["Timeline.vue"]:::source
            TBAR["TaskBar.vue"]:::source
            MP["MilestonePoint.vue"]:::source
            DP["DatePicker.vue"]:::source
            CD["GanttConfirmDialog.vue"]:::source
            GT["GanttToolbar.vue"]:::source
            MD["MilestoneDialog.vue"]:::source
            MPRE["MultiSelectPredecessor.vue"]:::source
            TDW["TaskDrawer.vue"]:::source
            TRW["TaskRow.vue"]:::source
        end
        subgraph "Models" 
            direction TB
            GTY["GanttTypes.ts"]:::source
            TS["Task.ts"]:::source
            MS["Milestone.ts"]:::source
            LG["Language.ts"]:::source
            TC["TimelineConfig.ts"]:::source
            TBC["ToolbarConfig.ts"]:::source
        end
        subgraph "Composables"
            direction TB
            I18["useI18n.ts"]:::source
            MSG["useMessage.ts"]:::source
        end
        SUBUTIL["predecessorUtils.ts"]:::source
        subgraph "Styles"
            direction TB
            APPCSS["app.css"]:::source
            THEME["theme-variables.css"]:::source
        end
        subgraph "Entry Points"
            direction TB
            CE["src/components/index.ts"]:::source
            EI["src/index.ts"]:::source
        end
    end

    %% Build System
    subgraph "Build System" 
        direction TB
        VC_LIB["vite.config.lib.ts"]:::build
        VC_APP["vite.config.ts"]:::build
        VC_PKG["packageDemo/vite.config.ts"]:::build
        Build["Vite + TypeScript Build"]:::build
    end

    %% Distribution Artifacts
    subgraph "Dist Artifacts" 
        direction TB
        DIST["dist/ (ESM/CJS + types)"]:::dist
        NPMPKG["npm Package"]:::dist
    end

    %% Demo Applications
    subgraph "Demo Applications" 
        direction TB
        DemoA["demo/"]:::demo
        DemoB["packageDemo/"]:::demo
    end

    %% End User Consumers
    EndUser["External Vue 3 App"]:::consumer

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        direction TB
        GHActions["GitHub Actions"]:::ci
        DeployNPM["npm Publish"]:::ci
        DeployGH["GitHub Pages Deploy"]:::ci
    end

    %% Flows
    Dev -->|"edit src"| GC
    Dev --> TL
    Dev --> TM
    Dev --> TBAR
    Dev --> MP
    Dev --> DP
    Dev --> CD
    Dev --> GT
    Dev --> MD
    Dev --> MPRE
    Dev --> TDW
    Dev --> TRW
    Dev --> GTY
    Dev --> TS
    Dev --> MS
    Dev --> LG
    Dev --> TC
    Dev --> TBC
    Dev --> I18
    Dev --> MSG
    Dev --> SUBUTIL
    Dev --> APPCSS
    Dev --> THEME
    Dev --> CE
    Dev --> EI

    subgraph buildflow
        direction TB
        CE & EI & GC -->|import| Build
        VC_LIB & VC_APP & VC_PKG --> Build
        Build --> DIST
        DIST --> NPMPKG
    end

    NPMPKG -->|installed| DemoA
    NPMPKG --> DemoB
    DIST --> EndUser

    DemoA -->|import GanttChart| GC
    DemoB -->|import GanttChart| GC
    EndUser -->|import from npm| NPMPKG

    Dev -->|git push| GHActions
    GHActions -->|build & test| Build
    GHActions -->|npm publish| DeployNPM
    GHActions -->|deploy demo| DeployGH
    DeployGH --> DemoA
    DeployGH --> DemoB

    %% Click Events
    click GC "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/GanttChart.vue"
    click TL "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/TaskList.vue"
    click TM "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/Timeline.vue"
    click TBAR "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/TaskBar.vue"
    click MP "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/MilestonePoint.vue"
    click DP "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/DatePicker.vue"
    click CD "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/GanttConfirmDialog.vue"
    click GT "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/GanttToolbar.vue"
    click MD "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/MilestoneDialog.vue"
    click MPRE "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/MultiSelectPredecessor.vue"
    click TDW "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/TaskDrawer.vue"
    click TRW "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/TaskRow.vue"
    click CE "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/components/index.ts"
    click EI "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/index.ts"
    click GTY "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/GanttTypes.ts"
    click TS "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/classes/Task.ts"
    click MS "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/classes/Milestone.ts"
    click LG "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/classes/Language.ts"
    click TC "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/configs/TimelineConfig.ts"
    click TBC "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/models/configs/ToolbarConfig.ts"
    click I18 "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/composables/useI18n.ts"
    click MSG "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/composables/useMessage.ts"
    click SUBUTIL "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/utils/predecessorUtils.ts"
    click APPCSS "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/styles/app.css"
    click THEME "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/src/styles/theme-variables.css"
    click VC_LIB "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/vite.config.lib.ts"
    click VC_APP "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/vite.config.ts"
    click VC_PKG "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/packageDemo/vite.config.ts"
    click DemoA "https://github.com/nelson820125/jordium-gantt-vue3/tree/master/demo/"
    click DemoB "https://github.com/nelson820125/jordium-gantt-vue3/tree/master/packageDemo/"
    click GHActions "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/.github/workflows/deploy-github-pages.yml"
    click DeployNPM "https://github.com/nelson820125/jordium-gantt-vue3/blob/master/package.json"

    %% Styles
    classDef source fill:#BBDEFB,stroke:#1976D2,color:#0D47A1
    classDef build fill:#C8E6C9,stroke:#388E3C,color:#1B5E20
    classDef dist fill:#A5D6A7,stroke:#2E7D32,color:#1B5E20
    classDef demo fill:#E1BEE7,stroke:#8E24AA,color:#4A148C
    classDef consumer fill:#D1C4E9,stroke:#6A1B9A,color:#4A148C
    classDef ci fill:#FFE0B2,stroke:#F57C00,color:#E65100
    classDef external fill:#CFD8DC,stroke:#455A64,color:#263238
```
