Skip to content

LolindaLP/spotify-server

Repository files navigation

Spotify Top 50 Songs

https://tgs50.com/

Project Overview

The Flask web application displays today's top 50 Spotify tracks and allows users to view top tracks for other days in the database. It also features a graph showing the top 5 most popular artists and their song counts per day.

How It Works

1. Daily Data Acquisition:


- A cron job runs a Python script daily to generate a Spotify API access token.
- The script fetches the Spotify Top 50 Global playlist data.
- Track details (title, artist, album, popularity) are extracted and stored in an SQLite database.

2. Data Storage:


- Track data is stored in an SQLite database, maintaining historical data for user access.

3. Flask Web Interface:


- The Flask app retrieves and displays the top 50 tracks for the current day.
- It uses the Plotly library to create a graph of the top 5 artists and their song contributions.
- Users can select different dates to view past top tracks, dynamically updating the displayed data.

4. User Interaction:


- A date picker allows users to choose specific dates.
- The application fetches and displays data for the selected date from the database.

5. Data Persistence:


- The SQLite database ensures data persistence for future access.
- Daily cron jobs update the database with the latest top 50 tracks.

Setup Instructions

Follow these steps to set up the project from the repository:

1. Create Your EC2 Instance

1. Launch an EC2 Instance:

  • Go to the AWS Management Console.
  • Navigate to the EC2 Dashboard.
  • Click on "Launch Instance".
  • Select an Amazon Machine Image (AMI) (e.g., Amazon Linux 2).
  • Choose an instance type (e.g., t2.micro).
  • Configure instance details and add storage as needed.
  • Configure the security group to allow SSH (port 22).
  • Review and launch the instance.

2. Connect to Your EC2 Instance.

2. Add Your Secrets

Create secrets in Github Actions if you want to update your server with it:

  • EC2_SSH_KEY
  • HOST_DNS
  • TARGET_DIR
  • USERNAME

3. Download the Makefile

1. Download the Makefile to EC2:
On your EC2 instance, use curl or wget to download the Makefile from the provided URL:

cd /home/ec2-user/
wget https://github.com/LolindaLP/spotify-server/raw/master/Makefile

2. Paste Spotify API Credentials:
Open the Makefile and add your Spotify API credentials:

nano /home/ec2-user/Makefile

4. Install 'make'

Install make and run the Makefile:

sudo yum install make
make

This concise overview captures the essential details and steps for setting up and understanding the project.

About

repository for spotify app server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published