# gregoryoviedo/boardrop architecture

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

- Interactive diagram: https://gitdiagram.com/gregoryoviedo/boardrop
- Repository: https://github.com/gregoryoviedo/boardrop

## Overview

##### Main Components
- Overall Application: Represent the main entry point (App.tsx), which integrates all components.
- UI Components: List key UI components found under “src/components” such as:
- AutoResizeTextArea
- Column (likely representing one column of the Kanban board)
- DarkModeIconButton (theme toggle possibly)
- Task (an individual task card)
- Custom Hooks/Logic: Under “src/hooks”, you have:
- useColumnDrop
- useColumnTasks
- useTaskCollection
- useTaskDragAndDrop
These hooks manage the board’s drag-and-drop behavior and state manipulation.
- Configuration: The “src/config” folder (e.g., theme.ts) that configures theming and look-and-feel.
- Utilities: Under “src/utils” are enums, helper functions, logging, and models that support the application behavior.

##### Relationships and Interactions
- The main App.tsx integrates the Core UI components and passes required props and callbacks (probably coming from custom hooks).
- The Components, such as Column and Task, interact with the custom hooks to handle user actions like dragging and dropping.
- Configuration (theme) and utilities under “src/utils” support the dynamic behavior and business logic, indicating a separation of concerns.
- The data flow should be represented from the App containers down to individual UI components, and the hooks should be shown as supporting state and logic layers.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Emphasize how smaller, reusable components (e.g., Task, Column) are combined to form the full UI.
- Separation of Concerns: Show the separation between presentation (components), business logic (hooks), and configuration/utilities.
- Drag-and-Drop Design: Highlight how custom hooks (useTaskDragAndDrop, etc.) encapsulate the drag-and-drop logic.
- Frontend-Only Single-Page Application: All functionalities reside in the client-side application (with Vite bundling).

##### Technologies & Frameworks
- React (with TypeScript) is central.
- Vite for bundling and development.
- ESLint, Prettier configurations ensure code quality.
- The styling/theme might be driven by the “config/theme.ts”.

##### Essential Architectural Elements
- Don’t overcomplicate: clearly separate the application’s UI layer from its logic layer (custom hooks) and supporting utilities.
- To label modules fetched from “src/config” and “src/utils” as they provide context to the configuration and business logic.
- Adding a “rendering/interaction loop” that demonstrates how dragging tasks triggers hook functions, updates the state, and then re-renders the UI components.

- Within it, a main “App” component that contains several “Column” components.
- Each “Column” contains several “Task” components and possibly the “AutoResizeTextArea” for new tasks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser / Vite Environment
    subgraph "Browser / Vite Environment"
        direction TB
        APP["App.tsx"]:::app
        subgraph "UI Components"
            direction TB
            COLUMN["Column"]:::component
            ICONBTN["DarkModeIconButton"]:::component
            TEXTAREA["AutoResizeTextArea"]:::component
            TASK["Task"]:::component
        end
        subgraph "Custom Hooks/Logic"
            direction TB
            COLUMN_DROP["useColumnDrop"]:::hook
            COLUMN_TASKS["useColumnTasks"]:::hook
            TASK_COLLECTION["useTaskCollection"]:::hook
            TASK_DND["useTaskDragAndDrop"]:::hook
        end
        subgraph "Configuration"
            direction TB
            THEME["theme.ts"]:::config
        end
        subgraph "Utilities"
            direction TB
            UTIL["Enums/Helpers/Logging/Models"]:::utils
        end
    end

    %% Relationships and Data Flow
    APP -->|"renders"| COLUMN
    APP -->|"renders"| ICONBTN
    APP -->|"integrates"| TASK_COLLECTION
    APP -->|"config influenced"| THEME
    APP -->|"supportedBy"| UTIL

    COLUMN -->|"contains"| TEXTAREA
    COLUMN -->|"contains"| TASK
    COLUMN -->|"uses"| COLUMN_DROP
    COLUMN -->|"uses"| COLUMN_TASKS
    COLUMN -->|"updates via"| TASK_COLLECTION

    TASK -->|"uses"| TASK_DND
    TASK -->|"updates via"| TASK_COLLECTION

    ICONBTN -->|"theme toggle"| THEME

    %% Utilities support hooks
    UTIL -->|"supports"| COLUMN_DROP
    UTIL -->|"supports"| COLUMN_TASKS
    UTIL -->|"supports"| TASK_COLLECTION
    UTIL -->|"supports"| TASK_DND

    %% Hooks feed updates back to App
    COLUMN_DROP -->|"state update"| APP
    COLUMN_TASKS -->|"state update"| APP
    TASK_COLLECTION -->|"state update"| APP
    TASK_DND -->|"state update"| APP

    %% Click Events
    click APP "https://github.com/gregoryoviedo/boardrop/blob/master/src/App.tsx"
    click COLUMN "https://github.com/gregoryoviedo/boardrop/blob/master/src/components/Column.tsx"
    click ICONBTN "https://github.com/gregoryoviedo/boardrop/blob/master/src/components/DarkModeIconButton.tsx"
    click TEXTAREA "https://github.com/gregoryoviedo/boardrop/blob/master/src/components/AutoResizeTextArea.tsx"
    click TASK "https://github.com/gregoryoviedo/boardrop/blob/master/src/components/Task.tsx"
    click COLUMN_DROP "https://github.com/gregoryoviedo/boardrop/blob/master/src/hooks/useColumnDrop.ts"
    click COLUMN_TASKS "https://github.com/gregoryoviedo/boardrop/blob/master/src/hooks/useColumnTasks.ts"
    click TASK_COLLECTION "https://github.com/gregoryoviedo/boardrop/blob/master/src/hooks/useTaskCollection.ts"
    click TASK_DND "https://github.com/gregoryoviedo/boardrop/blob/master/src/hooks/useTaskDragAndDrop.ts"
    click THEME "https://github.com/gregoryoviedo/boardrop/blob/master/src/config/theme.ts"
    click UTIL "https://github.com/gregoryoviedo/boardrop/tree/master/src/utils"

    %% Styles
    classDef app fill:#f9c,stroke:#333,stroke-width:2px;
    classDef component fill:#bbf,stroke:#333,stroke-width:2px;
    classDef hook fill:#cfc,stroke:#333,stroke-width:2px;
    classDef config fill:#ffc,stroke:#333,stroke-width:2px;
    classDef utils fill:#fc9,stroke:#333,stroke-width:2px;
```
