Vite to build the site, which has been a delight to use. Very quick and easy, supporting my go-tos React, TypeScript, and SCSS with no issues. Thereās a handy plugin called Vite Plugin CSP Guard that can configure and auto-insert a client-side Content Security Policy easily, that I thought would help make the site a bit more secure as itās dealing with Spotify user data, and show that Iām not sending data off anywhere else.
connect-src: https://accounts.spotify.com https://api.spotify.com;
Thereās also a plugin to easily enable HTTPS on localhost, called Vite Plugin mkcert which was necessary for letting the Spotify auth API redirect to my local Vite dev server.
The upload dialog
I used Bulma CSS framework again, great for side projects. Shout out to the Bulma List extension for making lists really simple to implement.
The Spotify docs were really useful throughout building the site. They provided clear instructions for setting up PKCE auth with JavaScript examples, and their endpoints are all documented well. Thereās an SDK you can use, but if you want to roll your own requests like I did, you can just use the TypeScript definitions that the SDK provides, which are nicely standardised with things like a Page<T>
type for pagination, and different endpoints share the same types, like search and playlists both return the SimplifiedAlbum
type.
Coming to the end of the project, I wanted to put the site up on GitHub Pages with my client ID, so anyone could log in and try it out. But it turns out Spotify puts your app into a limited, invite-only ādevelopment modeā and production mode is basically only available to businesses on request, including having at least 250,000 monthly active users š±. Fair enough, Iām happy I can at least use it personally to spruce up my own playlists.
I have uploaded the site to GitHub Pages anyway, and you can set your own client ID from the Spotify developer dashboard. Try it out here, and thanks for reading!