How pasiotestudio/underground works
Underground helps a Spotify user build a playlist of low-popularity tracks, filtering out tracks already in the playlist or previously used and artists the user has banned. The workflow spans Spotify login and token refresh, profile and playlist loading, genre-based track discovery, eligibility checks, playlist updates, and recording used tracks. The repository also provides genre and banned-artist management. Backend route excerpts expose most service relationships; frontend UI wiring is less visible in the available evidence, so its component-level connections are omitted.
Main entry points: login.js Login and logout · user.js User profile API · tracks.js Track and artist API · prisma.js Database client
Components 21
Web application
- Main page
frontend/app/page.tsx - Login redirect
frontend/app/redirect/page.tsx - Profile state
frontend/context/Profile.tsx - Add tracks UI
frontend/components/underground/AddTracks.tsx - Genre controls
frontend/components/underground/Genres.tsx - Banned artists UI
frontend/components/underground/BannedArtists.tsx - Playlist view
frontend/components/underground/Playlist.tsx - HTTP clients
frontend/util/axios.ts - Track selection
frontend/util/spotify.ts
Authentication
- API server
backend/index.js - Login and logout
backend/route/login.js - Cookie authentication
backend/middleware/auth.js - Token refresh
backend/util/token.js
Profile and playlist
- User profile API
backend/route/user.js - Playlist service
backend/spotify/playlist.js - Database client
backend/util/prisma.js - Application database
backend/prisma/schema.prisma
Track discovery and controls
- Track and artist API
backend/route/tracks.js
Other components
- Spotify user
- Spotify accounts
- Spotify Web API
Connections 25
- Spotify user → Main page: uses
README.md - API server → Login and logout: mounts routes
backend/index.js - API server → User profile API: mounts routes
backend/index.js - API server → Track and artist API: mounts routes
backend/index.js - Login and logout → Spotify accounts: exchanges code
backend/route/login.js - Login and logout → Spotify Web API: fetches user
backend/route/login.js - Login and logout → Playlist service: gets playlist
backend/route/login.js - Login and logout → Database client: reads and writes
backend/route/login.js - Login and logout → Cookie authentication: protects logout
backend/route/login.js - User profile API → Cookie authentication: protects routes
backend/route/user.js - Track and artist API → Cookie authentication: protects routes
backend/route/tracks.js - User profile API → Token refresh: handles token route
backend/route/user.js - Token refresh → Spotify accounts: refreshes token
backend/util/token.js - User profile API → Database client: reads and writes
backend/route/user.js - Track and artist API → Database client: reads and writes
backend/route/tracks.js - Login and logout → Spotify Web API: creates playlist
- User profile API → Playlist service: loads playlist
backend/route/user.js - Playlist service → Spotify Web API: manages playlists
backend/spotify/playlist.js - Database client → Application database: connects to
- Track selection → HTTP clients: uses clients
frontend/util/spotify.ts - Track selection → Spotify Web API: searches and edits
frontend/util/spotify.ts - Track selection → Track and artist API: checks and records tracks
frontend/util/spotify.ts - HTTP clients → User profile API: refreshes access token
frontend/util/axios.ts - User profile API → Spotify Web API: fetches user and tracks
backend/route/user.js - Track and artist API → Spotify Web API: fetches artist and track
backend/route/tracks.js