# wai-technologies/raaghu-react architecture

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

- Interactive diagram: https://gitdiagram.com/wai-technologies/raaghu-react
- Repository: https://github.com/wai-technologies/raaghu-react

## Overview

##### Main Components
- UI Component Libraries – Display separate packages:
- Raaghu Components: The core set of React UI components (with subdirectories for a wide range of components).
- Raaghu Elements: More granular elements (found under “raaghu-elements” with its own testing, build configuration, etc.).
- Raaghu Layouts: Components used for app shells and layout management.
- Raaghu Pages: Demo or example pages that integrate the design system.
- Raaghu React Themes: The thematic layer (styles, assets, and theme configurations).
- Documentation & Demo:
- Storybook: Used for testing, visual documentation, and design inspection.
- Online Docs & README: Provide detailed guidance on component usage and integration.
- Build & Continuous Integration:
- CI/CD Pipelines: GitHub workflows (npm_publish.yml, storybookreact.yml, etc.) run tests, build, and deploy packages.
- Build Tools: Rollup configuration in each package and Vite used in “raaghu-pages”.
- Design & Integration:
- Figma and Figma Code Connect: Not in the code per se, but an external integration point that links the Figma design kit with code components.
- Chromatic visual testing pipelines: Ensuring component quality.
- Development Tooling & Utilities:
- Various configuration files (.eslintrc, tsconfig, npm configs) and utility scripts (install-all.js, start-scripts.js) that set up the local development environment and deploy flows.

##### Relationships and Interactions
- The “raaghu-components” package provides building blocks that “raaghu-pages” (or demo apps) use.
- The “raaghu-react-themes” package supplies theming data and style configurations that are used by the component libraries.
- CI/CD pipelines (GitHub workflows) are connected to the packages: they trigger tests (Chromatic, Jest), build processes (Rollup, Vite), and ultimately publish updated packages to npm.
- External integration with Figma is an “input” channel: Designers update Figma assets/design kits that later integrate into the system via Figma Code Connect.

##### Architectural Patterns and Design Principles
- Modular & Component‐Driven Architecture: Separate packages encapsulate UI components, layouts, themes, and pages.
- Separation of Concerns: Design artifacts (Figma, design tokens) are connected to code through specialized integrations.
- CI/CD and Automated Testing: Emphasize the use of GitHub workflows and visual testing (Chromatic) to ensure component quality.
- Use of Modern Build Tools: Vite and Rollup streamline bundling while TypeScript enforces strong typing across modules.

##### Relevant Technologies
- React and TypeScript as the core languages.
- Storybook for component documentation.
- Vite (for “raaghu-pages”) and Rollup (for building component libraries) as the bundlers.
- CI/CD using GitHub Actions, with configuration files from .github/workflows.
- Figma integration (through design kits and Figma Code Connect).
- Chromatic for visual regression testing.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Design & Integration Layer
    subgraph "Design & Integration"
        A["Figma Design Kit"]:::external
        B["Figma Code Connect"]:::external
        C["Chromatic Testing"]:::external
    end

    %% UI Component Libraries
    subgraph "UI Component Libraries"
        D["Raaghu Components Package"]:::package
        E["Raaghu Elements Package"]:::package
        F["Raaghu Layouts Package"]:::package
        G["Raaghu React Themes Package"]:::package
    end

    %% Documentation & Testing
    subgraph "Documentation & Testing"
        H["Storybook (Documentation & Visual Testing)"]:::docs
        I["README.md"]:::docs
        J["Stories"]:::docs
    end

    %% Build & CI/CD
    subgraph "Build & CI/CD"
        K["CI/CD Pipelines (GitHub workflows)"]:::ci
        L["Development Utilities & Build Scripts"]:::ci
    end

    %% Demo/Application Layer
    subgraph "Demo/Application"
        M["Raaghu Pages (Demo/Application)"]:::demo
    end

    %% Relationships
    %% From Design & Integration to UI Packages
    A -->|"feeds"| D
    A -->|"feeds"| E
    A -->|"feeds"| F
    A -->|"feeds"| G

    B -->|"connects"| D
    B -->|"connects"| E
    B -->|"connects"| F
    B -->|"connects"| G

    %% Chromatic Testing supports Storybook
    C -->|"validates"| H

    %% UI Packages interactions
    D -->|"documents"| H
    E -->|"documents"| H
    F -->|"documents"| H
    G -->|"documents"| H

    D -->|"supplies"| M
    E -->|"supplies"| M
    F -->|"supplies"| M
    G -->|"supplies"| M

    %% UI Packages trigger CI/CD pipelines
    D -->|"triggers"| K
    E -->|"triggers"| K
    F -->|"triggers"| K
    G -->|"triggers"| K

    %% CI/CD Build support with Dev Utilities
    L -->|"supports"| K

    %% Documentation & Testing connected to Demo/Application
    H -->|"showcases"| M
    I -->|"guides"| M
    J -->|"guides"| M

    %% Styles
    classDef external fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef package fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
    classDef docs fill:#FCF3CF,stroke:#B7950B,stroke-width:2px;
    classDef ci fill:#D5F5E3,stroke:#1E8449,stroke-width:2px;
    classDef demo fill:#F9E79F,stroke:#B9770E,stroke-width:2px;

    %% Click Events
    click D "https://github.com/wai-technologies/raaghu-react/tree/staging/raaghu-components"
    click E "https://github.com/wai-technologies/raaghu-react/tree/staging/raaghu-elements"
    click F "https://github.com/wai-technologies/raaghu-react/tree/staging/raaghu-layouts"
    click G "https://github.com/wai-technologies/raaghu-react/tree/staging/raaghu-react-themes"
    click M "https://github.com/wai-technologies/raaghu-react/tree/staging/raaghu-pages"
    click H "https://github.com/wai-technologies/raaghu-react/blob/staging/.storybook"
    click K "https://github.com/wai-technologies/raaghu-react/tree/staging/.github/workflows"
    click L "https://github.com/wai-technologies/raaghu-react/tree/staging/utils"
    click I "https://github.com/wai-technologies/raaghu-react/blob/staging/README.md"
    click J "https://github.com/wai-technologies/raaghu-react/tree/staging/stories"
```
