# fakteahk/zoawi-vite architecture

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

- Interactive diagram: https://gitdiagram.com/fakteahk/zoawi-vite
- Repository: https://github.com/fakteahk/zoawi-vite

## Overview

##### Project Type and Purpose
- This project is a frontend web application built with React and bundled with Vite.
- Its purpose is to serve as a lyrics website that communicates with Supabase for backend data (artists, songs, lyrics, searches).
- TailwindCSS is used for styling, and the structure suggests a separation of features (like artists, songs, lyrics, and search) and shared UI components.

##### File Structure
- Top-level files include configuration files (e.g., vite.config.js, tailwind.config.js, package.json) that point to the use of Vite and TailwindCSS.
- The “src” directory contains:
- App.jsx and main.jsx which act as entry points.
- A “components” folder, including UI components under src/components/ui, along with a theme provider.
- A “features” directory that groups functionality by domain (artists, home, lyrics, search, songs).
- A “db” folder that houses API handlers (apiArtists.jsx, apiLyrics.jsx, etc.) and Supabase integration (supabase.jsx).
- A “pages” folder for route-based components (Home, Artists, About, Lyrics, etc.).
- Additional helpers, tests, and library utilities.
- The project also has public assets (index.html and other public files).

##### Main Components
- Frontend/UI:
- Client Browser: Represents the end user’s web browser running the React application.
- UI and Theming Layers: Highlight the “components” directory with UI elements (buttons, cards, carousels, etc.) and the theme-provider.
- Routing and Pages: Represented by the various pages under src/pages (Home, Artists, About, Lyrics) that define the user interface and navigation flow.
- Feature Modules: Emphasize the “features” folders (artists, songs, lyrics, search) that encapsulate domain-specific logic and UI.
- Backend/API:
- Supabase Integration: Represent the Supabase service as the backend where authentication, data storage, and queries occur.
- API Layer: Show the API modules in src/db (apiArtists, apiLyrics, apiSearch, apiSongs) that encapsulate the logic for interacting with Supabase.
- Build and Configuration:

##### Relationships and Interactions
- How different UI pages (represented as distinct modules/components) are served from the React app.
- Connection from the API layer to the Supabase backend.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Different folders (features, components, pages, db) support modularity in both UI and backend interactions.
- Component Reusability: Shared UI library under src/components/ui supports the DRY principle.

##### What
- Component Labels: Clearly label major components like “React Application (main.jsx, App.jsx)”, “UI Components (theme-provider, buttons, cards, etc.)”, “Feature Modules (Artists, Songs, Lyrics, Search)”, “API Layer (Supabase integration and API handlers)”, and “Supabase Backend”.
- User interactions from the Browser to the React App.
- Data fetching from the Feature Modules to the API layer.
- Communication from the API layer to Supabase.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Client Browser"]:::frontend

    B["React Application (Entry Points)"]:::frontend
    A -->|"LoadApp"| B

    subgraph "Frontend UI"
        B1["Theme Provider"]:::ui
        B2["UI Components"]:::ui
        B3["Pages"]:::frontend
        B4["Feature Modules"]:::feature
    end

    B -->|"uses"| B1
    B -->|"uses"| B2
    B -->|"routes to"| B3
    B -->|"integrates"| B4

    subgraph "Feature Modules Detail"
        FM1["Artists Module"]:::feature
        FM2["Home Module"]:::feature
        FM3["Lyrics Module"]:::feature
        FM4["Search Module"]:::feature
        FM5["Songs Module"]:::feature
    end

    B4 -->|"contains"| FM1
    B4 -->|"contains"| FM2
    B4 -->|"contains"| FM3
    B4 -->|"contains"| FM4
    B4 -->|"contains"| FM5

    subgraph "Backend/API"
        API["API Layer"]:::backend
        SB["Supabase Integration"]:::backend
    end

    FM1 -->|"fetch"| API
    FM2 -->|"fetch"| API
    FM3 -->|"fetch"| API
    FM4 -->|"fetch"| API
    FM5 -->|"fetch"| API
    API -->|"query"| SB

    subgraph "Build/Configuration"
        CFG1["Vite Config"]:::config
        CFG2["Tailwind Config"]:::config
    end

    B -->|"build with"| CFG1
    B -->|"styles with"| CFG2

    click B "https://github.com/fakteahk/zoawi-vite/blob/main/src/App.jsx"
    click B "https://github.com/fakteahk/zoawi-vite/blob/main/src/main.jsx"
    click B1 "https://github.com/fakteahk/zoawi-vite/blob/main/src/components/theme-provider.jsx"
    click B2 "https://github.com/fakteahk/zoawi-vite/tree/main/src/components/ui"
    click B3 "https://github.com/fakteahk/zoawi-vite/tree/main/src/pages"
    click FM1 "https://github.com/fakteahk/zoawi-vite/tree/main/src/features/artists"
    click FM2 "https://github.com/fakteahk/zoawi-vite/tree/main/src/features/home"
    click FM3 "https://github.com/fakteahk/zoawi-vite/tree/main/src/features/lyrics"
    click FM4 "https://github.com/fakteahk/zoawi-vite/tree/main/src/features/search"
    click FM5 "https://github.com/fakteahk/zoawi-vite/tree/main/src/features/songs"
    click API "https://github.com/fakteahk/zoawi-vite/tree/main/src/db"
    click SB "https://github.com/fakteahk/zoawi-vite/blob/main/src/db/supabase.jsx"
    click CFG1 "https://github.com/fakteahk/zoawi-vite/blob/main/vite.config.js"
    click CFG2 "https://github.com/fakteahk/zoawi-vite/blob/main/tailwind.config.js"

    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef ui fill:#E3F2FD,stroke:#0277BD,stroke-width:2px;
    classDef feature fill:#F8BBD0,stroke:#AD1457,stroke-width:2px;
    classDef backend fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef config fill:#FFF9C4,stroke:#F9A825,stroke-width:2px;
```
