# jl978/spotify-clone-client architecture

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

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

## Overview

This repository is a React front end for a Spotify web-player clone. The main workflow starts in the app shell, establishes authentication state, and presents navigation and routed content for browsing or searching Spotify’s catalog; authenticated users can access personal collections and control an existing Spotify player. Search rows fetch and display results, while the player reads playback state and sends control commands. The README also documents cookie-backed refresh authentication and paginated scrolling. Some page implementations and wiring were not sampled, so those relationships are shown only where documented or left out.

Main entry points: [`src/App.js`](https://github.com/jl978/spotify-clone-client/blob/master/src/App.js) (App bootstrap), [`src/components/pages-components`](https://github.com/jl978/spotify-clone-client/tree/master/src/components/pages-components) (Catalog and account pages), [`src/components/footer-components/Player.js`](https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/Player.js) (Remote player), [`src/utilities/reqWithToken.js`](https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/reqWithToken.js) (Authenticated GET)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App bootstrap<br/>[App.js]"]
  node_auth["Auth state<br/>[App.js]"]
  node_sidebar["Navigation sidebar<br/>[Sidebar.js]"]
  node_logo["Brand logo<br/>[Logo.js]"]
  node_content["Content shell<br/>[Featured.js]"]
  node_loading["Loading view<br/>[Loading.js]"]
  node_pagebanner["Page banner<br/>[PageBanner.js]"]
  node_pagecontent["Page content<br/>[PageContent.js]"]
  node_contexts["Shared app context<br/>[context.js]"]
end

subgraph group_discovery["Catalog discovery"]
  node_pages["Catalog and account pages"]
  node_searchbar["Live search input<br/>[SearchBar.js]"]
  node_searchrow["Search results<br/>[SearchRow.js]"]
  node_playcard["Catalog cards<br/>[PlayCard.js]"]
  node_scrollhooks["Pagination hooks"]
end

subgraph group_account["Account features"]
  node_playlistfunctions["Playlist actions"]
  node_prompt["Login prompts<br/>[PromptButton.js]"]
end

subgraph group_playback["Playback control"]
  node_player["Remote player<br/>[Player.js]"]
  node_progress["Playback progress<br/>[ProgressBar.js]"]
  node_devices["Device selection<br/>[ConnectDevices.js]"]
  node_nowplaying["Now playing display<br/>[NowPlaying.js]"]
end

subgraph group_transport["API transport"]
  node_readapi["Authenticated GET<br/>[reqWithToken.js]"]
  node_writeapi["Authenticated commands<br/>[putWithToken.js]"]
  node_proxyapi["Backend API proxy"]
end

node_user(("Listener"))
node_spotify{{"Spotify Web API"}}
node_authserver{{"Authorization server"}}

node_user -->|"opens app"| node_app
node_app -->|"resolves login"| node_auth
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_content
node_app -->|"renders while loading"| node_loading
node_app -->|"renders when logged in"| node_player
node_app -->|"checks refresh cookie"| node_authserver
node_app -->|"requests profile and playlists"| node_readapi
node_sidebar -->|"renders"| node_logo
node_content -.->|"routes content"| node_pages
node_user -.->|"enters query"| node_searchbar
node_pages -->|"renders query rows"| node_searchrow
node_searchrow -->|"fetches results"| node_proxyapi
node_proxyapi -->|"forwards request"| node_authserver
node_searchrow -->|"renders results"| node_playcard
node_pages -.->|"loads more items"| node_scrollhooks
node_pages -.->|"shows page details"| node_pagebanner
node_pages -.->|"renders page body"| node_pagecontent
node_pages -.->|"offers playlist actions"| node_playlistfunctions
node_app -->|"provides shared state"| node_contexts
node_player -->|"reads playback state"| node_readapi
node_player -->|"sends playback commands"| node_writeapi
node_player -->|"renders and updates"| node_progress
node_player -->|"renders device controls"| node_devices
node_player -->|"renders track info"| node_nowplaying
node_readapi -->|"requests catalog and state"| node_spotify
node_writeapi -->|"sends commands"| node_spotify
node_devices -->|"loads devices"| node_readapi
node_devices -->|"selects device"| node_writeapi
node_playlistfunctions -->|"updates saved items"| node_writeapi
node_auth -.->|"gates protected routes"| node_prompt

click node_app "https://github.com/jl978/spotify-clone-client/blob/master/src/App.js"
click node_auth "https://github.com/jl978/spotify-clone-client/blob/master/src/App.js"
click node_sidebar "https://github.com/jl978/spotify-clone-client/blob/master/src/components/sidebar-components/Sidebar.js"
click node_logo "https://github.com/jl978/spotify-clone-client/blob/master/src/components/sidebar-components/Logo.js"
click node_content "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/Featured.js"
click node_loading "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/Loading.js"
click node_pagebanner "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PageBanner.js"
click node_pagecontent "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PageContent.js"
click node_pages "https://github.com/jl978/spotify-clone-client/tree/master/src/components/pages-components"
click node_searchbar "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/SearchBar.js"
click node_searchrow "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/SearchRow.js"
click node_playcard "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PlayCard.js"
click node_playlistfunctions "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PlayListFunctions.js"
click node_scrollhooks "https://github.com/jl978/spotify-clone-client/tree/master/src/utilities/hooks"
click node_contexts "https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/context.js"
click node_prompt "https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PromptButton.js"
click node_player "https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/Player.js"
click node_progress "https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/ProgressBar.js"
click node_devices "https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/ConnectDevices.js"
click node_nowplaying "https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/NowPlaying.js"
click node_readapi "https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/reqWithToken.js"
click node_writeapi "https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/putWithToken.js"
click node_proxyapi "https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/makeAxiosRequest.js"

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_auth,node_sidebar,node_logo,node_content,node_loading,node_pagebanner,node_pagecontent,node_contexts toneBlue
class node_pages,node_searchbar,node_searchrow,node_playcard,node_scrollhooks toneAmber
class node_playlistfunctions,node_prompt,node_spotify,node_authserver toneMint
class node_player,node_progress,node_devices,node_nowplaying toneRose
class node_readapi,node_writeapi,node_proxyapi,node_user toneIndigo
```

## Components

### App shell

- [App bootstrap](https://github.com/jl978/spotify-clone-client/blob/master/src/App.js): `src/App.js`
- [Auth state](https://github.com/jl978/spotify-clone-client/blob/master/src/App.js): `src/App.js`
- [Navigation sidebar](https://github.com/jl978/spotify-clone-client/blob/master/src/components/sidebar-components/Sidebar.js): `src/components/sidebar-components/Sidebar.js`
- [Brand logo](https://github.com/jl978/spotify-clone-client/blob/master/src/components/sidebar-components/Logo.js): `src/components/sidebar-components/Logo.js`
- [Content shell](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/Featured.js): `src/components/featured-components/Featured.js`
- [Loading view](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/Loading.js): `src/components/featured-components/Loading.js`
- [Page banner](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PageBanner.js): `src/components/featured-components/PageBanner.js`
- [Page content](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PageContent.js): `src/components/featured-components/PageContent.js`
- [Shared app context](https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/context.js): `src/utilities/context.js`

### Catalog discovery

- [Catalog and account pages](https://github.com/jl978/spotify-clone-client/tree/master/src/components/pages-components): `src/components/pages-components`
- [Live search input](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/SearchBar.js): `src/components/featured-components/SearchBar.js`
- [Search results](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/SearchRow.js): `src/components/featured-components/SearchRow.js`
- [Catalog cards](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PlayCard.js): `src/components/featured-components/PlayCard.js`
- [Pagination hooks](https://github.com/jl978/spotify-clone-client/tree/master/src/utilities/hooks): `src/utilities/hooks`

### Account features

- [Playlist actions](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PlayListFunctions.js): `src/components/featured-components/PlayListFunctions.js`
- [Login prompts](https://github.com/jl978/spotify-clone-client/blob/master/src/components/featured-components/PromptButton.js): `src/components/featured-components/PromptButton.js`

### Playback control

- [Remote player](https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/Player.js): `src/components/footer-components/Player.js`
- [Playback progress](https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/ProgressBar.js): `src/components/footer-components/ProgressBar.js`
- [Device selection](https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/ConnectDevices.js): `src/components/footer-components/ConnectDevices.js`
- [Now playing display](https://github.com/jl978/spotify-clone-client/blob/master/src/components/footer-components/NowPlaying.js): `src/components/footer-components/NowPlaying.js`

### API transport

- [Authenticated GET](https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/reqWithToken.js): `src/utilities/reqWithToken.js`
- [Authenticated commands](https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/putWithToken.js): `src/utilities/putWithToken.js`
- [Backend API proxy](https://github.com/jl978/spotify-clone-client/blob/master/src/utilities/makeAxiosRequest.js): `src/utilities/makeAxiosRequest.js`

### Other components

- **Listener**
- **Spotify Web API**
- **Authorization server**

## Connections

- Listener → App bootstrap: opens app (evidence: `src/App.js`)
- App bootstrap → Auth state: resolves login (evidence: `src/App.js`)
- App bootstrap → Navigation sidebar: renders (evidence: `src/App.js`)
- App bootstrap → Content shell: renders (evidence: `src/App.js`)
- App bootstrap → Loading view: renders while loading (evidence: `src/App.js`)
- App bootstrap → Remote player: renders when logged in (evidence: `src/App.js`)
- App bootstrap → Authorization server: checks refresh cookie (evidence: `src/App.js`)
- App bootstrap → Authenticated GET: requests profile and playlists (evidence: `src/App.js`)
- Navigation sidebar → Brand logo: renders (evidence: `src/App.js`)
- Content shell → Catalog and account pages: routes content
- Listener → Live search input: enters query
- Catalog and account pages → Search results: renders query rows (evidence: `src/components/pages-components/QueryPage.js`)
- Search results → Backend API proxy: fetches results (evidence: `src/components/featured-components/SearchRow.js`)
- Backend API proxy → Authorization server: forwards request (evidence: `src/utilities/makeAxiosRequest.js`)
- Search results → Catalog cards: renders results (evidence: `src/components/featured-components/SearchRow.js`)
- Catalog and account pages → Pagination hooks: loads more items (evidence: `src/components/pages-components/ArtistPage.js`)
- Catalog and account pages → Page banner: shows page details (evidence: `src/components/pages-components/ArtistPage.js`)
- Catalog and account pages → Page content: renders page body
- Catalog and account pages → Playlist actions: offers playlist actions (evidence: `src/components/pages-components/ArtistPage.js`)
- App bootstrap → Shared app context: provides shared state (evidence: `src/App.js`)
- Remote player → Authenticated GET: reads playback state (evidence: `src/components/footer-components/Player.js`)
- Remote player → Authenticated commands: sends playback commands (evidence: `src/components/footer-components/Player.js`)
- Remote player → Playback progress: renders and updates (evidence: `src/components/footer-components/Player.js`)
- Remote player → Device selection: renders device controls (evidence: `src/components/footer-components/Player.js`)
- Remote player → Now playing display: renders track info (evidence: `src/components/footer-components/Player.js`)
- Authenticated GET → Spotify Web API: requests catalog and state (evidence: `src/utilities/reqWithToken.js`)
- Authenticated commands → Spotify Web API: sends commands (evidence: `src/utilities/putWithToken.js`)
- Device selection → Authenticated GET: loads devices (evidence: `src/components/footer-components/ConnectDevices.js`)
- Device selection → Authenticated commands: selects device (evidence: `src/components/footer-components/ConnectDevices.js`)
- Playlist actions → Authenticated commands: updates saved items
- Auth state → Login prompts: gates protected routes
