# swan-io/lake architecture

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

- Interactive diagram: https://gitdiagram.com/swan-io/lake
- Repository: https://github.com/swan-io/lake

## Overview

##### Main System Components

a) Core Component Library (Lake Package):
- Component Layer
- Hooks Layer
- Utils Layer
- Assets & Constants

b) Business Components Package:
- Business-specific Components
- Business Logic & Utils
- Localization System
- Business Constants

c) Development & Build Infrastructure:
- Storybook Integration
- Build System (Vite)
- Testing Framework
- CI/CD Pipeline

##### Component Architecture Representation

a) Use a layered architecture approach:
- [Development Tools Layer]

- [Component Packages Layer]

- [Core Infrastructure Layer]

- Blue: Core UI components
- Green: Business components
- Yellow: Development tools
- Gray: Infrastructure components

##### Specific Component Relationships

Key relationships:

**Storybook Demo Layer**
- ↑
**UI Components ←→ Business Components**
- ↓
**Shared Infrastructure**
- ↓
**Build & Deploy Pipeline**

##### Important Elements

a) Core Package (lake):
- Component hierarchy
- Shared utilities
- Hooks system

b) Business Package (shared-business):
- Business component relationship with core
- Localization system
- File handling system
- Modal & Toast systems

##### Integration Points

Clear connections for:
- Storybook integration with components
- Testing infrastructure
- Build system pipeline
- Asset management system

##### Technical Details

Annotations for:
- TypeScript integration
- CSS/styling system
- Asset management
- Internationalization
- Testing framework

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Development Tools Layer"
        SB["Storybook Integration"]
        BS["Build System (Vite)"]
        CI["CI/CD Pipeline"]
        TF["Testing Framework"]
    end

    subgraph "Component Packages Layer"
        subgraph "Core Package (lake)"
            CL["Core Component Library"]
            HL["Hooks Layer"]
            UL["Utils Layer"]
            AC["Assets & Constants"]
            IS["Icons System"]
            CS["Component Stories"]
        end

        subgraph "Business Package (shared-business)"
            BC["Business Components"]
            BU["Business Utils"]
            LS["Localization System"]
            BCo["Business Constants"]
            BCS["Business Component Stories"]
        end
    end

    subgraph "Core Infrastructure Layer"
        TS["TypeScript"]
        CSS["CSS/Styling"]
        AM["Asset Management"]
        I18N["Internationalization"]
    end

    %% Relationships
    CL --> HL
    CL --> UL
    CL --> IS
    CL --> AC
    BC --> CL
    BC --> LS
    BC --> BU
    BC --> BCo
    
    SB --> CS
    SB --> BCS
    BS --> CL
    BS --> BC
    TF --> UL
    CI --> BS

    %% Click Events
    click CL "https://github.com/swan-io/lake/tree/main/packages/lake/src/components"
    click HL "https://github.com/swan-io/lake/tree/main/packages/lake/src/hooks"
    click UL "https://github.com/swan-io/lake/tree/main/packages/lake/src/utils"
    click AC "https://github.com/swan-io/lake/tree/main/packages/lake/src/assets"
    click IS "https://github.com/swan-io/lake/tree/main/packages/lake/src/icons"
    click BC "https://github.com/swan-io/lake/tree/main/packages/shared-business/src/components"
    click BCo "https://github.com/swan-io/lake/tree/main/packages/shared-business/src/constants"
    click LS "https://github.com/swan-io/lake/tree/main/packages/shared-business/src/locales"
    click SB "https://github.com/swan-io/lake/blob/main/.storybook"
    click BS "https://github.com/swan-io/lake/blob/main/vite.config.ts"
    click CI "https://github.com/swan-io/lake/tree/main/.github/workflows"
    click TF "https://github.com/swan-io/lake/tree/main/packages/lake/src/utils/__tests__"
    click BU "https://github.com/swan-io/lake/tree/main/packages/shared-business/src/utils"
    click CS "https://github.com/swan-io/lake/tree/main/packages/lake/__stories__"
    click BCS "https://github.com/swan-io/lake/tree/main/packages/shared-business/__stories__"

    %% Styling
    classDef core fill:#blue,stroke:#333,stroke-width:2px
    classDef business fill:#green,stroke:#333,stroke-width:2px
    classDef tools fill:#yellow,stroke:#333,stroke-width:2px
    classDef infra fill:#gray,stroke:#333,stroke-width:2px

    class CL,HL,UL,AC,IS,CS core
    class BC,BU,LS,BCo,BCS business
    class SB,BS,CI,TF tools
    class TS,CSS,AM,I18N infra
```
