# ifelzz/melodyxx architecture

> Architecture diagram of the GitHub repository ifelzz/melodyxx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ifelzz/melodyxx
- Repository: https://github.com/ifelzz/melodyxx

## Overview

Melodyxx is a browser-based music search, discography, preview, and MP3-download application. Users search YouTube or artists, explore tracks and albums, preview audio, and request downloads; the backend resolves audio and metadata, then streams transcoded MP3 data to the browser. The graph also preserves favorites, batch downloading, analytics, localization, and offline-shell capabilities. Backend excerpts are partial, so documented relationships are cited to the README where needed; unshown implementation links are omitted.

Main entry points: [`static/js/app.js`](https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js) (Web application), [`main.py`](https://github.com/ifelzz/melodyxx/blob/main/main.py) (MP3 stream pipeline), [`metadata_resolver.py`](https://github.com/ifelzz/melodyxx/blob/main/metadata_resolver.py) (Metadata resolver), [`analytics.py`](https://github.com/ifelzz/melodyxx/blob/main/analytics.py) (Analytics engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_webapp["Web application<br/>[app.js]"]
  node_language["Localization<br/>[i18n.js]"]
  node_offline["Offline shell<br/>[sw.js]"]
  node_favorites["Favorites playlist<br/>[app.js]"]
  node_batch["Batch queue<br/>[app.js]"]
  node_browseraudio["Browser audio player<br/>[app.js]"]
end

subgraph group_catalog["Music discovery"]
  node_search["Track search<br/>[main.py]"]
  node_artistsearch["Artist search<br/>[main.py]"]
  node_discography["Discography"]
  node_metadata["Metadata resolver"]
end

subgraph group_streaming["Audio delivery"]
  node_preview["Audio preview<br/>[main.py]"]
  node_download["Download authorization<br/>[main.py]"]
  node_stream["MP3 stream pipeline<br/>[main.py]"]
  node_ffmpeg["FFmpeg transcoding<br/>[main.py]"]
end

subgraph group_operations["Analytics and platform"]
  node_analytics["Analytics engine<br/>[analytics.py]"]
  node_metricsfile[("Metrics persistence<br/>[analytics.py]")]
  node_analyticsui["Analytics dashboard<br/>[stats.html]"]
end

node_listener(("Listener"))
node_youtube{{"YouTube services"}}
node_applemusic{{"Apple Music"}}
node_deezer{{"Deezer"}}

node_listener -->|"uses"| node_webapp
node_webapp -->|"requests search"| node_search
node_search -->|"searches tracks"| node_youtube
node_search -->|"cleans results"| node_metadata
node_webapp -->|"requests artists"| node_artistsearch
node_artistsearch -->|"resolves artists"| node_metadata
node_metadata -->|"queries catalog"| node_applemusic
node_metadata -->|"looks up portraits"| node_deezer
node_webapp -->|"requests catalog"| node_discography
node_discography -.->|"uses resolver"| node_metadata
node_webapp -->|"requests preview"| node_preview
node_preview -->|"resolves audio"| node_youtube
node_preview -->|"returns stream URL"| node_browseraudio
node_webapp -->|"requests download"| node_download
node_download -->|"issues stream token"| node_stream
node_browseraudio -->|"plays audio"| node_stream
node_stream -->|"reads audio"| node_youtube
node_stream -->|"resolves track data"| node_metadata
node_stream -->|"pipes audio"| node_ffmpeg
node_ffmpeg -->|"emits MP3"| node_stream
node_stream -->|"streams response"| node_listener
node_webapp -->|"manages collection"| node_favorites
node_webapp -->|"queues downloads"| node_batch
node_batch -->|"requests sequentially"| node_download
node_webapp -->|"localizes interface"| node_language
node_webapp -.->|"registers shell"| node_offline
node_search -->|"records searches"| node_analytics
node_stream -.->|"records activity"| node_analytics
node_analytics -->|"persists metrics"| node_metricsfile
node_analyticsui -.->|"shows metrics"| node_analytics

click node_webapp "https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js"
click node_language "https://github.com/ifelzz/melodyxx/blob/main/static/js/i18n.js"
click node_offline "https://github.com/ifelzz/melodyxx/blob/main/static/sw.js"
click node_favorites "https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js"
click node_batch "https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js"
click node_search "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_artistsearch "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_discography "https://github.com/ifelzz/melodyxx/blob/main/metadata_resolver.py"
click node_metadata "https://github.com/ifelzz/melodyxx/blob/main/metadata_resolver.py"
click node_preview "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_download "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_stream "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_ffmpeg "https://github.com/ifelzz/melodyxx/blob/main/main.py"
click node_browseraudio "https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js"
click node_analytics "https://github.com/ifelzz/melodyxx/blob/main/analytics.py"
click node_metricsfile "https://github.com/ifelzz/melodyxx/blob/main/analytics.py"
click node_analyticsui "https://github.com/ifelzz/melodyxx/blob/main/static/stats.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_language,node_offline,node_favorites,node_batch,node_browseraudio toneBlue
class node_search,node_artistsearch,node_discography,node_metadata toneAmber
class node_preview,node_download,node_stream,node_ffmpeg toneMint
class node_analytics,node_metricsfile,node_analyticsui toneRose
class node_listener,node_youtube,node_applemusic,node_deezer toneIndigo
```

## Components

### Browser experience

- [Web application](https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js): `static/js/app.js`
- [Localization](https://github.com/ifelzz/melodyxx/blob/main/static/js/i18n.js): `static/js/i18n.js`
- [Offline shell](https://github.com/ifelzz/melodyxx/blob/main/static/sw.js): `static/sw.js`
- [Favorites playlist](https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js): `static/js/app.js`
- [Batch queue](https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js): `static/js/app.js`
- [Browser audio player](https://github.com/ifelzz/melodyxx/blob/main/static/js/app.js): `static/js/app.js`

### Music discovery

- [Track search](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`
- [Artist search](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`
- [Discography](https://github.com/ifelzz/melodyxx/blob/main/metadata_resolver.py): `metadata_resolver.py`
- [Metadata resolver](https://github.com/ifelzz/melodyxx/blob/main/metadata_resolver.py): `metadata_resolver.py`

### Audio delivery

- [Audio preview](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`
- [Download authorization](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`
- [MP3 stream pipeline](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`
- [FFmpeg transcoding](https://github.com/ifelzz/melodyxx/blob/main/main.py): `main.py`

### Analytics and platform

- [Analytics engine](https://github.com/ifelzz/melodyxx/blob/main/analytics.py): `analytics.py`
- [Metrics persistence](https://github.com/ifelzz/melodyxx/blob/main/analytics.py): `analytics.py`
- [Analytics dashboard](https://github.com/ifelzz/melodyxx/blob/main/static/stats.html): `static/stats.html`

### Other components

- **Listener**
- **YouTube services**
- **Apple Music**
- **Deezer**

## Connections

- Listener → Web application: uses (evidence: `README.md`)
- Web application → Track search: requests search (evidence: `static/js/app.js`)
- Track search → YouTube services: searches tracks (evidence: `README.md`)
- Track search → Metadata resolver: cleans results (evidence: `main.py`)
- Web application → Artist search: requests artists (evidence: `static/js/app.js`)
- Artist search → Metadata resolver: resolves artists (evidence: `main.py`)
- Metadata resolver → Apple Music: queries catalog (evidence: `README.md`)
- Metadata resolver → Deezer: looks up portraits (evidence: `README.md`)
- Web application → Discography: requests catalog (evidence: `README.md`)
- Discography → Metadata resolver: uses resolver (evidence: `metadata_resolver.py`)
- Web application → Audio preview: requests preview (evidence: `static/js/app.js`)
- Audio preview → YouTube services: resolves audio (evidence: `README.md`)
- Audio preview → Browser audio player: returns stream URL (evidence: `static/js/app.js`)
- Web application → Download authorization: requests download (evidence: `README.md`)
- Download authorization → MP3 stream pipeline: issues stream token (evidence: `README.md`)
- Browser audio player → MP3 stream pipeline: plays audio (evidence: `README.md`)
- MP3 stream pipeline → YouTube services: reads audio (evidence: `README.md`)
- MP3 stream pipeline → Metadata resolver: resolves track data (evidence: `main.py`)
- MP3 stream pipeline → FFmpeg transcoding: pipes audio (evidence: `README.md`)
- FFmpeg transcoding → MP3 stream pipeline: emits MP3 (evidence: `README.md`)
- MP3 stream pipeline → Listener: streams response (evidence: `README.md`)
- Web application → Favorites playlist: manages collection (evidence: `README.md`)
- Web application → Batch queue: queues downloads (evidence: `README.md`)
- Batch queue → Download authorization: requests sequentially (evidence: `README.md`)
- Web application → Localization: localizes interface (evidence: `static/js/i18n.js`)
- Web application → Offline shell: registers shell
- Track search → Analytics engine: records searches (evidence: `main.py`)
- MP3 stream pipeline → Analytics engine: records activity (evidence: `main.py`)
- Analytics engine → Metrics persistence: persists metrics (evidence: `analytics.py`)
- Analytics dashboard → Analytics engine: shows metrics
