# alexberryman/spelly architecture

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

- Interactive diagram: https://gitdiagram.com/alexberryman/spelly
- Repository: https://github.com/alexberryman/spelly

## Overview

##### Project Type Analysis
This is a frontend-only React application with a focus on component-based architecture and UI/UX. The project uses Storybook for component development and is deployed on AWS infrastructure.

##### Main Components

A. Client-Side Layer:
- React Application Core
- Component Library
- UI Framework Integration

B. Development Tools Layer:
- Storybook Integration
- Component Testing Environment

C. Infrastructure Layer:
- AWS S3 (Static Hosting)
- CloudFront CDN

**[User Browser]**
- ↓
**[CloudFront CDN] → [S3 Bucket]**
- ↓
**[React Application]**

**[Component Layer]**
- Input Component
- Output Component
- Preview Component
- Header Component
- Page Component
- Separator Component
- Platform-specific Components (Slack/Discord)

**[UI Framework Layer]**
- Chakra UI
- Choc UI Components

**[Core Application Layer]**
- App.js
- State Management
- Event Handlers

##### Specific Elements

- Blue: Infrastructure components (CloudFront, S3)
- Green: React components
- Purple: Third-party integrations (Chakra UI, Choc UI)
- Orange: Development tools (Storybook)

b. Component Relationships:
- Data flow between Input → Preview → Output components
- UI framework dependencies
- Separation between presentation and logic

c. Development Environment:
- A separate section showing Storybook's role in component development
- How components are isolated and tested

##### Important Details to Emphasize

- Static Asset Delivery: Show how assets are served through CloudFront
- Component Hierarchy: Illustrate parent-child relationships between components
- State Flow: Demonstrate how user input transforms into emoji output
- Development Workflow: Include Storybook's role in component development

Production Environment:
**[User] → [CloudFront] → [S3] → [React App] → [Components]**

Development Environment:
**[Developer] → [Storybook] → [Component Library] → [Hot Reload]**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Layer"
        User[User Browser]
    end

    subgraph "Infrastructure Layer"
        CDN[CloudFront CDN]:::infra
        S3[S3 Static Hosting]:::infra
    end

    subgraph "React Application"
        App["App.js"]:::core
        click App "https://github.com/alexberryman/spelly/blob/main/src/App.js"
        
        subgraph "Core Components"
            Index["index.js"]:::core
            click Index "https://github.com/alexberryman/spelly/blob/main/src/index.js"
            ServiceWorker["Service Worker"]:::core
            click ServiceWorker "https://github.com/alexberryman/spelly/blob/main/src/serviceWorker.js"
            WebVitals["Web Vitals"]:::core
            click WebVitals "https://github.com/alexberryman/spelly/blob/main/src/reportWebVitals.js"
            ColorMode["Color Mode Switcher"]:::core
            click ColorMode "https://github.com/alexberryman/spelly/blob/main/src/ColorModeSwitcher.js"
        end

        subgraph "Main Components"
            Input["Input Component"]:::component
            click Input "https://github.com/alexberryman/spelly/blob/main/src/stories/Input.jsx"
            Output["Output Component"]:::component
            click Output "https://github.com/alexberryman/spelly/blob/main/src/stories/Output.jsx"
            Preview["Preview Component"]:::component
            click Preview "https://github.com/alexberryman/spelly/blob/main/src/stories/Preview.jsx"
            Header["Header Component"]:::component
            click Header "https://github.com/alexberryman/spelly/blob/main/src/stories/Header.jsx"
            Page["Page Component"]:::component
            click Page "https://github.com/alexberryman/spelly/blob/main/src/stories/Page.jsx"
            Separator["Separator Component"]:::component
            click Separator "https://github.com/alexberryman/spelly/blob/main/src/stories/Separator.jsx"
            Content["Content Component"]:::component
            click Content "https://github.com/alexberryman/spelly/blob/main/src/stories/Content.jsx"
        end

        subgraph "Platform Integration"
            Slack["Slack Integration"]:::platform
            click Slack "https://github.com/alexberryman/spelly/blob/main/src/stories/Slack.jsx"
            Discord["Discord Integration"]:::platform
            click Discord "https://github.com/alexberryman/spelly/blob/main/src/stories/Discord.jsx"
            SlackAssets["Slack Assets"]:::assets
            click SlackAssets "https://github.com/alexberryman/spelly/tree/main/src/stories/assets/slack"
            DiscordAssets["Discord Assets"]:::assets
            click DiscordAssets "https://github.com/alexberryman/spelly/tree/main/src/stories/assets/discord"
        end

        subgraph "UI Framework"
            ChakraUI["Chakra UI"]:::ui
            ChocUI["Choc UI"]:::ui
        end
    end

    subgraph "Development Environment"
        Storybook["Storybook"]:::dev
        click Storybook "https://github.com/alexberryman/spelly/blob/main/.storybook/main.js"
        StorybookPreview["Storybook Preview"]:::dev
        click StorybookPreview "https://github.com/alexberryman/spelly/blob/main/.storybook/preview.js"
        TestUtils["Testing Utilities"]:::testing
        click TestUtils "https://github.com/alexberryman/spelly/blob/main/src/test-utils.js"
        TestSetup["Test Setup"]:::testing
        click TestSetup "https://github.com/alexberryman/spelly/blob/main/src/setupTests.js"
    end

    %% Relationships
    User --> CDN
    CDN --> S3
    S3 --> App
    App --> Index
    Index --> ServiceWorker
    Index --> WebVitals
    App --> ColorMode
    
    Input --> Preview
    Preview --> Output
    Header --> Page
    Page --> Content
    Content --> Separator
    
    Slack --> SlackAssets
    Discord --> DiscordAssets
    
    ChakraUI --> App
    ChocUI --> App
    
    Storybook --> StorybookPreview
    TestUtils --> TestSetup

    %% Styles
    classDef infra fill:#1E88E5,color:white
    classDef core fill:#43A047,color:white
    classDef component fill:#66BB6A,color:white
    classDef platform fill:#FFA726,color:white
    classDef assets fill:#FFB74D,color:white
    classDef ui fill:#9575CD,color:white
    classDef dev fill:#FF7043,color:white
    classDef testing fill:#F06292,color:white

    %% Legend
    subgraph Legend
        L1[Infrastructure]:::infra
        L2[Core]:::core
        L3[Components]:::component
        L4[Platform]:::platform
        L5[Assets]:::assets
        L6[UI Framework]:::ui
        L7[Development]:::dev
        L8[Testing]:::testing
    end
```
