A simple API that returns a song / playlist and a matching cocktail for a given mood.
This project was originally a university project as an introduction to web development. Our idea was to create an API that returns a song / playlist via Spotify and a matching cocktail for a given mood. Since this was a university project a simple json
File with some cocktails and a very simple matching algorithm did suffice.
We still think that this is a fun idea, thats why this project is now being revived. There are still a lot of things to be done and help is greatly appreciated (remember that this was a university project... The code might not be the greatest but it is working. And that's what counts... Right?? ;) ).
To run this project locally some things have to be done:
- You have to create a Spotify API App to receive a client secret and id (see Spotify API)
- Clone or fork this project
- Add a
.env
file in the projects root with the following variables:CLIENT_SECRET
(your Spotify API Client Secret)CLIENT_ID
(your Spotify API Client Id)
- Run
npm install
to install the dependencies - Run
npm start
to start the API
Now you should be able to get a track and cocktail combination from the API (see Routes for more information on how to get the data).
These are the current available routes and how to use them:
/combination/track?mood
Get a single Track paired with a cocktail, if the mood query parameter is not provided the default mood (happy) will be used.
/combination/playlist?mood
Get multiple Tracks paired with a cocktail, if the mood query parameter is not provided the default mood (happy) will be used.
The code of this API might change a lot over the course of the next few weeks. This includes the routes and the responses. Because of that this API should not be used in a project as a dependency (yet), until we have achived a stable code base.
The last commit that could be seen as belonging to the original university project is 817337c. This commit merges some project clean up efforts by @nickcrisci. This did not change the original functionality of the API.