# toss/slash architecture

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

- Interactive diagram: https://gitdiagram.com/toss/slash
- Repository: https://github.com/toss/slash

## Overview

##### Main Components Identification

The system should be divided into two main package categories:
- Common Packages (Platform-agnostic)
- React Packages (React-specific)

**Level 1: Root (Slash Library)**
**Level 2: Package Categories (Common & React)**
**Level 3: Individual Packages**
**Level 4: Package Dependencies and Interactions**

##### Component Details

Common Packages Section:
- assert (validation utilities)
- crypto (encryption utilities)
- date (date manipulation)
- hangul (Korean language utilities)
- ky (HTTP client)
- sentry (error tracking)
- storage (storage utilities)
- utility-types (TypeScript utilities)
- utils (general utilities)
- validators (validation functions)

React Packages Section:
- a11y (accessibility utilities)
- async-boundary (async error handling)
- emotion-utils (styling utilities)
- error-boundary (error handling)
- framer-motion (animation)
- impression-area (viewport detection)
- lottie (animation)
- react-query (data fetching)
- use-overlay (modal/overlay management)
- use-funnel (step management)
- use-loading (loading state)
- use-query-param (URL parameter management)

##### Relationships

Relationships between:
- Package dependencies
- Integration points
- Shared utilities
- Cross-package functionality

##### Additional Elements

Include:
- Version information
- Migration paths to new packages (es-hangul, es-toolkit, suspensive, use-funnel)
- Build/compilation flow
- Testing infrastructure

##### Notes

Important notes about:
- Legacy status of the project
- Migration paths to new packages
- Maintenance status
- Contribution guidelines

##### Technical Details

Technical specifications:
- TypeScript/JavaScript support
- Browser/Node.js compatibility
- Build system (using Rollup)
- Testing framework (Jest)
- Documentation system (Docusaurus)

##### Legacy status and maintenance information

Remember to include a note about the project's legacy status and the recommendation to contribute to the new separated packages instead.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Root["Slash Library"]
        subgraph Common["Common Packages"]
            Assert["Assert"]:::common
            Crypto["Crypto"]:::common
            Date["Date"]:::common
            Hangul["Hangul"]:::common
            Ky["Ky"]:::common
            Sentry["Sentry"]:::common
            Storage["Storage"]:::common
            UtilityTypes["Utility Types"]:::common
            Utils["Utils"]:::common
            Validators["Validators"]:::common
        end

        subgraph React["React Packages"]
            A11y["A11y"]:::react
            AsyncBoundary["Async Boundary"]:::react
            EmotionUtils["Emotion Utils"]:::react
            ErrorBoundary["Error Boundary"]:::react
            FramerMotion["Framer Motion"]:::react
            ImpressionArea["Impression Area"]:::react
            Lottie["Lottie"]:::react
            ReactQuery["React Query"]:::react
            UseOverlay["Use Overlay"]:::react
            UseFunnel["Use Funnel"]:::react
            UseLoading["Use Loading"]:::react
            UseQueryParam["Use Query Param"]:::react
        end

        subgraph Infrastructure["Build & Documentation"]
            Docs["Documentation"]:::infra
            BuildConfig["Build Configuration"]:::infra
            TestConfig["Test Configuration"]:::infra
        end
    end

    %% Common Package Dependencies
    Utils --> Assert
    Utils --> Validators
    Hangul --> Utils
    Ky --> Utils
    Storage --> Utils
    Sentry --> Utils

    %% React Package Dependencies
    AsyncBoundary --> ErrorBoundary
    UseOverlay --> ReactQuery
    UseLoading --> ReactQuery
    EmotionUtils --> FramerMotion
    ImpressionArea --> Utils
    UseQueryParam --> Utils

    %% Infrastructure Dependencies
    BuildConfig --> Root
    TestConfig --> BuildConfig
    Docs --> Root

    %% Click Events for Common Packages
    click Assert "https://github.com/toss/slash/tree/main/packages/common/assert/src"
    click Crypto "https://github.com/toss/slash/tree/main/packages/common/crypto/src"
    click Date "https://github.com/toss/slash/tree/main/packages/common/date/src"
    click Hangul "https://github.com/toss/slash/tree/main/packages/common/hangul/src"
    click Ky "https://github.com/toss/slash/tree/main/packages/common/ky/src"
    click Sentry "https://github.com/toss/slash/tree/main/packages/common/sentry/src"
    click Storage "https://github.com/toss/slash/tree/main/packages/common/storage/src"
    click UtilityTypes "https://github.com/toss/slash/tree/main/packages/common/utility-types/src"
    click Utils "https://github.com/toss/slash/tree/main/packages/common/utils/src"
    click Validators "https://github.com/toss/slash/tree/main/packages/common/validators/src"

    %% Click Events for React Packages
    click A11y "https://github.com/toss/slash/tree/main/packages/react/a11y/src"
    click AsyncBoundary "https://github.com/toss/slash/tree/main/packages/react/async-boundary/src"
    click EmotionUtils "https://github.com/toss/slash/tree/main/packages/react/emotion-utils/src"
    click ErrorBoundary "https://github.com/toss/slash/tree/main/packages/react/error-boundary/src"
    click FramerMotion "https://github.com/toss/slash/tree/main/packages/react/framer-motion/src"
    click ImpressionArea "https://github.com/toss/slash/tree/main/packages/react/impression-area/src"
    click Lottie "https://github.com/toss/slash/tree/main/packages/react/lottie/src"
    click ReactQuery "https://github.com/toss/slash/tree/main/packages/react/react-query/src"
    click UseOverlay "https://github.com/toss/slash/tree/main/packages/react/use-overlay/src"
    click UseFunnel "https://github.com/toss/slash/tree/main/packages/react/use-funnel/src"
    click UseLoading "https://github.com/toss/slash/tree/main/packages/react/use-loading/src"
    click UseQueryParam "https://github.com/toss/slash/tree/main/packages/react/use-query-param/src"

    %% Click Events for Infrastructure
    click Docs "https://github.com/toss/slash/tree/main/docs/"
    click BuildConfig "https://github.com/toss/slash/tree/main/configs/"
    click TestConfig "https://github.com/toss/slash/tree/main/configs/jest"

    %% Styling
    classDef common fill:#dae8fc,stroke:#6c8ebf
    classDef react fill:#d5e8d4,stroke:#82b366
    classDef infra fill:#fff2cc,stroke:#d6b656
    classDef deprecated stroke:#ff0000,stroke-width:2px
    classDef migration fill:#ffe6cc,stroke:#d79b00
```
