# ringcentral/juno architecture

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

- Interactive diagram: https://gitdiagram.com/ringcentral/juno
- Repository: https://github.com/ringcentral/juno

## Overview

##### Main Components (Building Blocks)
- Monorepo Structure: Represent the high-level repository as a container that holds multiple “packages” or modules.
⁃ juno-core – your main React UI components
⁃ juno-framer – Framer-specific component implementations with design tweaks
⁃ juno-storybook – Interactive Storybook instance including docs, live demos, MDX documentation, and theming examples
⁃ juno-test – Testing utilities and sample test runner modules
- Foundation and Themes: Include a node for the “foundation” layer (e.g. theming, styled-components integration, utility functions, global styles, and configuration files) that is referenced by the components packages.

##### Integration & Relationships
⁃ TypeScript configuration (tsconfig.json files) across packages
⁃ Build scripts (in the “scripts” folder, including bundling, releases, package generation, documentation conversion using typedoc-mdx)
⁃ Linting, testing (jest setup, setup files in tests folder) and type declaration generation
- Development Workflow & CI/CD: Optionally, add nodes for continuous integration (GitHub workflows) and versioning scripts (release automation) that ensure consistency across all packages.

##### Data Flow & Interaction Patterns
- Documentation & Demo: Illustrate how the Storybook package is used to provide interactive examples and serves as a living documentation layer that reads component stories and MDX docs from various packages.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Monorepo Structure
    subgraph "Monorepo Structure"
        core["juno-core (React UI Components)"]:::ui
        icon["juno-icon (SVG Icons & Tools)"]:::ui
        framer["juno-framer (Framer-specific Components)"]:::ui
        storybook["juno-storybook (Docs & Demos)"]:::ui
        test["juno-test (Testing Utilities)"]:::ui
    end

    %% Foundation and Theming
    subgraph "Foundation & Theming"
        foundation["Foundation (styled-components, global styles)"]:::foundation
    end

    %% Runtime Layer
    subgraph "Runtime Layer"
        themeProvider["RcThemeProvider (Theme Wrapper)"]:::runtime
    end

    %% Build & Tooling
    subgraph "Build & Tooling"
        buildTool["Build & Tooling (TS config, scripts, etc.)"]:::tools
    end

    %% CI/CD
    subgraph "CI/CD"
        cicd["CI/CD (GitHub Workflows, Release Automation)"]:::tools
    end

    %% Relationships and Data Flow
    foundation -->|"providesTheme"| core
    icon -->|"suppliesIcons"| core
    themeProvider -->|"wraps"| core
    framer -->|"adapts"| core
    core -->|"importsDocs"| storybook
    storybook -->|"readsStoriesFrom"| core
    test -->|"runsTestsVia"| buildTool
    buildTool -->|"triggeredBy"| cicd

    %% Click Events
    click core "https://github.com/ringcentral/juno/tree/main/packages/juno-core"
    click icon "https://github.com/ringcentral/juno/tree/main/packages/juno-icon"
    click framer "https://github.com/ringcentral/juno/tree/main/packages/juno-framer"
    click storybook "https://github.com/ringcentral/juno/tree/main/packages/juno-storybook"
    click test "https://github.com/ringcentral/juno/tree/main/packages/juno-test"
    click foundation "https://github.com/ringcentral/juno/tree/main/packages/juno-core/src/foundation"
    click buildTool "https://github.com/ringcentral/juno/tree/main/scripts"

    %% Styles
    classDef ui fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef foundation fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef runtime fill:#FFF9C4,stroke:#FBC02D,stroke-width:2px;
    classDef tools fill:#FFCDD2,stroke:#C62828,stroke-width:2px;
```
