# uniontic/dockview architecture

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

- Interactive diagram: https://gitdiagram.com/uniontic/dockview
- Repository: https://github.com/uniontic/dockview

## Overview

##### Project type & purpose
- An open-source, monorepo toolkit (“dockview”) providing a zero-dependency core layout manager plus framework-specific adapters (Vanilla TS, React, Vue, Angular) and documentation/website.
- Key use cases: embed dockable panels, grids, split-views in web apps; serialize/deserialize layouts; pop-out windows; themeing.

##### High-level components
- Monorepo root (Lerna + shared config + CI scripts)
- Core library (packages/dockview-core)
- Framework adapters (packages/dockview, dockview-react, dockview-vue, dockview-angular)
- Documentation website (packages/docs – Docusaurus + live sandboxes + generated API docs)
- Templates & sandboxes (packages/docs/sandboxes & packages/templates): example projects
- Tooling & pipelines:
– Build tools: Gulp, Rollup, TypeScript compiler
– Test runner: Jest (with jest.config.ts at root & per-package)
– Doc generator: TypeDoc + Docusaurus
– CI/CD: GitHub Actions (code-analysis, build, test, publish, deploy-docs)
– Package manager: Lerna orchestrates per-package lifecycles
– Registry: npm for package publishing
– Version control: GitHub

##### Dependency & interaction relationships
- Core → published to npm → imported by all adapters and by docs/examples
- Adapters → depend on core → build via Rollup (produce ESM/CJS bundles + .d.ts) → published to npm
- Docs site → depends on adapters/core to render live examples → built by Docusaurus → deployed to GitHub Pages or Vercel
- Templates & sandboxes → sample consumers of adapters → live in docs repo & templates folder
- CI workflows → triggered on push/PR → run linters, tests (Jest), build (Rollup, Gulp), docs build, publish to npm & deploy docs

##### Architectural patterns & design principles
- Monorepo with Lerna for unified versioning & cross-package bootstrapping
- Core + adapters: an “adapter pattern” enabling framework-specific rendering with a shared core API
- Separation of concerns:
– Core: pure layout logic, no UI framework dependencies
– Adapters: glue logic + minimal abstraction for React/Vue/Angular/Vanilla
– Docs/templates: demonstration layer, static site generation
- High test coverage: unit tests in each package’s src/__tests__ folder
- CI as source of truth: reproducible builds, security checks, automatic publishes

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Monorepo Root
    subgraph "Monorepo Root"
        Root["Monorepo Root"]:::ci
    end

    %% Core & Adapters
    subgraph "Core & Adapters"
        Core["packages/dockview-core\n(Core Library)"]:::core
        Vanilla["packages/dockview\n(Vanilla TS Adapter)"]:::adapters
        React["packages/dockview-react\n(React Adapter)"]:::adapters
        Vue["packages/dockview-vue\n(Vue Adapter)"]:::adapters
        Angular["packages/dockview-angular\n(Angular Adapter)"]:::adapters
    end

    %% Docs & Examples
    subgraph "Docs & Examples"
        Docs["packages/docs\n(Documentation Site)"]:::docs
        Sandboxes["packages/docs/sandboxes\n(Live Sandboxes)"]:::docs
        Templates["packages/templates\n(Example Templates)"]:::docs
    end

    %% CI/CD & Tooling
    subgraph "CI/CD & Tooling"
        CI["GitHub Actions\n(CI/CD Pipeline)"]:::ci
        Tools["Build & Test Tools\n(Gulp, Rollup, Jest)"]:::ci
    end

    %% External Services
    subgraph "External Services"
        GH["GitHub"]:::external
        NG["npm Registry"]:::external
        Host["Docs Hosting\n(GitHub Pages / Vercel)"]:::external
    end

    %% Relationships
    GH -->|triggers| CI
    CI -->|runs on| Root
    CI -->|uses| Tools
    CI -->|publish| NG
    CI -->|deploy docs| Host

    Root -->|orchestrates| Core
    Root -->|orchestrates| Vanilla
    Root -->|orchestrates| React
    Root -->|orchestrates| Vue
    Root -->|orchestrates| Angular
    Root -->|orchestrates| Docs
    Root -->|orchestrates| Sandboxes
    Root -->|orchestrates| Templates

    Tools -->|build/test| Core
    Tools -->|build/test| Vanilla
    Tools -->|build/test| React
    Tools -->|build/test| Vue
    Tools -->|build/test| Angular
    Tools -->|build docs| Docs

    Core -->|import| Vanilla
    Core -->|import| React
    Core -->|import| Vue
    Core -->|import| Angular

    Vanilla -->|publish| NG
    React -->|publish| NG
    Vue -->|publish| NG
    Angular -->|publish| NG

    Docs -->|use| Core
    Docs -->|use| Vanilla
    Docs -->|use| React
    Docs -->|use| Vue
    Docs -->|use| Angular

    Sandboxes -->|sample| Vanilla
    Sandboxes -->|sample| React
    Sandboxes -->|sample| Vue
    Sandboxes -->|sample| Angular

    Templates -->|sample| Vanilla
    Templates -->|sample| React
    Templates -->|sample| Vue
    Templates -->|sample| Angular

    classDef core fill:#daf0ff,stroke:#333,stroke-width:1px;
    classDef adapters fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef docs fill:#ffe5b4,stroke:#333,stroke-width:1px;
    classDef ci fill:#e0e0e0,stroke:#333,stroke-width:1px;
    classDef external fill:#f8f9fa,stroke-dasharray: 5 5,stroke:#333,stroke-width:1px;

    %% Click Events
    click Root "https://github.com/uniontic/dockview/blob/master/lerna.json"
    click Core "https://github.com/uniontic/dockview/tree/master/packages/dockview-core/"
    click Vanilla "https://github.com/uniontic/dockview/tree/master/packages/dockview/"
    click React "https://github.com/uniontic/dockview/tree/master/packages/dockview-react/"
    click Vue "https://github.com/uniontic/dockview/tree/master/packages/dockview-vue/"
    click Angular "https://github.com/uniontic/dockview/tree/master/packages/dockview-angular/"
    click Docs "https://github.com/uniontic/dockview/tree/master/packages/docs/"
    click Sandboxes "https://github.com/uniontic/dockview/tree/master/packages/docs/sandboxes/"
    click Templates "https://github.com/uniontic/dockview/tree/master/packages/templates/"
```
