# synetonet/compass-react architecture

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

- Interactive diagram: https://gitdiagram.com/synetonet/compass-react
- Repository: https://github.com/synetonet/compass-react

## Overview

##### Main System Components

a) Component Library Core
- Main component categories:
- Layout Components (Grid, SideNavigation, TitleBar)
- UI Components (Alert, Badge, Button, etc.)
- Form Components (Check, Switch, DatePicker, etc.)
- Data Display Components (Table, Chart, List)
- Overlay Components (Modal, Popover, Toast)

b) Base Architecture
- SCSS Variables and Mixins

c) Build & Distribution System
- Build pipeline:
- Source (src/)
- Compilation (Rollup/Babel)
- Distribution (lib/)

##### Component Architecture

- Component Structure Pattern:
- Component/
- Component.jsx
- Component.scss
- Component.md
- Component.spec.js
- __snapshots__/

##### Integration Points

External integration points:
- NPM Package System
- Consumer Applications
- Documentation System (React Styleguidist)

##### Detailed Component Flow

Component lifecycle:

##### Implementation Details

Technical specifications:
- React Components
- SCSS Styling System
- Jest Testing Framework
- Rollup Bundling
- Styleguidist Documentation

**┌─────────────────────────────────────────────┐**
- Consumer Applications           │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- NPM Package Distribution          │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Component Library              │
- ┬─────────────┬────────────────┤
- Layout    │     UI      │     Form       │
- Components  │ Components  │  Components    │
- ┴─────────────┴────────────────┤
- Base Architecture             │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Build & Test Infrastructure       │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph ConsumerApps["Consumer Applications"]
        App1[React Applications]
    end

    subgraph NPMDist["NPM Package Distribution"]
        Package["Compass Design System Package"]
        CompiledLib["Compiled Library"]:::dist
    end

    subgraph CompLib["Component Library"]
        subgraph Layout["Layout Components"]
            Grid["Grid System"]:::component
            SideNav["Side Navigation"]:::component
            TitleBar["Title Bar"]:::component
        end

        subgraph UI["UI Components"]
            Alert["Alert"]:::component
            Badge["Badge"]:::component
            Button["Button"]:::component
            Card["Card"]:::component
        end

        subgraph Form["Form Components"]
            FormMain["Form"]:::component
            Check["Check"]:::component
            Switch["Switch"]:::component
            DatePicker["DatePicker"]:::component
            ComboBox["ComboBox"]:::component
        end

        subgraph DataDisplay["Data Display Components"]
            Table["Table"]:::component
            Chart["Chart"]:::component
            List["List"]:::component
        end

        subgraph Overlay["Overlay Components"]
            Modal["Modal"]:::component
            Popover["Popover"]:::component
            Toast["Toast"]:::component
            OverlayBase["Overlay"]:::component
        end
    end

    subgraph BaseArch["Base Architecture"]
        BaseStyles["Base Styles"]:::styles
        Colors["Colors"]:::styles
        Variables["Variables"]:::styles
        Mixins["Mixins"]:::styles
        Assets["Asset Management"]:::styles
    end

    subgraph Build["Build & Test Infrastructure"]
        Source["Source Code"]:::build
        Docs["Documentation"]:::docs
        StyleGuide["Style Guide Config"]:::docs
    end

    %% Relationships
    ConsumerApps --> NPMDist
    NPMDist --> CompLib
    CompLib --> BaseArch
    BaseArch --> Build
    Build --> CompiledLib

    %% Click Events
    click Grid "https://github.com/SynetoNet/compass-react/tree/master/src/Layout/Grid/"
    click SideNav "https://github.com/SynetoNet/compass-react/tree/master/src/Layout/SideNavigation/"
    click TitleBar "https://github.com/SynetoNet/compass-react/tree/master/src/Layout/TitleBar/"
    click Alert "https://github.com/SynetoNet/compass-react/tree/master/src/components/Alert/"
    click Badge "https://github.com/SynetoNet/compass-react/tree/master/src/components/Badge/"
    click Button "https://github.com/SynetoNet/compass-react/tree/master/src/components/Button/"
    click Card "https://github.com/SynetoNet/compass-react/tree/master/src/components/Card/"
    click FormMain "https://github.com/SynetoNet/compass-react/tree/master/src/components/Form/"
    click Check "https://github.com/SynetoNet/compass-react/tree/master/src/components/Form/Check/"
    click Switch "https://github.com/SynetoNet/compass-react/tree/master/src/components/Form/Switch/"
    click DatePicker "https://github.com/SynetoNet/compass-react/tree/master/src/components/DatePicker/"
    click ComboBox "https://github.com/SynetoNet/compass-react/tree/master/src/components/ComboBox/"
    click Table "https://github.com/SynetoNet/compass-react/tree/master/src/components/Table/"
    click Chart "https://github.com/SynetoNet/compass-react/tree/master/src/components/Chart/"
    click List "https://github.com/SynetoNet/compass-react/tree/master/src/components/List/"
    click Modal "https://github.com/SynetoNet/compass-react/tree/master/src/components/Modal/"
    click Popover "https://github.com/SynetoNet/compass-react/tree/master/src/components/Popover/"
    click Toast "https://github.com/SynetoNet/compass-react/tree/master/src/components/Toast/"
    click OverlayBase "https://github.com/SynetoNet/compass-react/tree/master/src/components/Overlay/"
    click BaseStyles "https://github.com/SynetoNet/compass-react/blob/master/src/base/styles.scss"
    click Colors "https://github.com/SynetoNet/compass-react/blob/master/src/base/_colors.scss"
    click Variables "https://github.com/SynetoNet/compass-react/blob/master/src/base/_variables.scss"
    click Mixins "https://github.com/SynetoNet/compass-react/blob/master/src/base/_mixins.scss"
    click Assets "https://github.com/SynetoNet/compass-react/tree/master/src/base/assets/"
    click Source "https://github.com/SynetoNet/compass-react/tree/master/src/"
    click CompiledLib "https://github.com/SynetoNet/compass-react/tree/master/lib/"
    click Docs "https://github.com/SynetoNet/compass-react/tree/master/docs/"
    click StyleGuide "https://github.com/SynetoNet/compass-react/blob/master/styleguide.config.js"

    %% Styles
    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef styles fill:#9b59b6,stroke:#8e44ad,color:white
    classDef build fill:#2ecc71,stroke:#27ae60,color:white
    classDef docs fill:#e67e22,stroke:#d35400,color:white
    classDef dist fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        L1["Component"]:::component
        L2["Styles"]:::styles
        L3["Build"]:::build
        L4["Documentation"]:::docs
        L5["Distribution"]:::dist
    end
```
