# vitorhasilva/trikatuka architecture

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

- Interactive diagram: https://gitdiagram.com/vitorhasilva/trikatuka
- Repository: https://github.com/vitorhasilva/trikatuka

## Overview

Trikatuka migrates playlists and saved Spotify items between two accounts. The principal flow authenticates source and destination users, lists transferable content, then transfers selected or all items; playlist transfer preserves order. The graph includes the documented collaborative/public/private/subscribed playlist behavior and album support. Server and client excerpts establish authentication and representative transfer calls; unsampled client wiring and several item-transfer implementations limit which links can be asserted directly.

Main entry points: [`webapp/app/services/Spotify.js`](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/Spotify.js) (Spotify requests), [`webapp/app/services/RequestHelper.js`](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/RequestHelper.js) (Sequential action helper), [`webapp/app/controllers/MainCtrl.js`](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/MainCtrl.js) (Main controller), [`webapp/app/controllers/PlaylistListCtrl.js`](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/PlaylistListCtrl.js) (Playlist transfer UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server and authentication"]
  node_appserver["Web and auth server<br/>[server.js]"]
  node_callback["Auth callback page<br/>[afterLogin.html]"]
end

subgraph group_client["Account and UI"]
  node_angularapp["Angular app routes<br/>[app.js]"]
  node_login["Login controller<br/>[LoginCtrl.js]"]
  node_main["Main controller<br/>[MainCtrl.js]"]
  node_users["Account sessions<br/>[User.js]"]
  node_playlistui["Playlist transfer UI"]
  node_trackui["Saved tracks UI<br/>[TrackListCtrl.js]"]
  node_albumui["Saved albums UI<br/>[AlbumListCtrl.js]"]
  node_artistui["Followed artists UI<br/>[ArtistListCtrl.js]"]
end

subgraph group_catalog["Transferable libraries"]
  node_playlistservice["Playlist operations<br/>[PlaylistService.js]"]
  node_playlistmodel["Playlist transfer model<br/>[Playlist.js]"]
  node_trackservice["Saved track operations<br/>[TrackService.js]"]
  node_albumservice["Saved album operations<br/>[AlbumService.js]"]
  node_artistservice["Artist operations<br/>[ArtistService.js]"]
  node_spotifyclient["Spotify requests<br/>[Spotify.js]"]
  node_requesthelper["Sequential action helper<br/>[RequestHelper.js]"]
end

subgraph group_runtime["Client runtime"]
  node_socketadapter["Angular socket adapter<br/>[socket.js]"]
  node_socketclient["Socket.IO client<br/>[socket.io-1.4.5.js]"]
  node_underscore["Collection utilities<br/>[underscore-min.js]"]
end

node_user(("User"))
node_browser(("Browser"))
node_spotify{{"Spotify API"}}

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_angularapp
node_browser -->|"requests pages"| node_appserver
node_angularapp -->|"routes to"| node_main
node_angularapp -->|"initializes"| node_users
node_login -.->|"updates accounts"| node_users
node_login -.->|"uses"| node_socketadapter
node_socketadapter -->|"wraps"| node_socketclient
node_socketclient -.->|"socket events"| node_appserver
node_appserver -->|"exchanges tokens"| node_spotify
node_appserver -->|"serves"| node_callback
node_callback -->|"returns after login"| node_browser
node_main -.->|"shows"| node_playlistui
node_main -.->|"shows"| node_trackui
node_main -.->|"shows"| node_albumui
node_main -.->|"shows"| node_artistui
node_playlistui -->|"loads playlists"| node_playlistservice
node_playlistui -->|"transforms items"| node_playlistmodel
node_playlistui -->|"dispatches transfer"| node_requesthelper
node_playlistmodel -.->|"delegates operations"| node_playlistservice
node_trackui -.->|"uses"| node_trackservice
node_albumui -.->|"uses"| node_albumservice
node_artistui -.->|"uses"| node_artistservice
node_playlistservice -->|"requests playlist data"| node_spotifyclient
node_playlistservice -->|"batches track adds"| node_requesthelper
node_trackservice -->|"reads and writes tracks"| node_spotifyclient
node_trackservice -->|"batches transfers"| node_requesthelper
node_albumservice -->|"reads and writes albums"| node_spotifyclient
node_albumservice -->|"batches transfers"| node_requesthelper
node_artistservice -->|"reads and follows"| node_spotifyclient
node_artistservice -->|"batches transfers"| node_requesthelper
node_spotifyclient -.->|"calls API"| node_spotify
node_requesthelper -.->|"runs actions"| node_spotifyclient
node_trackservice -.->|"maps item IDs"| node_underscore
node_albumservice -.->|"maps item IDs"| node_underscore
node_artistservice -->|"maps artist IDs"| node_underscore

click node_appserver "https://github.com/vitorhasilva/trikatuka/blob/master/server.js"
click node_callback "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/afterLogin.html"
click node_angularapp "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/app.js"
click node_login "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/LoginCtrl.js"
click node_main "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/MainCtrl.js"
click node_users "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/factories/User.js"
click node_playlistui "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/PlaylistListCtrl.js"
click node_playlistservice "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/PlaylistService.js"
click node_playlistmodel "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/factories/Playlist.js"
click node_trackui "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/TrackListCtrl.js"
click node_trackservice "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/TrackService.js"
click node_albumui "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/AlbumListCtrl.js"
click node_albumservice "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/AlbumService.js"
click node_artistui "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/ArtistListCtrl.js"
click node_artistservice "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/ArtistService.js"
click node_spotifyclient "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/Spotify.js"
click node_requesthelper "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/RequestHelper.js"
click node_socketadapter "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/socket.js"
click node_socketclient "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/socket.io-1.4.5.js"
click node_underscore "https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/underscore-min.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_appserver,node_callback,node_user,node_browser toneBlue
class node_angularapp,node_login,node_main,node_users,node_playlistui,node_trackui,node_albumui,node_artistui toneAmber
class node_playlistservice,node_playlistmodel,node_trackservice,node_albumservice,node_artistservice,node_spotifyclient,node_requesthelper,node_spotify toneMint
class node_socketadapter,node_socketclient,node_underscore toneRose
```

## Components

### Server and authentication

- [Web and auth server](https://github.com/vitorhasilva/trikatuka/blob/master/server.js): `server.js`
- [Auth callback page](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/afterLogin.html): `webapp/afterLogin.html`

### Account and UI

- [Angular app routes](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/app.js): `webapp/app/app.js`
- [Login controller](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/LoginCtrl.js): `webapp/app/controllers/LoginCtrl.js`
- [Main controller](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/MainCtrl.js): `webapp/app/controllers/MainCtrl.js`
- [Account sessions](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/factories/User.js): `webapp/app/factories/User.js`
- [Playlist transfer UI](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/PlaylistListCtrl.js): `webapp/app/controllers/PlaylistListCtrl.js`
- [Saved tracks UI](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/TrackListCtrl.js): `webapp/app/controllers/TrackListCtrl.js`
- [Saved albums UI](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/AlbumListCtrl.js): `webapp/app/controllers/AlbumListCtrl.js`
- [Followed artists UI](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/controllers/ArtistListCtrl.js): `webapp/app/controllers/ArtistListCtrl.js`

### Transferable libraries

- [Playlist operations](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/PlaylistService.js): `webapp/app/services/PlaylistService.js`
- [Playlist transfer model](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/factories/Playlist.js): `webapp/app/factories/Playlist.js`
- [Saved track operations](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/TrackService.js): `webapp/app/services/TrackService.js`
- [Saved album operations](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/AlbumService.js): `webapp/app/services/AlbumService.js`
- [Artist operations](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/ArtistService.js): `webapp/app/services/ArtistService.js`
- [Spotify requests](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/Spotify.js): `webapp/app/services/Spotify.js`
- [Sequential action helper](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/app/services/RequestHelper.js): `webapp/app/services/RequestHelper.js`

### Client runtime

- [Angular socket adapter](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/socket.js): `webapp/js/socket.js`
- [Socket.IO client](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/socket.io-1.4.5.js): `webapp/js/socket.io-1.4.5.js`
- [Collection utilities](https://github.com/vitorhasilva/trikatuka/blob/master/webapp/js/underscore-min.js): `webapp/js/underscore-min.js`

### Other components

- **User**
- **Browser**
- **Spotify API**

## Connections

- User → Browser: uses (evidence: `README.md`)
- Browser → Angular app routes: opens (evidence: `webapp/app/app.js`)
- Browser → Web and auth server: requests pages (evidence: `server.js`)
- Angular app routes → Main controller: routes to (evidence: `webapp/app/app.js`)
- Angular app routes → Account sessions: initializes (evidence: `webapp/app/app.js`)
- Login controller → Account sessions: updates accounts
- Login controller → Angular socket adapter: uses
- Angular socket adapter → Socket.IO client: wraps (evidence: `webapp/js/socket.js`)
- Socket.IO client → Web and auth server: socket events
- Web and auth server → Spotify API: exchanges tokens (evidence: `server.js`)
- Web and auth server → Auth callback page: serves (evidence: `server.js`)
- Auth callback page → Browser: returns after login
- Main controller → Playlist transfer UI: shows
- Main controller → Saved tracks UI: shows
- Main controller → Saved albums UI: shows
- Main controller → Followed artists UI: shows
- Playlist transfer UI → Playlist operations: loads playlists (evidence: `webapp/app/controllers/PlaylistListCtrl.js`)
- Playlist transfer UI → Playlist transfer model: transforms items (evidence: `webapp/app/controllers/PlaylistListCtrl.js`)
- Playlist transfer UI → Sequential action helper: dispatches transfer (evidence: `webapp/app/controllers/PlaylistListCtrl.js`)
- Playlist transfer model → Playlist operations: delegates operations
- Saved tracks UI → Saved track operations: uses
- Saved albums UI → Saved album operations: uses
- Followed artists UI → Artist operations: uses
- Playlist operations → Spotify requests: requests playlist data (evidence: `webapp/app/services/PlaylistService.js`)
- Playlist operations → Sequential action helper: batches track adds (evidence: `webapp/app/services/PlaylistService.js`)
- Saved track operations → Spotify requests: reads and writes tracks (evidence: `webapp/app/services/TrackService.js`)
- Saved track operations → Sequential action helper: batches transfers (evidence: `webapp/app/services/TrackService.js`)
- Saved album operations → Spotify requests: reads and writes albums (evidence: `webapp/app/services/AlbumService.js`)
- Saved album operations → Sequential action helper: batches transfers (evidence: `webapp/app/services/AlbumService.js`)
- Artist operations → Spotify requests: reads and follows (evidence: `webapp/app/services/ArtistService.js`)
- Artist operations → Sequential action helper: batches transfers (evidence: `webapp/app/services/ArtistService.js`)
- Spotify requests → Spotify API: calls API
- Sequential action helper → Spotify requests: runs actions
- Saved track operations → Collection utilities: maps item IDs
- Saved album operations → Collection utilities: maps item IDs
- Artist operations → Collection utilities: maps artist IDs (evidence: `webapp/app/services/ArtistService.js`)
