This repository contains the codebase for our team project, which involves interacting with the Spotify and Genius APIs to create a music-related application.
Ensure you have Python and pip installed. The following packages are required:
django
: Web framework.psycopg2_binary
: PostgreSQL adapter for Python.spotipy
: A lightweight Python library for the Spotify Web API.lyricsgenius
: A Python client for the Genius.com API.python-dotenv
: A Python module that allows you to specify environment variables in traditional UNIX-like.env
files.openai
django-extensions
supabase
numpy
joblib
pandas
gradio_client
rich
channels
django-cors-headers
Install the prerequisites using pip:
pip install django psycopg2_binary spotipy lyricsgenius python-dotenv openai django-extensions supabase numpy joblib pandas gradio_client rich channels django-cors-headers
Install the Bootstrap-Icons using npm:
npm i bootstrap-icons
Initiate the Redis server before starting your Web server:
redis-server --port 6579
-
Retrieve API Credentials: Obtain the
CLIENT_ID
andCLIENT_SECRET
from your Spotify Developer Dashboard. -
Local Development:
- Create a
.env
file in the project root and add your Spotify API credentials:SPOTIPY_CLIENT_ID=your_client_id SPOTIPY_CLIENT_SECRET=your_client_secret
- Ensure
.env
is listed in your.gitignore
file to prevent it from being tracked by Git.
Example usage in code:
import os from dotenv import load_dotenv load_dotenv() CLIENT_ID = os.getenv('SPOTIPY_CLIENT_ID') CLIENT_SECRET = os.getenv('SPOTIPY_CLIENT_SECRET')
- Create a
-
Production Deployment: Set the
CLIENT_ID
andCLIENT_SECRET
directly in your production environment’s configuration.
-
Replace the
GENIUS_CLIENT_ACCESS_TOKEN
in your.env
file.Example usage:
import lyricsgenius import os from dotenv import load_dotenv load_dotenv() token = os.getenv('GENIUS_CLIENT_ACCESS_TOKEN') genius = lyricsgenius.Genius(token) song = genius.search_song("Fairy Fountain (Link to the Past)", "Juke Remix") print(song.lyrics)
- Replace the
OPEN_AI_TOKEN
in your.env
file.
- Ensure to create your own
.env
file and populate it with your own Spotify, Genius, and OpenAI API credentials. - Do check lines 11-15 in
vibecheck/settings.py
while working on your local machine. - Before pushing
develop
branch intomaster
, make sure the AWS Elastic Beanstalk environment is restarted withHealth:OK
.
- Create environemnt