# pushan2005/spottransfer architecture

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

- Interactive diagram: https://gitdiagram.com/pushan2005/spottransfer
- Repository: https://github.com/pushan2005/spottransfer

## Overview

SpotTransfer moves Spotify playlists to YouTube Music through a self-hosted desktop client: users provide a playlist link and authenticated YouTube Music request headers, then the client fetches tracks, searches for matches, and creates a playlist. The web app is a companion site for the landing page, setup guide, and announcements, not the transfer runtime. The desktop excerpts show worker orchestration and resumable progress; stage-level transfer relationships are documented in the README, while some backend details are unsampled.

Main entry points: [`apps/desktop/main.py`](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/main.py) (Desktop client), [`apps/desktop/selfhost.py`](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py) (Transfer backend), [`apps/web/src/main.tsx`](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/main.tsx) (Web router), [`apps/web/src/pages/App.tsx`](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/App.tsx) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop transfer"]
  node_desktop_app["Desktop client<br/>[main.py]"]
  node_transfer_backend["Transfer backend<br/>[selfhost.py]"]
  node_spotify_playlist["Spotify playlist"]
  node_track_fetch["Track fetching<br/>[selfhost.py]"]
  node_yt_search["YouTube matching<br/>[selfhost.py]"]
  node_playlist_create["Playlist creation<br/>[selfhost.py]"]
  node_youtube_music["YouTube Music"]
end

subgraph group_web["Web companion"]
  node_web_entry["Web router<br/>[main.tsx]"]
  node_landing["Landing page<br/>[App.tsx]"]
  node_guide["Setup guide<br/>[guide.tsx]"]
  node_announcements["Announcements<br/>[announcements.tsx]"]
end

subgraph group_support["Runtime support"]
  node_progress_store[("Transfer progress<br/>[main.py]")]
  node_logging["Redacted logging<br/>[logging_config.py]"]
end

node_user(("User"))
node_visitor(("Site visitor"))

node_user -->|"provides inputs"| node_desktop_app
node_desktop_app -->|"loads backend"| node_transfer_backend
node_transfer_backend -->|"fetches tracks"| node_track_fetch
node_track_fetch -->|"reads playlist"| node_spotify_playlist
node_transfer_backend -->|"searches tracks"| node_yt_search
node_yt_search -->|"searches matches"| node_youtube_music
node_transfer_backend -->|"creates playlist"| node_playlist_create
node_playlist_create -->|"writes playlist"| node_youtube_music
node_desktop_app -->|"saves progress"| node_progress_store
node_desktop_app -->|"logs events"| node_logging
node_visitor -->|"opens site"| node_web_entry
node_web_entry -->|"routes home"| node_landing
node_web_entry -->|"routes guide"| node_guide
node_web_entry -->|"routes updates"| node_announcements
node_landing -->|"links setup"| node_guide

click node_desktop_app "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/main.py"
click node_transfer_backend "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py"
click node_track_fetch "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py"
click node_yt_search "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py"
click node_playlist_create "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py"
click node_progress_store "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/main.py"
click node_logging "https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/logging_config.py"
click node_web_entry "https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/main.tsx"
click node_landing "https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/App.tsx"
click node_guide "https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/guide.tsx"
click node_announcements "https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/announcements.tsx"

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_desktop_app,node_transfer_backend,node_spotify_playlist,node_track_fetch,node_yt_search,node_playlist_create,node_youtube_music,node_user toneBlue
class node_web_entry,node_landing,node_guide,node_announcements toneAmber
class node_progress_store,node_logging toneMint
class node_visitor toneIndigo
```

## Components

### Desktop transfer

- [Desktop client](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/main.py): `apps/desktop/main.py`
- [Transfer backend](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py): `apps/desktop/selfhost.py`
- **Spotify playlist**
- [Track fetching](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py): `apps/desktop/selfhost.py`
- [YouTube matching](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py): `apps/desktop/selfhost.py`
- [Playlist creation](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/selfhost.py): `apps/desktop/selfhost.py`
- **YouTube Music**

### Web companion

- [Web router](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/main.tsx): `apps/web/src/main.tsx`
- [Landing page](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/App.tsx): `apps/web/src/pages/App.tsx`
- [Setup guide](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/guide.tsx): `apps/web/src/pages/guide.tsx`
- [Announcements](https://github.com/pushan2005/spottransfer/blob/main/apps/web/src/pages/announcements.tsx): `apps/web/src/pages/announcements.tsx`

### Runtime support

- [Transfer progress](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/main.py): `apps/desktop/main.py`
- [Redacted logging](https://github.com/pushan2005/spottransfer/blob/main/apps/desktop/logging_config.py): `apps/desktop/logging_config.py`

### Other components

- **User**
- **Site visitor**

## Connections

- User → Desktop client: provides inputs (evidence: `README.md`)
- Desktop client → Transfer backend: loads backend (evidence: `apps/desktop/main.py`)
- Transfer backend → Track fetching: fetches tracks (evidence: `README.md`)
- Track fetching → Spotify playlist: reads playlist (evidence: `README.md`)
- Transfer backend → YouTube matching: searches tracks (evidence: `README.md`)
- YouTube matching → YouTube Music: searches matches (evidence: `README.md`)
- Transfer backend → Playlist creation: creates playlist (evidence: `README.md`)
- Playlist creation → YouTube Music: writes playlist (evidence: `README.md`)
- Desktop client → Transfer progress: saves progress (evidence: `apps/desktop/main.py`)
- Desktop client → Redacted logging: logs events (evidence: `apps/desktop/logging_config.py`)
- Site visitor → Web router: opens site (evidence: `apps/web/src/main.tsx`)
- Web router → Landing page: routes home (evidence: `apps/web/src/main.tsx`)
- Web router → Setup guide: routes guide (evidence: `apps/web/src/main.tsx`)
- Web router → Announcements: routes updates (evidence: `apps/web/src/main.tsx`)
- Landing page → Setup guide: links setup (evidence: `apps/web/src/pages/App.tsx`)
