Create group playlists that everyone will love
This application uses the Spotify API to retrieve information about a user's playlists and most listened tracks. It then allows a user to combine multiple people's listening preferences to generate a new playlist.
Application takes advantage of the following parts of the Spotify API:
Application uses spotipy on the backend to connect with the API.
The app is designed to be installed/run through Docker.
Install docker following their install instructions
For Linux users, after installing Docker you must also install docker-compose separately following the instructions found here. (Mac and Windows users should already have docker-compose included with Docker Desktop.)
On first startup, from the root folder run:
docker-compose build
To run the application, in a terminal window run:
docker-compose up
This will start all the necessary services (React, Postgres, Python) as well as automatically applying the latest database migrations (if any are pending). After this, the app can be accessed at http://localhost:3000. Any changes to react files will automatically get reloaded in the browser (it should also be possible to get the backend to so this same hot reloading).
Most of the time, the application is perfectly fine and will automatically update the frontend/backend without a restart. There are a few scenarios that do actually require a restart of the app though.
- New package added to Yarn
package.json
for react. This requires restartingdocker-compose up
. - New package added to Python
requirements.txt
for the backend. This requires rebuilding python withdocker-compose build python
and then restarting withdocker-compose up
. - Database migrations added. This requires restarting
docker-compose up
. - Edits to anything outside of
src/
orapp/
will also generally require restartingdocker-compose up
for changes to take effect.
Number one priority here, "No religious wars". That said, there's some clear considerations that should be made.
Python code should conform with best practices. For reference, Python has the really well defined PEP 8 style guide. We should follow this. Paramount here is following naming conventions, etc.
Frontend has access to eslint
using the Airbnb ruleset. This generally makes
us write better code to keep things tidy. We've already cleaned up the rules a
bit, though some still need more looking into. At the very least, it serves as a
good guideline and can autofix some of the more egregious errors (missing
semicolons, bad indentation, etc.). To run from outside of docker, use yarn lint-docker
.
All python code should use 4 space indentation. Other code should use 2 space indentation. There should always be one empty newline at the end of the file and no trailing whitespace. This can be automatically set in your editor using Editorconfig (just a case of adding or enabling a package to Atom/VS Code/IntelliJ/PyCharm/Textmate etc.)