# sixelasacul/pharaon architecture

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

- Interactive diagram: https://gitdiagram.com/sixelasacul/pharaon
- Repository: https://github.com/sixelasacul/pharaon

## Overview

##### Main System Components

A. Frontend Application (Single Page Application)
- User Interface Layer
- State Management Layer
- Utility Services Layer

##### Component Organization

The UI Layer should be represented as follows:

- User Interface     |

- App                  |
- Title             |
- Lyrics            |
- Palettes          |
- Metadata          |
- History           |
- QuickActions      |
- ShareButton       |

##### State Management Layer

Two main state management systems:

- State Management     |

- UserSelectionContext  |
- ShareableStore        |

##### Utilities Layer

Utility services:

- Utility Services     |

- Parser               |
- Compressor           |
- Share                |
- History              |

##### Component Relationships
- How UserSelectionContext provides state to child components
- How utilities are consumed by both UI and state layers

##### Technical Stack Indicators
- Badges or labels for:
- React + TypeScript
- Vite
- Tailwind CSS
- shadcn/ui components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#e6f3ff,stroke:#4a90e2
    classDef state fill:#e6ffe6,stroke:#2ecc71
    classDef util fill:#fff3e6,stroke:#f39c12
    classDef external fill:#f5e6ff,stroke:#9b59b6

    %% Legend
    subgraph Legend
        UI[🔷 React Components]:::ui
        SM[🔶 State Management]:::state
        UT[🔸 Utility Functions]:::util
        DF[➡️ Data Flow]
        SU[⇢ State Updates]
        CD[⇠ Dependencies]
    end

    %% Frontend Application
    subgraph "Frontend Application"
        %% UI Layer
        subgraph "User Interface Layer"
            App["App"]:::ui
            Title["Title"]:::ui
            Lyrics["Lyrics"]:::ui
            Palettes["Palettes"]:::ui
            Metadata["Metadata"]:::ui
            History["History"]:::ui
            QuickActions["QuickActions"]:::ui
            ShareButton["ShareButton"]:::ui
            SyllableProc["Syllable Processing"]:::ui
            ColorPalette["Color Palette System"]:::ui
            TempoPalette["Tempo Palette"]:::ui
            StateSync["State Sync"]:::ui
        end

        %% State Management Layer
        subgraph "State Management Layer"
            UserContext["UserSelectionContext"]:::state
            ShareStore["ShareableStore"]:::state
        end

        %% Utility Services Layer
        subgraph "Utility Services Layer"
            Parser["Parser"]:::util
            Compressor["Compressor"]:::util
            ShareUtil["Share"]:::util
            HistoryUtil["History"]:::util
        end
    end

    %% Relationships
    App --> Title
    App --> Lyrics
    App --> Palettes
    App --> Metadata
    App --> History
    App --> QuickActions
    App --> ShareButton
    App --> StateSync

    Palettes --> ColorPalette
    Palettes --> TempoPalette

    UserContext -.-> App
    UserContext -.-> Lyrics
    UserContext -.-> Palettes

    ShareStore -.-> StateSync
    ShareStore -.-> ShareButton

    Parser --> Lyrics
    Compressor --> ShareUtil
    ShareUtil --> ShareButton
    HistoryUtil --> History

    %% Click Events
    click App "https://github.com/sixelasacul/pharaon/blob/main/src/components/App/App.tsx"
    click Title "https://github.com/sixelasacul/pharaon/blob/main/src/components/Title/Title.tsx"
    click Lyrics "https://github.com/sixelasacul/pharaon/blob/main/src/components/Lyrics/Lyrics.tsx"
    click Palettes "https://github.com/sixelasacul/pharaon/blob/main/src/components/Palettes/Palettes.tsx"
    click Metadata "https://github.com/sixelasacul/pharaon/blob/main/src/components/Metadata/Metadata.tsx"
    click History "https://github.com/sixelasacul/pharaon/blob/main/src/components/History/History.tsx"
    click QuickActions "https://github.com/sixelasacul/pharaon/blob/main/src/components/QuickActions/QuickActions.tsx"
    click ShareButton "https://github.com/sixelasacul/pharaon/blob/main/src/components/ShareButton/ShareButton.tsx"
    click UserContext "https://github.com/sixelasacul/pharaon/blob/main/src/state/UserSelectionContext/UserSelectionContext.tsx"
    click ShareStore "https://github.com/sixelasacul/pharaon/blob/main/src/state/shareableStore/shareableStore.ts"
    click Parser "https://github.com/sixelasacul/pharaon/blob/main/src/utils/parser.ts"
    click Compressor "https://github.com/sixelasacul/pharaon/blob/main/src/utils/compressor.ts"
    click ShareUtil "https://github.com/sixelasacul/pharaon/blob/main/src/utils/share.ts"
    click HistoryUtil "https://github.com/sixelasacul/pharaon/blob/main/src/utils/history.ts"
    click SyllableProc "https://github.com/sixelasacul/pharaon/blob/main/src/components/Syllable/Syllable.tsx"
    click ColorPalette "https://github.com/sixelasacul/pharaon/blob/main/src/components/Palettes/ColorPalette.tsx"
    click TempoPalette "https://github.com/sixelasacul/pharaon/blob/main/src/components/Palettes/TempoPalette.tsx"
    click StateSync "https://github.com/sixelasacul/pharaon/blob/main/src/components/App/SyncStore.tsx"
```
