Skip to content

A Spotify track recommendation tool and playlist analyzer built with Flask (Python), React (TypeScript), and Docker

License

Notifications You must be signed in to change notification settings

KirillTregubov/SoundInsights

Repository files navigation

Sound Insights

Find your next sound based on your favourite tracks or see all the interesting details about that one playlist you just can't get enough of. This is a University of Toronto group project for CSC302 that generates recommendations based on Spotify tracks and playlists and has a Spotify playlist analyzer that displays interesting visualizations.


Table of Contents

Screenshots

Desktop Screenshots

Screenshot of the Track Recommendations Screenshot of the Playlist Analysis Report

A3 Deliverable

This section contains some stuff regarding A3 for your convenience.

Guide

Our goal with visualization is to open people's eyes to why they listen to the music they listen to; to satiate their curiosity of their own listening trends. Ever wondered why you're putting that one artist's tracks on repeat 24/7? Plug their songs into our visual analysis systems and get some insight into what audio percs you're so enamored with. You might even find some new songs to get addicted to in the process!

To properly run our app, you'll need to have the correct secret values on your machine. We decided the easiest way to safely pass you these secret values is to upload them via the A3 quercus submission. Please check Eddie Shao's A3 quercus submission to get these secret values as well as the instructions on how to use them in our project.

Once you have the secrets set up, go through the Installation and Usage (build) instructions. The "Get Song Recommendations" and "Get Playlist Recommendations" features will recommend songs to you and the "Analysis of Top Playlists" feature will show some visual analysis about Spotify's top playlists. More information about these in the features section.

Visualization in our app is done in 2 different ways: song recommendations and data analysis using Recharts.

Features

Song Recommendations

Ask our app to recommend you some new songs based on what you give it. There are 2 ways to ask for song recommendations:

  • Search up individual Spotify tracks you enjoy and get our app to recommend you new songs similar to what you've chosen.
  • Choose a Spotify playlist from a predetermined list or search one and have our app recommend you new songs similar to those on the selected playlist.

Analyze Spotify's Top Playlists

Get a visual analysis of various information for the songs in Spotify's top playlists. Some things you can visualize include patterns in mood, genre, tempo, and more.

Our Dataset

The dataset we used is Spotify. More specifically, we used both the Spotify Million Playlist dataset and Spotify API in tandem.

  • The Spotify Million Playlist dataset is used to train our machine learning model. This model is what powers our song recommendation system.
  • The Spotify API is our data source for songs and playlists that we run visual analyses on. Through the Spotify API, we have access to audio and meta information which we use to display trends and patterns.

Roadmap

Our Roadmap shows all our tasks labelled by status (complete, in progress, not started), assignee, and milestone.

Tech Stack

Here is an overview of our tech stack. Detailed information (pros, cons, alternatives, etc.) can be found in this document.

Frontend

TypeScript Vite React

Backend

Python Flask

Container

Docker

CI

GitHub Actions

Installation

Linux

Install the development environment by executing the following command in a shell:

sudo bash run-install.sh

macOS

Install the development environment by executing the following command in a shell:

bash run-install.sh

Windows

On Windows, install the development environment by executing:

run-install.bat

Troubleshooting

To verify that the script worked, try to open Docker Desktop using your Operating System's search features. If it is missing or doesn't open and succesfully start the Docker engine, or if the install script fails, please install Docker Desktop yourself.

Usage

Linux

To build our application and run it in development mode, execute the following command:

sudo bash run-build.sh

To run tests for the application, execute:

sudo bash run-tests.sh

macOS & Windows (WSL)

To build our application and run it in development mode, execute the following command:

bash run-build.sh

To run tests for the application, execute:

bash run-tests.sh

Troubleshooting

If you run into issues related to permissions for running the scripts, execute the following command replacing <script> with the script name:

sudo chmod 755 ./<script>.sh

Other Scripts

To add a package to the backend, execute the following helper script:

bash ./backend/install-pkg.sh

To run linting for both the frontend and backend, execute:

bash ./run-lint.sh

Features we Missed

Analyze Your Spotify Account

Originally, we planned to also visualize data about a user's Spotify account (listening habits, song patterns, etc.). However, due to problems with time and Spotify authorization, we couldn't implement this.

User data visualization was the last item on our todo list, so we held off on researching it until later on. Unfortunately, we found out too late that the Spotify authorization we adopted in our project didn't allow us to do general user authentication. We didn't have time to re-implement the authorization flow again, so we decided to scrap that idea and analyze public data instead.

Legacy Documents

License

All code in this repository is distributed under the GNU GPLv3 license. See LICENSE.txt for more information.

Maintainers

(back to top)

About

A Spotify track recommendation tool and playlist analyzer built with Flask (Python), React (TypeScript), and Docker

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •