Skip to content
divyaponniah edited this page Mar 19, 2023 · 16 revisions

HOW IT WORKS

HOW TO INSTALL/DEPLOY

FRONTEND

In order to start the frontend locally:

  1. Run npm install to install node modules
  2. Create a .env file at the root directory

Within the file, add REACT_APP_ENVIRONMENT=local

  1. Run npm start

BACKEND

In order to start the backend locally:

  1. Change the directory to the server using cd server
  2. Run npm install to install the relevant node modules
  3. Create a .env file
  4. Create a project on the Spotify Developer Portal

Set up Spotify Credentials:

Within your .env file, put your CLIENT_ID and CLIENT_SECRET. Within the settings of your Spotify project, add http://localhost:8888/callback/ as a redirect URI.

  1. Set up OpenAI credentials:

Login/sign up to platform.openai.com. Go to Personal > View API Keys > Create new secret key. Add OPEN_API_KEY={your secret key} to the .env file.

Your .env file should look like this:

205EF5F2-1575-4DC6-8335-9BE37F05944C_4_5005_c

  1. Run node app.js to start the server

HOW TO USE THE APP

LOGIN

Upon deploying the application, users are taken to a login page within Moodify. Upon pressing the login button, they are redirected to Spotify's authentification. Providing access to their Spotify account allows the application to create customized playlists based on the user's listening history.

0DFC761E-E345-4050-907A-F63AA3A10171_1_105_c

B390DA4F-B8C1-41AC-AE2C-9D4EE98283A8_1_105_c

GENERATE PLAYLIST

By utilizing the Navigation Bar at the top of the page, users are able to traverse to the "generate" page. They are then presented with a form where they are able to enter a mood - the application will utilize the mood as well as Spotify's API to create a personalized playlist for the user. They are then automatically redirected to the results.

C499DF22-200B-44E9-A0A2-8D2D0F7FAC79_1_105_c

RESULTS

Within the "results" page, each of the tracks within the playlist is displayed including information on the album cover, song title, artist, album name, and duration. A playlist name is produced from the mood as well as AI-generated art for the playlist cover. From there, the user has the ability to either add the playlist to their Spotify library - as reflected below - or generate another playlist.

BAE38F5E-2BF3-4DFE-ADE2-802EBB917E62_1_105_c

306BF8CF-D918-4B16-8DBE-EC9FE9095440_1_105_c

933D14DC-F748-4CFF-829D-5A918BE86044_1_105_c

Clone this wiki locally