The Vibe Compass app is featured on my website, https://www.sunfire.xyz/spotify/vibe-compass
It is a concept for a method of creating dynamic playlists by having the user create a large playlist with all their desired songs, and using the app to generate an order to pursue the vibe you want, rather than queuing songs manually.
This github repo is a showcase, as the actual implementation of the app is part of my Django implementation of the entire website and is therefore private. This public repo serves to show how this Dash app works, without comprimising the privacy and security of my entire website.
The views.py file first tells Django which page to render. It checks session data to see if a user has previously granted Vibe Compass access to their Spotify account. If they have not, it will direct the user to Spotify to grant access, utilising the Spotify Authorisation flow implemented in spotify_auth_flow.py. Upon successful Authorisation, the user is redirected to the Dash app, vibe_compass_app.py.
The app makes numerous requests to Spotify using the SpotifyAPI.py which I wrote, to get access to the users spotify data including playlists, and allows the user to queue their dynamically generated playlist. Any authorisation or API errors are handled by the same file, directing the user to an appropriate message on how to remedy the error. It is designed to handle edge cases such as if the user grants access but revokes it manually via Spotify etc.
It should be noted that this app is simply a concept, with the major hurdle being generating a more useful set of parameters, as by default Spotify only offers a handful which are not always accurate. That is, it may label a song as 90/100 on Danceability when in reality it is not a dance song at all.