# aniket-314/soundcloud-music-app architecture

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

- Interactive diagram: https://gitdiagram.com/aniket-314/soundcloud-music-app
- Repository: https://github.com/aniket-314/soundcloud-music-app

## Overview

This is a SoundCloud music-streaming web app. Users authenticate, discover tracks, artists, and playlists, then play tracks, manage a queue, and maintain liked and recently played music. The graph highlights routing, authentication, discovery, library state, and playback. Evidence is limited to the README, source index, and sampled excerpts; unsampled page behavior and integrations are not inferred beyond indexed references.

Main entry points: [`src/App.tsx`](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/App.tsx) (App routes), [`src/lib/soundcloud.ts`](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/lib/soundcloud.ts) (SoundCloud API), [`src/components/layout/PlayerBar.tsx`](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/layout/PlayerBar.tsx) (Player bar), [`src/pages/Search.tsx`](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Search.tsx) (Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["App routes<br/>[App.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
end

subgraph group_identity["Identity and library"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_login["Login button<br/>[LoginButton.tsx]"]
  node_library["Library state<br/>[LibraryContext.tsx]"]
  node_callback["OAuth callback<br/>[Callback.tsx]"]
end

subgraph group_discovery["Music discovery"]
  node_home["Home<br/>[Home.tsx]"]
  node_search["Search<br/>[Search.tsx]"]
  node_librarypage["Library page<br/>[Library.tsx]"]
  node_liked["Liked songs<br/>[LikedSongs.tsx]"]
  node_playlist["Playlist detail<br/>[PlaylistDetail.tsx]"]
  node_artist["Artist detail<br/>[ArtistDetail.tsx]"]
  node_trackrow["Track row<br/>[TrackRow.tsx]"]
  node_artistcard["Artist card<br/>[ArtistCard.tsx]"]
  node_playlistcard["Playlist card<br/>[PlaylistCard.tsx]"]
end

subgraph group_playback["Playback"]
  node_player["Player state<br/>[PlayerContext.tsx]"]
  node_playerbar["Player bar<br/>[PlayerBar.tsx]"]
  node_controls["Player controls<br/>[PlayerControls.tsx]"]
  node_progress["Progress bar<br/>[ProgressBar.tsx]"]
  node_volume["Volume slider<br/>[VolumeSlider.tsx]"]
  node_queue["Queue panel<br/>[QueuePanel.tsx]"]
end

subgraph group_integration["SoundCloud integration"]
  node_api["SoundCloud API<br/>[soundcloud.ts]"]
  node_oauth["OAuth helpers<br/>[soundcloudAuth.ts]"]
end

node_user(("Listener"))
node_soundcloud["SoundCloud service"]
node_audio["Browser audio"]

node_user -->|"opens"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_librarypage
node_app -->|"routes to"| node_playlist
node_app -->|"routes to"| node_artist
node_app -->|"routes to"| node_liked
node_app -->|"routes to"| node_callback
node_app -->|"provides"| node_auth
node_login -->|"invokes login"| node_auth
node_auth -->|"exchanges code"| node_oauth
node_auth -->|"fetches profile"| node_api
node_oauth -.->|"authenticates with"| node_soundcloud
node_api -->|"requests data"| node_soundcloud
node_search -->|"searches catalog"| node_api
node_search -->|"renders tracks"| node_trackrow
node_search -->|"renders artists"| node_artistcard
node_search -->|"renders playlists"| node_playlistcard
node_librarypage -->|"uses library state"| node_library
node_liked -->|"loads liked tracks"| node_api
node_playlist -->|"loads playlist"| node_api
node_artist -->|"loads artist data"| node_api
node_home -->|"uses library state"| node_library
node_trackrow -->|"starts playback"| node_player
node_trackrow -->|"toggles likes"| node_library
node_library -->|"reads token"| node_auth
node_library -->|"updates favorites"| node_api
node_player -->|"resolves stream"| node_api
node_player -->|"plays stream"| node_audio
node_playerbar -->|"reads playback state"| node_player
node_playerbar -->|"renders controls"| node_controls
node_playerbar -->|"renders progress"| node_progress
node_playerbar -->|"renders volume"| node_volume
node_playerbar -->|"renders queue"| node_queue

click node_app "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/App.tsx"
click node_layout "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/layout/AppLayout.tsx"
click node_auth "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/AuthContext.tsx"
click node_login "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/LoginButton.tsx"
click node_library "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/LibraryContext.tsx"
click node_home "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Home.tsx"
click node_search "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Search.tsx"
click node_librarypage "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Library.tsx"
click node_liked "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/LikedSongs.tsx"
click node_playlist "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/PlaylistDetail.tsx"
click node_artist "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/ArtistDetail.tsx"
click node_callback "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Callback.tsx"
click node_trackrow "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/TrackRow.tsx"
click node_artistcard "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/ArtistCard.tsx"
click node_playlistcard "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/PlaylistCard.tsx"
click node_player "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/PlayerContext.tsx"
click node_playerbar "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/layout/PlayerBar.tsx"
click node_controls "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/PlayerControls.tsx"
click node_progress "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/ProgressBar.tsx"
click node_volume "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/VolumeSlider.tsx"
click node_queue "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/QueuePanel.tsx"
click node_api "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/lib/soundcloud.ts"
click node_oauth "https://github.com/aniket-314/soundcloud-music-app/blob/main/src/lib/soundcloudAuth.ts"

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_layout,node_audio toneBlue
class node_auth,node_login,node_library,node_callback toneAmber
class node_home,node_search,node_librarypage,node_liked,node_playlist,node_artist,node_trackrow,node_artistcard,node_playlistcard toneMint
class node_player,node_playerbar,node_controls,node_progress,node_volume,node_queue toneRose
class node_api,node_oauth,node_user,node_soundcloud toneIndigo
```

## Components

### App and navigation

- [App routes](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/App.tsx): `src/App.tsx`
- [App layout](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`

### Identity and library

- [Authentication state](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Login button](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/LoginButton.tsx): `src/components/LoginButton.tsx`
- [Library state](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/LibraryContext.tsx): `src/contexts/LibraryContext.tsx`
- [OAuth callback](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Callback.tsx): `src/pages/Callback.tsx`

### Music discovery

- [Home](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Search](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Search.tsx): `src/pages/Search.tsx`
- [Library page](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/Library.tsx): `src/pages/Library.tsx`
- [Liked songs](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/LikedSongs.tsx): `src/pages/LikedSongs.tsx`
- [Playlist detail](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/PlaylistDetail.tsx): `src/pages/PlaylistDetail.tsx`
- [Artist detail](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/pages/ArtistDetail.tsx): `src/pages/ArtistDetail.tsx`
- [Track row](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/TrackRow.tsx): `src/components/cards/TrackRow.tsx`
- [Artist card](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/ArtistCard.tsx): `src/components/cards/ArtistCard.tsx`
- [Playlist card](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/cards/PlaylistCard.tsx): `src/components/cards/PlaylistCard.tsx`

### Playback

- [Player state](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/contexts/PlayerContext.tsx): `src/contexts/PlayerContext.tsx`
- [Player bar](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/layout/PlayerBar.tsx): `src/components/layout/PlayerBar.tsx`
- [Player controls](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/PlayerControls.tsx): `src/components/player/PlayerControls.tsx`
- [Progress bar](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/ProgressBar.tsx): `src/components/player/ProgressBar.tsx`
- [Volume slider](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/VolumeSlider.tsx): `src/components/player/VolumeSlider.tsx`
- [Queue panel](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/components/player/QueuePanel.tsx): `src/components/player/QueuePanel.tsx`

### SoundCloud integration

- [SoundCloud API](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/lib/soundcloud.ts): `src/lib/soundcloud.ts`
- [OAuth helpers](https://github.com/aniket-314/soundcloud-music-app/blob/main/src/lib/soundcloudAuth.ts): `src/lib/soundcloudAuth.ts`

### Other components

- **Listener**
- **SoundCloud service**
- **Browser audio**

## Connections

- Listener → App routes: opens (evidence: `src/App.tsx`)
- App routes → App layout: routes through (evidence: `src/App.tsx`)
- App routes → Home: routes to (evidence: `src/App.tsx`)
- App routes → Search: routes to (evidence: `src/App.tsx`)
- App routes → Library page: routes to (evidence: `src/App.tsx`)
- App routes → Playlist detail: routes to (evidence: `src/App.tsx`)
- App routes → Artist detail: routes to (evidence: `src/App.tsx`)
- App routes → Liked songs: routes to (evidence: `src/App.tsx`)
- App routes → OAuth callback: routes to (evidence: `src/App.tsx`)
- App routes → Authentication state: provides (evidence: `src/App.tsx`)
- Login button → Authentication state: invokes login (evidence: `src/components/LoginButton.tsx`)
- Authentication state → OAuth helpers: exchanges code (evidence: `src/contexts/AuthContext.tsx`)
- Authentication state → SoundCloud API: fetches profile (evidence: `src/contexts/AuthContext.tsx`)
- OAuth helpers → SoundCloud service: authenticates with
- SoundCloud API → SoundCloud service: requests data (evidence: `src/lib/soundcloud.ts`)
- Search → SoundCloud API: searches catalog (evidence: `src/pages/Search.tsx`)
- Search → Track row: renders tracks (evidence: `src/pages/Search.tsx`)
- Search → Artist card: renders artists (evidence: `src/pages/Search.tsx`)
- Search → Playlist card: renders playlists (evidence: `src/pages/Search.tsx`)
- Library page → Library state: uses library state (evidence: `src/pages/Library.tsx`)
- Liked songs → SoundCloud API: loads liked tracks (evidence: `src/pages/LikedSongs.tsx`)
- Playlist detail → SoundCloud API: loads playlist (evidence: `src/pages/PlaylistDetail.tsx`)
- Artist detail → SoundCloud API: loads artist data (evidence: `src/pages/ArtistDetail.tsx`)
- Home → Library state: uses library state (evidence: `src/pages/Home.tsx`)
- Track row → Player state: starts playback (evidence: `src/components/cards/TrackRow.tsx`)
- Track row → Library state: toggles likes (evidence: `src/components/cards/TrackRow.tsx`)
- Library state → Authentication state: reads token (evidence: `src/contexts/LibraryContext.tsx`)
- Library state → SoundCloud API: updates favorites (evidence: `src/contexts/LibraryContext.tsx`)
- Player state → SoundCloud API: resolves stream (evidence: `src/contexts/PlayerContext.tsx`)
- Player state → Browser audio: plays stream (evidence: `src/contexts/PlayerContext.tsx`)
- Player bar → Player state: reads playback state (evidence: `src/components/layout/PlayerBar.tsx`)
- Player bar → Player controls: renders controls (evidence: `src/components/layout/PlayerBar.tsx`)
- Player bar → Progress bar: renders progress (evidence: `src/components/layout/PlayerBar.tsx`)
- Player bar → Volume slider: renders volume (evidence: `src/components/layout/PlayerBar.tsx`)
- Player bar → Queue panel: renders queue (evidence: `src/components/layout/PlayerBar.tsx`)
