# selira/plchef architecture

> Architecture diagram of the GitHub repository selira/plchef, 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/selira/plchef
- Repository: https://github.com/selira/plchef

## Overview

##### Main Components
- Frontend Application: The core of the project is a single-page Vue application using the Quasar Framework. Mark the central “App” (src/App.vue) as the root.
- Layouts and Pages: Include the various layout components (e.g., LayoutWithoutSidebar.vue, PlaylistManager.vue) and pages (ArtistSelector.vue, GenresPage.vue, LoginPage.vue, etc.) which form the navigational structure.
- Components: Highlight reusable UI components like ArtistCard, GenreSelector, and others (e.g., AutomaticArtistRecommendations.vue). They are the building blocks for the interface.
- Routing and Navigation: Emphasize where the routing lives (src/router/index.ts and routes.ts) which maps URLs to pages.
- Data Handling: Show where data is managed – from static JSON files present in both the “data” folder and the “public/data” folder, to the scripts in src/data that process this genre information.
- Internationalization (i18n): Note the bootstrapping for i18n (src/boot/i18n.ts and src/i18n directories) which supports multiple languages.
- External Services: Indicate the integration with external APIs or services such as the Spotify API (hinted at via authentication in the stores and the spotify_auth file) and possibly Supabase (via src/supabase.ts) if it handles additional backend-like functions.

##### Relationships and Interactions
- Flow from the Core Application: Start at the App.vue, which loads the appropriate Layouts based on routing.
- Component Interactions: Show how pages utilize multiple components (e.g., ArtistCard, GenreSelector) to build the view, and how these components get their data from state stores.
- Data Flow: Illustrate how data moves from:
- Static JSON and data scripts (data folder, src/data) → processed and then loaded into state management (stores) → rendered in UI components.
- Boot and Initialization: Detail the boot files’ responsibilities (like i18n.ts) to initialize the app’s configurations.
- External Communication: Represent how the app interacts with external services (Spotify API, Supabase) via modules like spotify_auth and supabase.ts.

##### Architectural Patterns and Principles
- Component-Based Architecture: Emphasize the modular design of Vue components.
- Separation of Concerns: Distinguish between UI components, routing, state management, and data handling.
- Configurable and Modular Boot Processes: Highlight how the Quasar boot system (src/boot) ensures proper initialization of features (e.g., i18n).
- Data-Driven UI: Notice that the project uses a combination of static files and dynamic data stores to prepare and use genre lists and trees.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration and Boot
    subgraph "Configuration / Boot"
        B["Internationalization Boot (i18n)"]:::config
        subgraph "i18n Files"
            I1["i18n index"]:::config
            I2["i18n en-US"]:::config
        end
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        A["App (App.vue)"]:::ui
        subgraph "Layouts"
            L1["LayoutWithoutSidebar"]:::ui
            L2["PlaylistManager"]:::ui
        end
        subgraph "Pages"
            P1["ArtistSelector"]:::ui
            P2["GenresPage"]:::ui
            P3["LoginPage"]:::ui
            P4["ErrorNotFound"]:::ui
            P5["PrivacyPolicy"]:::ui
            P6["TermsOfService"]:::ui
        end
        subgraph "Reusable UI Components"
            C1["ArtistCard"]:::ui
            C2["ArtistRecommendations"]:::ui
            C3["ArtistSongEditor"]:::ui
            C4["AutomaticArtistRecommendations"]:::ui
            C5["CatalogSelector"]:::ui
            C6["GenreSelector"]:::ui
            C7["RelatedArtistsSelector"]:::ui
        end
        R["Router (Routing & Navigation)"]:::ui
    end

    %% Business Logic (Stores)
    subgraph "Business Logic (Stores)"
        S1["genre-data"]:::logic
        S2["genres"]:::logic
        S3["playlist-sections"]:::logic
        S4["requests"]:::logic
        S5["selected-artists"]:::logic
        S6["spotify_auth"]:::logic
        S7["state"]:::logic
        S8["index"]:::logic
        S9["local-storage"]:::logic
        S10["store-flag"]:::logic
    end

    %% Data Services
    subgraph "Data Services"
        subgraph "Static JSON Files"
            DS1a["mini_genre_list.json"]:::data
            DS1b["mini_genre_tree.json"]:::data
            DS1c["genre_list.json (public)"]:::data
            DS1d["genre_tree.json (public)"]:::data
        end
        subgraph "Data Processing Scripts"
            DS2a["add_index_to_genre_tree.py"]:::data
            DS2b["genre_list.json (src/data)"]:::data
            DS2c["genre_tree.json (src/data)"]:::data
            DS2d["genre_tree_with_index.json"]:::data
            DS2e["remove_genres_in_tree_from_list.py"]:::data
        end
    end

    %% External Integrations
    subgraph "External Integrations"
        EX1["Spotify API Integration"]:::external
        EX2["Supabase"]:::external
    end

    %% Connections
    B --> A
    I1 --> A
    I2 --> A
    A --> R
    R --> L1
    R --> L2
    R --> P1
    R --> P2
    R --> P3
    R --> P4
    R --> P5
    R --> P6
    L1 --> P1
    L2 --> P3
    P1 --> C1
    P1 --> C6
    P2 --> C2
    S7 --> C2
    S7 --> C3
    P1 --> S5
    P2 --> S2
    DS1a --> S2
    DS1b --> S2
    DS1c --> S2
    DS1d --> S2
    DS2a --> S2
    DS2b --> S2
    DS2c --> S2
    DS2d --> S2
    DS2e --> S2
    S2 --> C1
    S2 --> C6
    S6 --> EX1
    S6 --> EX2

    %% Styles
    classDef ui fill:#AEDFF7,stroke:#1F78B4,stroke-width:2px;
    classDef logic fill:#FFE9A0,stroke:#D98E04,stroke-width:2px;
    classDef data fill:#C4F0C5,stroke:#228B22,stroke-width:2px;
    classDef config fill:#FAD1D1,stroke:#D9534F,stroke-width:2px;
    classDef external fill:#E2CCFF,stroke:#6A0DAD,stroke-width:2px;

    %% Click Events
    click A "https://github.com/selira/plchef/blob/main/src/App.vue"
    click L1 "https://github.com/selira/plchef/blob/main/src/layouts/LayoutWithoutSidebar.vue"
    click L2 "https://github.com/selira/plchef/blob/main/src/layouts/PlaylistManager.vue"
    click P1 "https://github.com/selira/plchef/blob/main/src/pages/ArtistSelector.vue"
    click P2 "https://github.com/selira/plchef/blob/main/src/pages/GenresPage.vue"
    click P3 "https://github.com/selira/plchef/blob/main/src/pages/LoginPage.vue"
    click P4 "https://github.com/selira/plchef/blob/main/src/pages/ErrorNotFound.vue"
    click P5 "https://github.com/selira/plchef/blob/main/src/pages/PrivacyPolicy.vue"
    click P6 "https://github.com/selira/plchef/blob/main/src/pages/TermsOfService.vue"
    click C1 "https://github.com/selira/plchef/blob/main/src/components/ArtistCard.vue"
    click C2 "https://github.com/selira/plchef/blob/main/src/components/ArtistRecommendations.vue"
    click C3 "https://github.com/selira/plchef/blob/main/src/components/ArtistSongEditor.vue"
    click C4 "https://github.com/selira/plchef/blob/main/src/components/AutomaticArtistRecommendations.vue"
    click C5 "https://github.com/selira/plchef/blob/main/src/components/CatalogSelector.vue"
    click C6 "https://github.com/selira/plchef/blob/main/src/components/GenreSelector.vue"
    click C7 "https://github.com/selira/plchef/blob/main/src/components/RelatedArtistsSelector.vue"
    click R "https://github.com/selira/plchef/blob/main/src/router/index.ts"
    click R "https://github.com/selira/plchef/blob/main/src/router/routes.ts"
    click S1 "https://github.com/selira/plchef/blob/main/src/stores/genre-data.ts"
    click S2 "https://github.com/selira/plchef/blob/main/src/stores/genres.ts"
    click S3 "https://github.com/selira/plchef/blob/main/src/stores/playlist-sections.ts"
    click S4 "https://github.com/selira/plchef/blob/main/src/stores/requests.ts"
    click S5 "https://github.com/selira/plchef/blob/main/src/stores/selected-artists.ts"
    click S6 "https://github.com/selira/plchef/blob/main/src/stores/spotify_auth.ts"
    click S7 "https://github.com/selira/plchef/blob/main/src/stores/state.ts"
    click S8 "https://github.com/selira/plchef/blob/main/src/stores/index.ts"
    click S9 "https://github.com/selira/plchef/blob/main/src/stores/local-storage.ts"
    click S10 "https://github.com/selira/plchef/blob/main/src/stores/store-flag.d.ts"
    click DS1a "https://github.com/selira/plchef/blob/main/data/mini_genre_list.json"
    click DS1b "https://github.com/selira/plchef/blob/main/data/mini_genre_tree.json"
    click DS1c "https://github.com/selira/plchef/blob/main/public/data/genre_list.json"
    click DS1d "https://github.com/selira/plchef/blob/main/public/data/genre_tree.json"
    click DS2a "https://github.com/selira/plchef/blob/main/src/data/add_index_to_genre_tree.py"
    click DS2b "https://github.com/selira/plchef/blob/main/src/data/genre_list.json"
    click DS2c "https://github.com/selira/plchef/blob/main/src/data/genre_tree.json"
    click DS2d "https://github.com/selira/plchef/blob/main/src/data/genre_tree_with_index.json"
    click DS2e "https://github.com/selira/plchef/blob/main/src/data/remove_genres_in_tree_from_list.py"
    click B "https://github.com/selira/plchef/blob/main/src/boot/i18n.ts"
    click I1 "https://github.com/selira/plchef/blob/main/src/i18n/index.ts"
    click I2 "https://github.com/selira/plchef/blob/main/src/i18n/en-US/index.ts"
    click EX2 "https://github.com/selira/plchef/blob/main/src/supabase.ts"
```
