How sapirkro/spotify-clone works
Detailed Component Breakdown
a) UI Layer (Blue Section):
• HomeScreen
• LibraryScreen
• LikedSongsScreen
• LoginScreen
• PlaylistInfoScreen
• SongInfoScreen
• To reusable components:
• ArtistCard
• RecentlyPlayedCard
• SongItem
• FloatingPlayer
b) State Management (Green Section):
• PlayerContext (central state management)
• AsyncStorage (local data persistence)
c) API Integration (Yellow Section):
• SpotifyApi Module
• Authentication Flow
• API Endpoints:
• Recently Played
• Playlists
• Top Artists
• Liked Songs
d) Media Playback (Purple Section):
• Expo AV Integration
• Audio Player Controls
• User interactions (green)
• API calls (blue)
• Media streaming (red)
• Authentication flow (orange)
External Services Integration
Mobile App <-> Spotify Web API
• ↑ ↑
• ┘
• Authentication Flow
Important Elements
• Login initiation
• OAuth2 redirect
• Token management
• Refresh token flow
• Data persistence flow:
• AsyncStorage interactions
• Caching strategy
• Media playback pipeline:
• Audio stream handling
• Player state management
• 30-second preview limitation
Technical Stack Callouts
• React Native/Expo
• Spotify Web API
• Expo AV
• Axios
• AsyncStorage