# onk2r/moodify-music-by-mood architecture

> Architecture diagram of the GitHub repository onk2r/moodify-music-by-mood, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onk2r/moodify-music-by-mood
- Repository: https://github.com/onk2r/moodify-music-by-mood

## Overview

##### Project type and purpose
- Type: Single-page static web application (no custom backend).
- Purpose: Let users select a “mood” and instantly see an embedded Spotify playlist plus a link to open it in Spotify.

##### File structure
- Top level has exactly four files:
- index.html – main HTML page and structural skeleton
- style.css – styling for layout, themes, transitions
- script.js – DOM logic, event handling, Spotify Embed API logic
- README.md – documentation
- No “backend,” no database—pure frontend + external API.

##### README for additional insights
- Features: mood buttons, embedded Spotify player, dynamic theming, external link.
- Tech stack: HTML5, CSS3 (Flexbox & transitions), plain JavaScript, Spotify Embed API.

##### Elements
- From Static Host → Browser (“HTML, CSS, JS”)
- From Browser → Spotify Embed API (“Embed request for playlist URI”)
- From Browser → Spotify App (“Open in Spotify” link)
- Blue for client-side components
- Green for externally hosted services
- Gray for static hosting

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Static Host / Web Server"
        iHTML["index.html"]:::static
        CSS["style.css"]:::static
        JS["script.js"]:::static
        README["README.md"]:::static
    end

    subgraph "Browser / Client"
        MS["Mood Selector"]:::client
        TM["Theme Manager"]:::client
        PI["Playlist IFrame"]:::client
        LG["Open in Spotify Link"]:::client
    end

    SpotifyEmbed["Spotify Embed API"]:::external
    SpotifyApp["Spotify App"]:::external

    iHTML -->|"structure"| MS
    CSS -->|"styles & themes"| TM
    JS -->|"behavior & API logic"| MS

    MS -->|"select mood"| TM
    TM -->|"apply theme & load URI"| PI
    PI -->|"embed request for playlist URI"| SpotifyEmbed
    LG -->|"open playlist"| SpotifyApp

    click iHTML "https://github.com/onk2r/moodify-music-by-mood/blob/main/index.html"
    click CSS "https://github.com/onk2r/moodify-music-by-mood/blob/main/style.css"
    click JS "https://github.com/onk2r/moodify-music-by-mood/blob/main/script.js"
    click README "https://github.com/onk2r/moodify-music-by-mood/blob/main/README.md"

    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#90EE90,stroke:#000,stroke-width:1px
```
