A personal Spotify discovery app that breaks you out of the same 50 artists.
Discovery runs on the Last.fm API (open, read-only with an API key). It computes your sound profile from Last.fm genre/mood tags, then crawls the similar-artist graph for under-discovered acts (ranked by tag-match and listener-count obscurity). Because you listen on Spotify, the app maps each Last.fm track to a real Spotify track URI (via search) and writes your picks to a Spotify playlist β and the weekly cron keeps it fresh.
Rendering mermaid diagram...
index.tsβ Hono server: Spotify OAuth, session cookie,/api/me,/api/profile,/api/discover,/api/save.lib/spotify.tsβ OAuth + Spotify API client. Used for your top artists (discovery seeds), mapping tracks to Spotify URIs, and writing playlists.lib/lastfm.tsβ Last.fm client: similar artists, tags, listener counts, top tracks.lib/taste.tsβ taste profile (Last.fm tags), discovery, Spotify playlist writer.lib/db.tsβ SQLite storage for per-user Spotify tokens + playlist id.frontend/β React app with a constellation map + grid views.cron/refresh.tsβ weekly job that refreshes each user's "Discovery Radar" playlist (Sundays 12:00 UTC).
- Create a Last.fm API account at https://www.last.fm/api/account/create and copy your API key.
- Set the Last.fm key below.
π Add LASTFM_API_KEY here: https://www.val.town/x/test_account_001/discovery-radar/environment-variables?key=LASTFM_API_KEY
- Spotify (needed only for your listening): create a Spotify app at
https://developer.spotify.com/dashboard, add the redirect URI
https://discovery-radar.val.run/auth/callback, and set the two env vars below.
π Add SPOTIFY_CLIENT_ID here: https://www.val.town/x/test_account_001/discovery-radar/environment-variables?key=SPOTIFY_CLIENT_ID
π Add SPOTIFY_CLIENT_SECRET here: https://www.val.town/x/test_account_001/discovery-radar/environment-variables?key=SPOTIFY_CLIENT_SECRET
SPOTIFY_REDIRECT_URI is optional β it defaults to the callback URL above.
- Open the app, hit Connect Spotify, authorize, and your taste profile and a galaxy of discovered artists appear. Hit Save to write them to a private "Discovery Radar" Spotify playlist.
- Discovery = Last.fm; playlists = Spotify. This app's Spotify grant is restricted (no audio-features / recommendations / browse), so discovery moved entirely to Last.fm's open API. Spotify read is only used for your top artists and for mapping tracks to URIs β and Spotify write (playlists) works fine.
- Obscurity is driven by Last.fm listener counts (logged to a 0β100 "Popularity").
- The match % is tag overlap with your taste profile; the radar is your tag profile vs each artist's tags.
- The weekly cron refreshes the playlist for every connected user.
- If "Save" errors with "Spotify blocked playlist access", the token is missing
playlist-modify-*scopes β disconnect and reconnect Spotify to re-consent.