# madhavmuthreja87/spotify-clone architecture

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

- Interactive diagram: https://gitdiagram.com/madhavmuthreja87/spotify-clone
- Repository: https://github.com/madhavmuthreja87/spotify-clone

## Overview

The tree suggests a Flutter music player, with library, playlist, search, and playback screens; the README provides no product-specific workflow documentation. Dart implementation files were not excerpted, so their responsibilities are inferred from names and their internal connections are omitted. The sampled iOS Live Activity code shows payload decoding, rendering, and shared image access; its image-loader and renderer relationships are supported by excerpts. Platform shell and plugin-registration files are included where required by the source index, but are not expanded into build infrastructure.

Main entry points: [`lib/main.dart`](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/main.dart) (App entry), [`lib/providers/track_provider.dart`](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/providers/track_provider.dart) (Track provider), [`linux/runner/my_application.cc`](https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/my_application.cc) (Linux app shell), [`ios/LiveActivityKitWidget/LANodeRenderer.swift`](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LANodeRenderer.swift) (Region renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_music["Music experience"]
  node_app["App entry<br/>[main.dart]"]
  node_home["Home<br/>[home_screen.dart]"]
  node_library["Library"]
  node_search["Search<br/>[search_screen.dart]"]
  node_playlists["Playlist views<br/>[playlist_home.dart]"]
  node_create_playlist["Create playlist"]
  node_add_playlist["Add to playlist"]
  node_liked["Liked songs<br/>[liked_songs.dart]"]
  node_recents["Recent tracks"]
  node_settings["Settings"]
  node_player["Player screen<br/>[player_screen.dart]"]
  node_mini["Mini player<br/>[mini_player.dart]"]
  node_audio["Audio handler<br/>[audio_handler.dart]"]
end

subgraph group_data["Track state"]
  node_api["Audis API<br/>[audis_api.dart]"]
  node_provider["Track provider"]
  node_track["Track model<br/>[track_model.dart]"]
end

subgraph group_activity["Live Activity"]
  node_widget_bundle["Widget bundle"]
  node_live_activity["Activity presentation"]
  node_attributes["Activity attributes"]
  node_renderer["Region renderer"]
  node_nodes["Layout nodes<br/>[LANode.swift]"]
  node_style["Layout style<br/>[LAStyle.swift]"]
  node_image_loader["Image loader"]
  node_app_group[("Shared app group")]
end

subgraph group_native["Platform integration"]
  node_ios_shell["iOS app shell<br/>[AppDelegate.swift]"]
  node_mac_plugins["macOS plugin registration"]
  node_linux_app["Linux app shell<br/>[my_application.cc]"]
  node_linux_header["Linux app interface<br/>[my_application.h]"]
  node_linux_main["Linux entry point<br/>[main.cc]"]
  node_linux_plugins["Linux plugin interface"]
end

node_user(("Listener"))
node_image_service[("Cached image files")]

node_widget_bundle -->|"registers"| node_live_activity
node_live_activity -->|"configures"| node_attributes
node_renderer -->|"renders"| node_nodes
node_renderer -->|"loads images"| node_image_loader
node_image_loader -->|"reads files"| node_app_group
node_app_group -->|"stores files"| node_image_service
node_linux_main -->|"starts"| node_linux_app
node_linux_app -->|"implements"| node_linux_header
node_linux_app -->|"registers plugins"| node_linux_plugins
node_ios_shell -.->|"launches app"| node_user
node_user -.->|"uses"| node_app
node_app -.->|"opens"| node_home
node_home -.->|"requests tracks"| node_provider
node_provider -.->|"fetches tracks"| node_api
node_provider -.->|"manages"| node_track
node_player -.->|"controls playback"| node_audio
node_mini -.->|"controls playback"| node_audio
node_app -.->|"registers plugins"| node_mac_plugins

click node_app "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/main.dart"
click node_home "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/home_screen.dart"
click node_library "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/library_screen.dart"
click node_search "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/search_screen.dart"
click node_playlists "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/playlist_home.dart"
click node_create_playlist "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/create_playlist.dart"
click node_add_playlist "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/add_to_playlist.dart"
click node_liked "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/liked_songs.dart"
click node_recents "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/recents_screen.dart"
click node_settings "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/settings_screen.dart"
click node_player "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/player_screen.dart"
click node_mini "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/widgets/mini_player.dart"
click node_audio "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/audio_handler.dart"
click node_api "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/audis_api.dart"
click node_provider "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/providers/track_provider.dart"
click node_track "https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/models/track_model.dart"
click node_widget_bundle "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitWidgetBundle.swift"
click node_live_activity "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitLiveActivity.swift"
click node_attributes "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitAttributes.swift"
click node_renderer "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LANodeRenderer.swift"
click node_nodes "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LANode.swift"
click node_style "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LAStyle.swift"
click node_image_loader "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LAImageLoader.swift"
click node_app_group "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityAppGroup.swift"
click node_ios_shell "https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/Runner/AppDelegate.swift"
click node_mac_plugins "https://github.com/madhavmuthreja87/spotify-clone/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_linux_app "https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/my_application.cc"
click node_linux_header "https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/my_application.h"
click node_linux_main "https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/main.cc"
click node_linux_plugins "https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/flutter/generated_plugin_registrant.h"

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_app,node_home,node_library,node_search,node_playlists,node_create_playlist,node_add_playlist,node_liked,node_recents,node_settings,node_player,node_mini,node_audio toneBlue
class node_api,node_provider,node_track,node_image_service toneAmber
class node_widget_bundle,node_live_activity,node_attributes,node_renderer,node_nodes,node_style,node_image_loader,node_app_group toneMint
class node_ios_shell,node_mac_plugins,node_linux_app,node_linux_header,node_linux_main,node_linux_plugins toneRose
class node_user toneIndigo
```

## Components

### Music experience

- [App entry](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/main.dart): `lib/main.dart`
- [Home](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Library](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/library_screen.dart): `lib/screens/library_screen.dart`
- [Search](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/search_screen.dart): `lib/screens/search_screen.dart`
- [Playlist views](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/playlist_home.dart): `lib/screens/playlist_home.dart`
- [Create playlist](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/create_playlist.dart): `lib/screens/create_playlist.dart`
- [Add to playlist](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/add_to_playlist.dart): `lib/screens/add_to_playlist.dart`
- [Liked songs](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/liked_songs.dart): `lib/screens/liked_songs.dart`
- [Recent tracks](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/recents_screen.dart): `lib/screens/recents_screen.dart`
- [Settings](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`
- [Player screen](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/screens/player_screen.dart): `lib/screens/player_screen.dart`
- [Mini player](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/widgets/mini_player.dart): `lib/widgets/mini_player.dart`
- [Audio handler](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/audio_handler.dart): `lib/audio_handler.dart`

### Track state

- [Audis API](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/audis_api.dart): `lib/audis_api.dart`
- [Track provider](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/providers/track_provider.dart): `lib/providers/track_provider.dart`
- [Track model](https://github.com/madhavmuthreja87/spotify-clone/blob/main/lib/models/track_model.dart): `lib/models/track_model.dart`

### Live Activity

- [Widget bundle](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitWidgetBundle.swift): `ios/LiveActivityKitWidget/LiveActivityKitWidgetBundle.swift`
- [Activity presentation](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitLiveActivity.swift): `ios/LiveActivityKitWidget/LiveActivityKitLiveActivity.swift`
- [Activity attributes](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityKitAttributes.swift): `ios/LiveActivityKitWidget/LiveActivityKitAttributes.swift`
- [Region renderer](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LANodeRenderer.swift): `ios/LiveActivityKitWidget/LANodeRenderer.swift`
- [Layout nodes](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LANode.swift): `ios/LiveActivityKitWidget/LANode.swift`
- [Layout style](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LAStyle.swift): `ios/LiveActivityKitWidget/LAStyle.swift`
- [Image loader](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LAImageLoader.swift): `ios/LiveActivityKitWidget/LAImageLoader.swift`
- [Shared app group](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/LiveActivityKitWidget/LiveActivityAppGroup.swift): `ios/LiveActivityKitWidget/LiveActivityAppGroup.swift`

### Platform integration

- [iOS app shell](https://github.com/madhavmuthreja87/spotify-clone/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`
- [macOS plugin registration](https://github.com/madhavmuthreja87/spotify-clone/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [Linux app shell](https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/my_application.cc): `linux/runner/my_application.cc`
- [Linux app interface](https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/my_application.h): `linux/runner/my_application.h`
- [Linux entry point](https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux plugin interface](https://github.com/madhavmuthreja87/spotify-clone/blob/main/linux/flutter/generated_plugin_registrant.h): `linux/flutter/generated_plugin_registrant.h`

### Other components

- **Listener**
- **Cached image files**

## Connections

- Widget bundle → Activity presentation: registers (evidence: `ios/LiveActivityKitWidget/LiveActivityKitWidgetBundle.swift`)
- Activity presentation → Activity attributes: configures (evidence: `ios/LiveActivityKitWidget/LiveActivityKitLiveActivity.swift`)
- Region renderer → Layout nodes: renders (evidence: `ios/LiveActivityKitWidget/LANodeRenderer.swift`)
- Region renderer → Image loader: loads images (evidence: `ios/LiveActivityKitWidget/LANodeRenderer.swift`)
- Image loader → Shared app group: reads files (evidence: `ios/LiveActivityKitWidget/LAImageLoader.swift`)
- Shared app group → Cached image files: stores files (evidence: `ios/LiveActivityKitWidget/LiveActivityAppGroup.swift`)
- Linux entry point → Linux app shell: starts (evidence: `linux/runner/main.cc`)
- Linux app shell → Linux app interface: implements (evidence: `linux/runner/my_application.cc`)
- Linux app shell → Linux plugin interface: registers plugins (evidence: `linux/runner/my_application.cc`)
- iOS app shell → Listener: launches app
- Listener → App entry: uses
- App entry → Home: opens
- Home → Track provider: requests tracks
- Track provider → Audis API: fetches tracks
- Track provider → Track model: manages
- Player screen → Audio handler: controls playback
- Mini player → Audio handler: controls playback
- App entry → macOS plugin registration: registers plugins
