This is the source code to 12inch.reviews. It's a simple mash-up between Pitchfork reviews and the Spotify web sdk.
The entire app is frontend-only, created via create-react-app
.
There is a retriever
directory that is in charge of gathering album data via Pitchfork's API. The album data is then broken into multiple json files that are fetch
ed after the main page is booted and up.
The album JSON files are currently stored directly into the public
dir, under source control. This is mainly out of convenience since I have Netlify set to automatically deploy upon pushing to master.
All filtering occurs in the browser, using Javascript's native filter
method for arrays. I've found that this is still fast, even with tens of thousands of reviews loaded.
The retriever
script matches up each album with a Spotify album URI, via Spotify's search api.
Login occurs by token authorization that originates on the frontend. The authorization code from spotify is then fed into a netlify function that has the secret key, which exchanges the code for an access token.
The access token only has a shelf life of 1 hour, so refreshing occurs automatically when the token is expired and the player needs to play something.
- create-react-app
- Netlify functions
- spotify web SDK
- retriever - A simple ruby library get album data from Pitchfork
- In order for the player to work, You'll need a
.env
file that includesSPOTIFY_CLIENT_ID
andSPOTIFY_CLIENT_SECRET
. - Run
netlify dev
This project is licensed under the GNU General public license. See LICENSE.txt for more info.