# nasa-jpl/stellar architecture

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

- Interactive diagram: https://gitdiagram.com/nasa-jpl/stellar
- Repository: https://github.com/nasa-jpl/stellar

## Overview

##### Main Components
- Monorepo (Stellar Design System) – At the highest level, represent the overall repository and its infrastructure.
- Packages:
– React Package: Implements reusable React components (with storybook, rollup build config, component directories for Alerts, Buttons, Input, etc.).
– Svelte Package: Provides Svelte-based UI components, including examples, configuration files, and routes for demo purposes.
- Core Infrastructure & CI/CD:
– Build and deployment workflows (GitHub Actions for deploy-to-gh-pages and publish-to-npm).
– Shared configuration files (e.g., .npmrc, lerna.json, ESLint, Prettier, Stylelint configs).
- Documentation:
– Developer docs in the “docs” directory and developer guide in docs/DEVELOPER.md.
– README and other guidelines (LICENSE, CODE_OF_CONDUCT, SECURITY, etc.).

##### Relationships and Interactions
- CI/CD pipelines (GitHub Actions) as an external process node that interacts with the monorepo for building, testing, and deploying packages.

##### Architectural Patterns and Tools
- Monorepo structure with Lerna handling multi-package management.
- Use of component-based design in React and Svelte (with directories for individual UI components).
- Emphasis on cross-framework consistency: the CSS package is the foundation, and React/Svelte packages provide framework-specific wrappers.
- Build scripts, configuration files, and versioning are set up for automated publishing and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Stellar_Monorepo["Stellar Monorepo"]:::monorepo

    subgraph "Packages"
        CSS_Package["CSS Package"]:::package
        React_Package["React Package"]:::package
        Svelte_Package["Svelte Package"]:::package
    end

    subgraph "Published Artifacts"
        npm_CSS["@nasa-jpl/stellar (npm)"]:::external
        npm_React["@nasa-jpl/stellar-react (npm)"]:::external
        npm_Svelte["@nasa-jpl/stellar-svelte (npm)"]:::external
    end

    CI_CD["CI/CD (GitHub Actions)"]:::tool
    Shared_Config["Shared Configuration Files"]:::tool
    Documentation["Documentation & Guidelines"]:::external

    %% Main Relationships
    Stellar_Monorepo -->|"contains"| CSS_Package
    Stellar_Monorepo -->|"contains"| React_Package
    Stellar_Monorepo -->|"contains"| Svelte_Package

    CSS_Package -->|"publishes"| npm_CSS
    React_Package -->|"publishes"| npm_React
    Svelte_Package -->|"publishes"| npm_Svelte

    CSS_Package -->|"providesStyling"| React_Package
    CSS_Package -->|"providesStyling"| Svelte_Package

    CI_CD -->|"buildTestDeploy"| Stellar_Monorepo
    Stellar_Monorepo -->|"uses"| Shared_Config
    Stellar_Monorepo -->|"includes"| Documentation

    %% Click Events
    click Stellar_Monorepo "https://github.com/nasa-jpl/stellar/tree/develop/Root directory"
    click CSS_Package "https://github.com/nasa-jpl/stellar/tree/develop/packages/css"
    click React_Package "https://github.com/nasa-jpl/stellar/tree/develop/packages/react"
    click Svelte_Package "https://github.com/nasa-jpl/stellar/tree/develop/packages/svelte"
    click CI_CD "https://github.com/nasa-jpl/stellar/tree/develop/.github/workflows"
    click Shared_Config "https://github.com/nasa-jpl/stellar/blob/develop/lerna.json"
    click Documentation "https://github.com/nasa-jpl/stellar/tree/develop/docs"

    %% Styles
    classDef monorepo fill:#f9c,stroke:#333,stroke-width:2px;
    classDef package fill:#bbf,stroke:#333,stroke-width:2px;
    classDef external fill:#cfc,stroke:#333,stroke-width:2px;
    classDef tool fill:#fc9,stroke:#333,stroke-width:2px;
```
