How tsargt/trend-for-you-ui works
This is a Spotify discovery and listening-analytics web app. The home page presents country/global and genre charts; the dashboard loads a track dataset for statistics and charts, supports Spotify connection and personal listening analytics, and offers personalized playlist creation. The graph follows the sampled page, hook, and function-invocation relationships; some dashboard details and endpoint wiring are only partially visible, so uncertain links are omitted or marked dashed.
Main entry points: Dashboard.tsx Dashboard Page · Index.tsx Discovery Page · useSpotify.ts Spotify Hook · App.tsx App Router
Components 22
Application
- App Router
src/App.tsx - Navigation
src/components/Navbar.tsx
Music Discovery
- Discovery Page
src/pages/Index.tsx - Track Cards
src/components/TrackCard.tsx
Analytics And Playlists
- Dashboard Page
src/pages/Dashboard.tsx - Dataset Hook
src/hooks/useDataset.ts - CSV Statistics
src/lib/csvParser.ts - Dashboard Views
src/components/dashboard - Recommendation Engine
src/lib/recommendations.ts - Personal Music View
src/components/dashboard/PersonalMusicTab.tsx - Saved Playlists
src/hooks/useUserPlaylists.ts
External Integrations
- Spotify Hook
src/hooks/useSpotify.ts - OAuth Callback
src/pages/SpotifyCallback.tsx - Supabase Client
src/integrations/supabase/client.ts - Spotify Auth Function
supabase/functions/spotify-auth/index.ts - Spotify Data Function
supabase/functions/spotify-data/index.ts - Genre Charts Function
supabase/functions/spotify-genre/index.ts - Top 50 Function
supabase/functions/spotify-top50/index.ts - Playlist Function
supabase/functions/create-playlist/index.ts
Other components
- Listener
- Track Dataset
- Spotify
Connections 28
- Listener → App Router: opens
src/App.tsx - App Router → Discovery Page: routes to
src/App.tsx - App Router → Dashboard Page: routes to
src/App.tsx - App Router → OAuth Callback: routes to
src/App.tsx - Discovery Page → Navigation: renders
src/pages/Index.tsx - Discovery Page → Track Cards: renders
src/pages/Index.tsx - Discovery Page → Supabase Client: invokes
src/pages/Index.tsx - Discovery Page → Genre Charts Function: requests
src/pages/Index.tsx - Discovery Page → Top 50 Function: requests
- Dashboard Page → Navigation: renders
src/pages/Dashboard.tsx - Dashboard Page → Dataset Hook: loads
src/pages/Dashboard.tsx - Dataset Hook → CSV Statistics: parses
src/hooks/useDataset.ts - Dataset Hook → Track Dataset: fetches
src/hooks/useDataset.ts - Dashboard Page → Dashboard Views: renders
src/pages/Dashboard.tsx - Dashboard Page → Spotify Hook: uses
src/pages/Dashboard.tsx - Dashboard Page → Saved Playlists: uses
src/pages/Dashboard.tsx - Dashboard Page → Recommendation Engine: generates with
src/pages/Dashboard.tsx - Dashboard Page → Personal Music View: renders
src/pages/Dashboard.tsx - Personal Music View → Recommendation Engine: imports
src/components/dashboard/PersonalMusicTab.tsx - Navigation → Spotify Hook: uses
src/components/Navbar.tsx - OAuth Callback → Spotify Hook: uses
src/pages/SpotifyCallback.tsx - Spotify Hook → Supabase Client: invokes
src/hooks/useSpotify.ts - Spotify Hook → Spotify Auth Function: requests
src/hooks/useSpotify.ts - Spotify Hook → Spotify Data Function: requests
src/hooks/useSpotify.ts - Spotify Auth Function → Spotify: authenticates
- Spotify Data Function → Spotify: fetches data
- Dashboard Page → Playlist Function: creates playlist
- Playlist Function → Spotify: creates playlist