# priceline/design-system architecture

> Architecture diagram of the GitHub repository priceline/design-system, 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/priceline/design-system
- Repository: https://github.com/priceline/design-system

## Overview

##### Primary Components
- Monorepo Structure & Package Management:
– Centralized configuration with Rush (rush.json, common/config/rush)
– Common tools and scripts (common/scripts, tools, and rigs directories)
- UI Component Packages:
– Supporting codemods (packages/codemods) and interoperability helpers
- Applications for Demos & Documentation:
– “apps/docs” folder, which provides the integrated documentation website (with Next.js, ESLint, etc.)
– “apps/storybook” folder used to run and display Storybook stories for live component demos
- CI/CD and Quality Assurance:
– GitHub workflows (in the .github/workflows folder) for CI/CD, publishing, and code quality (CodeQL, etc.)
– Testing and linting configurations spread throughout (e.g., .eslintrc.js, jest.config.js files)

##### Relationships and Interactions
- The monorepo (managed with Rush) acts as the central hub coordinating multiple component packages and shared configuration.
- The UI component packages are designed to be independent but may share common design tokens (theme files) and helper utilities. They are consumed by both the documentation site and Storybook.
- The apps (docs and Storybook) serve as demonstration and reference points for all the reusable components. They import the packages to render live examples and keep usage guidelines up to date.
- The CI/CD pipelines (via GitHub workflows) monitor code quality and execute build, test, and publish routines, ensuring the design system always meets the standards set by the project.

##### Architectural Patterns & Design Principles
- Modularization: Each UI element is developed in isolation (each residing in its own package) and then integrated.
- Separation of Concerns: There is a clear distinction between design artifacts (UI component packages) and presentation (documentation site and Storybook).
- Consistency & Reusability: Shared configurations, theming, and custom tools (like codemods and heft plugins) support consistent coding practices and visual language.
- Automated Quality Assurance: CI/CD tools ensure that linting, testing (unit tests and snapshots), and build processes are automated across all packages.

##### Relevant Technologies, Frameworks, & Tools
- React (with Storybook as the visual documentation platform)
- TypeScript/Javascript along with ESLint, Jest, and Prettier
- Build & Package Management via Rush, with supporting Babel and ESLint configurations
- GitHub Actions for CI/CD, and tools like CodeQL for security analysis

- Components:
– Monorepo & Tooling (Rush, common, tools, rigs, and GitHub workflows)
– Presentation Apps (docs site and Storybook)
- Labels and Descriptions:
- Interaction Flows:
– Illustrate the CI/CD pipeline interacting with the monorepo and triggering builds/tests.
- Visual Aids:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD Layer
    CI["CI/CD Pipeline"]:::cicd
    click CI "https://github.com/priceline/design-system/tree/main/.github/workflows"
    
    %% Monorepo & Tooling Layer
    subgraph "Monorepo & Tooling"
        M_rush["rush.json"]:::monorepo
        click M_rush "https://github.com/priceline/design-system/blob/main/rush.json"
        M_config["common/config/rush"]:::monorepo
        click M_config "https://github.com/priceline/design-system/tree/main/common/config/rush"
        M_scripts["common/scripts"]:::monorepo
        click M_scripts "https://github.com/priceline/design-system/tree/main/common/scripts"
        M_tools["tools"]:::monorepo
        click M_tools "https://github.com/priceline/design-system/tree/main/tools"
        M_rigs["rigs"]:::monorepo
        click M_rigs "https://github.com/priceline/design-system/tree/main/rigs"
        MT_Agg["Monorepo Aggregate"]:::monorepo
    end

    %% UI Component Packages Layer
    subgraph "UI Component Packages"
        C_core["Core Components"]:::components
        click C_core "https://github.com/priceline/design-system/tree/main/packages/core"
        C_icons["UI Icons"]:::components
        click C_icons "https://github.com/priceline/design-system/tree/main/packages/icons"
        C_menu["Navigational Menu"]:::components
        click C_menu "https://github.com/priceline/design-system/tree/main/packages/menu"
        C_modal["Modal Components"]:::components
        click C_modal "https://github.com/priceline/design-system/tree/main/packages/modal"
        C_popover["Popover Components"]:::components
        click C_popover "https://github.com/priceline/design-system/tree/main/packages/popover"
        C_slider["Slider Components"]:::components
        click C_slider "https://github.com/priceline/design-system/tree/main/packages/slider"
        C_codemods["Codemods"]:::components
        click C_codemods "https://github.com/priceline/design-system/tree/main/packages/codemods"
        UI_Agg["UI Components Aggregate"]:::components
    end

    %% Presentation Apps Layer
    subgraph "Presentation Applications"
        A_docs["Documentation Site"]:::apps
        click A_docs "https://github.com/priceline/design-system/tree/main/apps/docs"
        A_storybook["Storybook"]:::apps
        click A_storybook "https://github.com/priceline/design-system/tree/main/apps/storybook"
    end

    %% Connections from CI/CD to Monorepo Aggregate
    CI -->|"triggers_build&test"| MT_Agg

    %% Aggregate monorepo: connecting individual nodes to the Monorepo Aggregate
    M_rush --> MT_Agg
    M_config --> MT_Agg
    M_scripts --> MT_Agg
    M_tools --> MT_Agg
    M_rigs --> MT_Agg

    %% Connection from Monorepo layer to UI Components Aggregate
    MT_Agg -->|"provides_tools&config"| UI_Agg

    %% Connecting individual UI packages to UI Components Aggregate
    C_core --> UI_Agg
    C_icons --> UI_Agg
    C_menu --> UI_Agg
    C_modal --> UI_Agg
    C_popover --> UI_Agg
    C_slider --> UI_Agg
    C_codemods --> UI_Agg

    %% Connecting UI Components Aggregate to Presentation Applications
    UI_Agg -->|"import_components"| A_docs
    UI_Agg -->|"import_components"| A_storybook

    %% Styles
    classDef monorepo fill:#DDEEFF,stroke:#333,stroke-width:2px;
    classDef components fill:#CCFFCC,stroke:#333,stroke-width:2px;
    classDef apps fill:#FFDDCC,stroke:#333,stroke-width:2px;
    classDef cicd fill:#FFE6CC,stroke:#333,stroke-width:2px;
```
