anirvan / spotify-playlist-lookup

Service, that allows lookup of Spotify playlists by songs that they contain.

Home Page:https://playlists.dags.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spotify playlist lookup

Service, that allows lookup of Spotify playlists by songs that they contain.

Site available in BETA at https://playlists.dags.dev

Upstream: https://github.com/NomadicDaggy/flask-on-docker

Rough plans (in no particular order)

Technical

  • Database Migrations - needed for persistant prod db to be able to update it without a hassle or data loss.
  • Templates - together with WTForms would enable easy page creation.
  • App Factory - enables setting up a separate app for each test.
  • Tests - need the scaffolding and refactoring for testing to work at all.
  • Hot Reload - make the dev app hot-reloadable for way easier front-end development.
  • Analytics - add something like google analytics, but not that.
  • Background Tasks - add Celery and RabbitMQ, get user playlists in the background.
  • RESTful API - split out the api for playlist import/search and use it from the front-end #16.
  • JSON Schema - Add JSON Schema validation #17.
  • Async - currently the server can serve only 1 client at a time. So a large playlist import might block other users.
  • Logs - docker-compose does logging, but the logs are not persisted anywhere.
  • Proper Error Handling - any exception would show up to a user as an Internal Server Error.
  • Comprehensive Tests - tests with reasonable coverage (and testing coverage as a thing we check).
  • CI & CD - automatically test and deploy the main branch if tests pass.

App features

  • Style - front-end literally anything else than plain HTML.
  • Playlist Import - importing playlists from the client.
  • Track Search - searching playlists by tracks from the client.
  • Spotify Login - allow login with Spotify and automatically import user playlists.
  • Playlist Updates - periodically update oldest playlists with their new tracks (as a job of some sort).
  • Mobile Front-End - currently the layout is not responsive.

Usage

First setup

Requires docker and docker-compose.

Fill .env.spotify with your apps details.

For running tests, use test_run.sh.

For running the development version see dev_run.sh.

For production deployment use prod_run.sh, but that also requires .env.prod and .env.prod.db to be created and filled.

Commonly needed things

The dev app is visible at localhost:1337

You can connect to the dev database with docker-compose exec db psql --username=spotify_playlist_lookup --dbname=spotify_playlist_lookup_dev

And see server logs with docker-compose logs -f

New migration with running dev container with docker-compose exec web flask db migrate -m "reason for migration"

About

Service, that allows lookup of Spotify playlists by songs that they contain.

https://playlists.dags.dev

License:MIT License


Languages

Language:Python 53.5%Language:Vue 26.1%Language:CSS 11.3%Language:TypeScript 5.5%Language:Shell 1.4%Language:Dockerfile 1.1%Language:Mako 0.6%Language:JavaScript 0.5%