# labimotion/chem-generic-ui architecture

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

- Interactive diagram: https://gitdiagram.com/labimotion/chem-generic-ui
- Repository: https://github.com/labimotion/chem-generic-ui

## Overview

##### Project Type and Purpose
- chem-generic-ui is an open-source React component library (delivered via NPM) for dynamically building rich, drag-and-drop UIs (especially in chemistry informatics contexts, e.g., LabIMotion).
- It contains a large set of feature-driven components (designer, details, dnd, fields, flow, table, models, etc.), SCSS assets, test suites, and utility modules for template handling, flow arrangement, table building, etc.

##### File‐Structure Analysis
- Top-level packaging and CI
- package.json, ts.json, .tool-versions
- GitHub workflows (ci.yml)
- Source code under src/
- entry.js: single entry point exporting the library API
- assets/: SCSS files and images (styles are compiled into CSS)
- utils/: low-level helpers (template handlers, flow builders, table source builders, build scripts)
- __test__/: unit tests for components
- README.md documents installation, purpose, and showcases example usage.

##### Key Insights from README
- The library is installed via NPM/Yarn and consumed by host apps (e.g., LabIMotion).
- Flexible layout designs, drag-and-drop, rich UI primitives.
- No backend—pure frontend component library.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Swimlanes
    subgraph "Runtime"
        HostApp["Host Application (React App)"]:::external
        chemNPM["chem-generic-ui NPM Package"]:::frontend
        Entry["Entry Module"]:::frontend
        subgraph "UI Components"
            Designer["Designer Components"]:::frontend
            Details["Details Components"]:::frontend
            DnD["Drag-and-Drop Components (DnD)"]:::frontend
            Elements["Form Elements Components"]:::frontend
            Fields["Field Controls Components"]:::frontend
            FlowComp["Workflow/Flow Components"]:::frontend
            TableComp["Table Components"]:::frontend
            Admin["Admin Extension Components"]:::frontend
            Addon["Add-on Extension Components"]:::frontend
            Repo["Repository Components"]:::frontend
            Shared["Shared Utility Components"]:::frontend
            Icons["Icon Set"]:::frontend
            Layers["Layer Components"]:::frontend
            Models["Data Models"]:::frontend
            Temp["Temporary Static Data"]:::frontend
            ToolsComp["Tools & Helpers"]:::frontend
        end
        subgraph "Utilities"
            TemplateUtil["Template Utilities"]:::utils
            FlowUtil["Flow Utilities"]:::utils
            TableUtil["Table Utilities"]:::utils
            BuildTS["Build & TS Utilities"]:::utils
        end
        Assets["SCSS Assets & Images"]:::assets
    end

    subgraph "Build & Deploy"
        Tests["Testing Suite"]:::test
        CI["CI/CD Pipeline"]:::ci
        NPMReg["NPM Registry"]:::external
    end

    %% Relationships
    HostApp -->|"imports"| chemNPM
    chemNPM -->|"provides"| Entry
    Entry -->|"exports APIs to"| Designer
    Entry -->|"exports APIs to"| Details
    Entry -->|"exports APIs to"| DnD
    Entry -->|"exports APIs to"| Elements
    Entry -->|"exports APIs to"| Fields
    Entry -->|"exports APIs to"| FlowComp
    Entry -->|"exports APIs to"| TableComp
    Entry -->|"exports APIs to"| Admin
    Entry -->|"exports APIs to"| Addon
    Entry -->|"exports APIs to"| Repo
    Entry -->|"exports APIs to"| Shared
    Entry -->|"exports APIs to"| Icons
    Entry -->|"exports APIs to"| Layers
    Entry -->|"exports APIs to"| Models
    Entry -->|"exports APIs to"| Temp
    Entry -->|"exports APIs to"| ToolsComp

    Designer -->|"uses"| TemplateUtil
    Details -->|"uses"| TemplateUtil
    DnD -->|"uses"| FlowUtil
    FlowComp -->|"uses"| FlowUtil
    TableComp -->|"uses"| TableUtil
    ToolsComp -->|"uses"| BuildTS

    Designer -->|"loads styles from"| Assets
    Details -->|"loads styles from"| Assets
    DnD -->|"loads styles from"| Assets
    Elements -->|"loads styles from"| Assets
    Fields -->|"loads styles from"| Assets
    FlowComp -->|"loads styles from"| Assets
    TableComp -->|"loads styles from"| Assets

    Tests -->|"tests"| Designer
    Tests -->|"tests"| Details
    Tests -->|"tests"| DnD
    Tests -->|"tests"| Elements
    Tests -->|"tests"| Fields
    Tests -->|"tests"| FlowComp
    Tests -->|"tests"| TableComp
    Tests -->|"tests"| TemplateUtil
    Tests -->|"tests"| FlowUtil
    Tests -->|"tests"| TableUtil

    CI -->|"runs"| Tests
    CI -->|"publishes"| chemNPM
    CI -->|"publishes to"| NPMReg

    %% Click Events
    click chemNPM "https://github.com/labimotion/chem-generic-ui/blob/main/package.json"
    click Entry "https://github.com/labimotion/chem-generic-ui/blob/main/src/entry.js"
    click Designer "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/designer/"
    click Details "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/details/"
    click DnD "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/dnd/"
    click Elements "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/elements/"
    click Fields "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/fields/"
    click FlowComp "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/flow/"
    click TableComp "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/table/"
    click Admin "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/admin/"
    click Addon "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/addon/"
    click Repo "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/repo/"
    click Shared "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/shared/"
    click Icons "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/icons/"
    click Layers "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/layers/"
    click Models "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/models/"
    click Temp "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/temp/"
    click ToolsComp "https://github.com/labimotion/chem-generic-ui/tree/main/src/components/tools/"
    click TemplateUtil "https://github.com/labimotion/chem-generic-ui/tree/main/src/utils/template/"
    click FlowUtil "https://github.com/labimotion/chem-generic-ui/tree/main/src/utils/flow/"
    click TableUtil "https://github.com/labimotion/chem-generic-ui/tree/main/src/utils/table/"
    click BuildTS "https://github.com/labimotion/chem-generic-ui/blob/main/src/utils/build-ts.js"
    click Tests "https://github.com/labimotion/chem-generic-ui/tree/main/src/__test__/"
    click CI "https://github.com/labimotion/chem-generic-ui/blob/main/.github/workflows/ci.yml"

    %% Styles
    classDef frontend fill:#f9f,stroke:#333,stroke-width:1px
    classDef utils fill:#bbf,stroke:#333,stroke-width:1px
    classDef assets fill:#bfb,stroke:#333,stroke-width:1px
    classDef test fill:#ffd,stroke:#333,stroke-dasharray: 5 5
    classDef ci fill:#fdd,stroke:#f00,stroke-dasharray: 5 5
    classDef external fill:#ddb,stroke:#333,stroke-width:1px
```
