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.
- 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.
- Track data is stored in an SQLite database, maintaining historical data for user access.
- 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.
- A date picker allows users to choose specific dates.
- The application fetches and displays data for the selected date from the database.
- The SQLite database ensures data persistence for future access.
- Daily cron jobs update the database with the latest top 50 tracks.
Follow these steps to set up the project from the repository:
- 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.
Create secrets in Github Actions if you want to update your server with it:
- EC2_SSH_KEY
- HOST_DNS
- TARGET_DIR
- USERNAME
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
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.