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.envfiles.openaidjango-extensionssupabasenumpyjoblibpandasgradio_clientrichchannelsdjango-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-headersInstall the Bootstrap-Icons using npm:
npm i bootstrap-iconsInitiate the Redis server before starting your Web server:
redis-server --port 6579-
Retrieve API Credentials: Obtain the
CLIENT_IDandCLIENT_SECRETfrom your Spotify Developer Dashboard. -
Local Development:
- Create a
.envfile in the project root and add your Spotify API credentials:SPOTIPY_CLIENT_ID=your_client_id SPOTIPY_CLIENT_SECRET=your_client_secret
- Ensure
.envis listed in your.gitignorefile 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_IDandCLIENT_SECRETdirectly in your production environment’s configuration.
-
Replace the
GENIUS_CLIENT_ACCESS_TOKENin your.envfile.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_TOKENin your.envfile.
- Ensure to create your own
.envfile and populate it with your own Spotify, Genius, and OpenAI API credentials. - Do check lines 11-15 in
vibecheck/settings.pywhile working on your local machine. - Before pushing
developbranch intomaster, make sure the AWS Elastic Beanstalk environment is restarted withHealth:OK.
- Create environemnt