# keoswalt/hooked-on-crochet architecture

> Architecture diagram of the GitHub repository keoswalt/hooked-on-crochet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keoswalt/hooked-on-crochet
- Repository: https://github.com/keoswalt/hooked-on-crochet

## Overview

##### Project type and purpose
- This is a single-page application (SPA) front-end built with React, TypeScript, Vite and Tailwind CSS, consuming Supabase as a Backend-as-a-Service (BaaS).
- Its purpose is to let users manage “projects,” each of which can have rows, tags, images and metadata, with authentication and real-time data provided by Supabase.

##### File structure
- Top-level “public” and “src” directories, plus configuration for Vite, TypeScript, Tailwind and Supabase.
- src/components is organized by feature: auth, images, layout, projects, rows, tags, plus a reusable “ui” library.
- src/hooks encapsulate stateful logic and Supabase operations.
- src/integrations/supabase holds the client setup and types.
- src/pages contains the entry pages (Index, NotFound).
- Build tool: Vite (vite.config.ts), styling: Tailwind (tailwind.config.ts).

##### README for additional insights
- Lists tech stack: Vite, TypeScript, React, shadcn-ui, Tailwind CSS, Supabase.
- Deployment is handled by Lovable, which essentially hosts the static build and wires up DNS.
- Authentication and data storage are off-loaded to Supabase.

##### Detail without over-splitting
- Related components into logical clusters (e.g., all “projects” components under a “Projects Module”).
- Within each cluster, only call out the most representative components or hooks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global entities
    Browser("Browser (User Agent)"):::external

    %% Entry points
    IndexFile["index.html"]:::config
    MainTS["src/main.tsx"]:::config
    AppTS["src/App.tsx"]:::config

    Browser -->|Loads| IndexFile -->|Bootstrap| MainTS -->|Renders| AppTS

    %% Frontend cluster
    subgraph "Frontend (SPA)" 
        direction TB
        UI["UI Layer (shadcn-ui + Tailwind CSS)"]:::ui
        subgraph "Feature Modules"
            direction TB
            AuthForm["AuthForm Component"]:::feature
            Projects["Projects Module"]:::feature
            Rows["Rows Module"]:::feature
            Tags["Tags Module"]:::feature
            Images["Images Module"]:::feature
            Header["Layout Header"]:::feature
            IndexPage["Index Page"]:::feature
            NotFound["NotFound Page"]:::feature
        end
        Hooks["Hooks Layer (domain logic & Supabase ops)"]:::hooks
        subgraph "Integrations"
            direction TB
            SupabaseClient["Supabase Client Setup"]:::integrations
            SupabaseTypes["Supabase Types"]:::integrations
        end
    end

    AppTS --> UI
    AppTS --> AuthForm
    AppTS --> Projects
    AppTS --> Rows
    AppTS --> Tags
    AppTS --> Images
    AppTS --> Header
    AppTS --> IndexPage
    AppTS --> NotFound
    AppTS --> Hooks
    Hooks --> SupabaseClient
    Hooks --> SupabaseTypes

    %% Supabase services cluster
    subgraph "Supabase Services (BaaS)"
        direction TB
        SupaAuth["Supabase Auth Service"]:::supabase
        SupaDB["Supabase Database (PostgreSQL)"]:::db
        SupaStorage["Supabase Storage"]:::storage
    end

    SupabaseClient -->|REST/WebSocket| SupaAuth
    SupabaseClient -->|REST/WebSocket| SupaDB
    SupabaseClient -->|REST| SupaStorage
    SupaAuth -->|Responses| SupabaseClient
    SupaDB -->|Responses| SupabaseClient
    SupaStorage -->|Responses| SupabaseClient
    SupabaseClient --> Hooks
    Hooks --> AppTS

    %% Deployment
    Deployment["Lovable Deployment / CDN"]:::external
    AppTS -->|Static Build| Deployment

    %% Click Events
    click IndexFile "https://github.com/keoswalt/hooked-on-crochet/blob/main/index.html"
    click MainTS "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/main.tsx"
    click AppTS "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/App.tsx"
    click UI "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/components/ui/"
    click AuthForm "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/components/auth/AuthForm.tsx"
    click Projects "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/components/projects/"
    click Rows "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/components/rows/"
    click Tags "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/components/tags/"
    click Images "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/components/images/"
    click Header "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/components/layout/Header.tsx"
    click IndexPage "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/pages/Index.tsx"
    click NotFound "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/pages/NotFound.tsx"
    click Hooks "https://github.com/keoswalt/hooked-on-crochet/tree/main/src/hooks/"
    click SupabaseClient "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/integrations/supabase/client.ts"
    click SupabaseTypes "https://github.com/keoswalt/hooked-on-crochet/blob/main/src/integrations/supabase/types.ts"

    %% Styles
    classDef external fill:#F0F4FF,stroke:#0366d6,color:#0366d6
    classDef config fill:#F5F5F5,stroke:#999999,color:#333333
    classDef ui fill:#E6FFFA,stroke:#38A169,color:#2F855A
    classDef feature fill:#EBF8FF,stroke:#3182CE,color:#2C5282
    classDef hooks fill:#FFF5F7,stroke:#D53F8C,color:#97266D
    classDef integrations fill:#FFF5E6,stroke:#DD6B20,color:#C05621
    classDef supabase fill:#E6FFFA,stroke:#00A884,color:#005F56
    classDef db fill:#FFF5F7,stroke:#805AD5,color:#44337A
    classDef storage fill:#FFF5E6,stroke:#D69E2E,color:#975A16
```
