# cheesegrinder/poppy-ui architecture

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

- Interactive diagram: https://gitdiagram.com/cheesegrinder/poppy-ui
- Repository: https://github.com/cheesegrinder/poppy-ui

## Overview

##### Main Components
- Monorepo Container – Representing the overall repository that houses all packages and shared configurations.
- Core Package – This is the foundation that contains the actual Web Components (buttons, dropdowns, modals, etc.), styling, assets, and utility functions.
- Framework Wrappers:
– Angular Package – A wrapper that adapts the core components to Angular.
– React Package – A wrapper that adapts the core components to React.
– Vue Package – A wrapper that adapts the core components to Vue.
- Documentation Package – Although less central to runtime, it’s a separate package providing guides and API documentation.
- Test Directories – Representing testing configurations and sample applications for React and Vue, which illustrate usage examples.
- Developer Tools & Configurations – Include the configuration files (like .editorconfig, tsconfig.json, npm workspace setups) that tie the monorepo together.

##### Relationships and Interactions
- The Core Package is central and is built using Stencil, which compiles the shared Web Components. From it, the output is fed into the different framework wrappers.
- Each framework package (Angular, React, Vue) depends on the Core Package. They essentially wrap the core components to provide idiomatic integration.
- Developers interact with the individual packages depending on their target framework.
- There is a build process (invoked via npm scripts) that powers the development and packaging workflow. Note that CI/CD related aspects should be left out as per the instructions.
- The monorepo structure (npm workspaces) ensures that dependencies for all packages are installed in a single node_modules and shared where possible.

##### Important Architectural Patterns/Design Principles
- Modular Design – The separation of core Web Components from the framework-specific wrappers.
- Code Reusability – The core package is shared across Angular, React, and Vue.
- Monorepo Management – Using npm workspaces to reduce redundancy, encourage shared dependencies, and simplify dependency management.
- Encapsulation of Styles and Components – The styles, themes, global CSS, and utility functions support consistency across all wrappers.
- Layered Architecture – At the bottom is the core, then the wrappers adapt/extend functionality, and finally the tests and documentation add both quality assurance and guidance for usage.

##### Technologies, Frameworks, and Libraries
- Stencil – Used for compiling and generating Web Components.
- Web Components/Custom Elements – The core technology behind the UI components.
- Daisy UI – Provides styling and UI enhancements.
- Frameworks: Angular, React, and Vue – Each has a dedicated wrapper to integrate the core package.
- npm Workspaces – Manages the monorepo setup.
- Supporting Tools: Node, npm, TypeScript, and configuration files such as tsconfig and eslint (if present).

##### Elements
– Monorepo Container
– Core Package (Stencil-generated Web Components)
– Angular Wrapper Package
– React Wrapper Package
– Vue Wrapper Package
– Documentation and Examples (e.g., tests)
- Visual Distinctions:
– Ensure labels include technology names (Stencil, Angular, React, Vue) where relevant.
- Annotations or legends if needed, to note that this design omits CI/CD details.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Monorepo Container
    MonorepoContainer["Monorepo Container"]:::container

    %% Monorepo Structure
    subgraph "Monorepo Structure"
        DevConfig["Developer Tools & Configurations"]:::config
        Core["Core Package (Stencil Web Components)"]:::core
        AngularWrapper["Angular Wrapper Package"]:::wrapper
        ReactWrapper["React Wrapper Package"]:::wrapper
        VueWrapper["Vue Wrapper Package"]:::wrapper
        Docs["Documentation Package"]:::docs
    end

    %% Test Examples
    subgraph "Test Examples"
        ReactTest["React Test Directory"]:::test
        VueTest["Vue Test Directory"]:::test
    end

    %% Relationships: Monorepo includes configuration and packages
    MonorepoContainer -->|"includes"| DevConfig
    MonorepoContainer -->|"includes"| Core
    MonorepoContainer -->|"includes"| AngularWrapper
    MonorepoContainer -->|"includes"| ReactWrapper
    MonorepoContainer -->|"includes"| VueWrapper
    MonorepoContainer -->|"includes"| Docs

    %% Core Package provides Web Components to each framework wrapper
    Core -->|"provides_Web_Components"| AngularWrapper
    Core -->|"provides_Web_Components"| ReactWrapper
    Core -->|"provides_Web_Components"| VueWrapper

    %% Wrapper packages include test directories (where applicable)
    ReactWrapper -->|"includes_tests"| ReactTest
    VueWrapper -->|"includes_tests"| VueTest

    %% Click Events
    click MonorepoContainer "https://github.com/cheesegrinder/poppy-ui/tree/main/Root repository (all top-level directories and files)"
    click Core "https://github.com/cheesegrinder/poppy-ui/tree/main/packages/core"
    click AngularWrapper "https://github.com/cheesegrinder/poppy-ui/tree/main/packages/angular-workspace/projects/component-library"
    click ReactWrapper "https://github.com/cheesegrinder/poppy-ui/tree/main/packages/react"
    click VueWrapper "https://github.com/cheesegrinder/poppy-ui/tree/main/packages/vue"
    click Docs "https://github.com/cheesegrinder/poppy-ui/tree/main/packages/docs"
    click ReactTest "https://github.com/cheesegrinder/poppy-ui/tree/main/tests/react"
    click VueTest "https://github.com/cheesegrinder/poppy-ui/tree/main/tests/vue"
    click DevConfig "https://github.com/cheesegrinder/poppy-ui/blob/main/Root configuration files (e.g., .editorconfig, package.json, tsconfig.json, biome.jsonc)"

    %% Styles
    classDef container fill:#AED6F1,stroke:#1B4F72,stroke-width:2px,color:#1B4F72;
    classDef core fill:#F9E79F,stroke:#B7950B,stroke-width:2px,color:#B7950B;
    classDef wrapper fill:#D5F5E3,stroke:#1E8449,stroke-width:2px,color:#1E8449;
    classDef docs fill:#F5EEF8,stroke:#8E44AD,stroke-width:2px,color:#8E44AD;
    classDef test fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px,color:#F1C40F;
    classDef config fill:#EBDEF0,stroke:#8E44AD,stroke-width:2px,color:#8E44AD;
```
