Build a single page web application for creating playlists from a library of songs!
Included in this folder is a Node.js web server which includes an API and a browser-based playlist application.
The API includes endpoints to complete the challenge.
To install and start the web server + web app:
npm install
npm start
Start by building out these features:
- Load the library of songs and show it in the browser.
- Add songs from the library to a playlist.
- Name and save a playlist.
- List saved playlists.
- Load saved playlists.
If you complete the above and still have time, try one of these, in no particular order:
- Drag 'n Drop organization.
- Search or filtering for songs.
- Sorting songs by properties like album, artist or length.
You do not have to do any of the following:
- Play sounds! ๐ต
- Deal with authentication. ๐
- Work across browsers. Pick your favourite and get it working there. ๐
We reserve the right to ask you about how to implement them later ๐
Everything from /public/
is served at http://localhost:5000/.
The API provides the following methods:
Returns a JSON array of songs.
Request:
curl http://localhost:5000/library/
Response:
[
{
"id": 0,
"artist": "The Black Keys",
"album": "Brothers",
"title": "Everlasting Light",
"length": 203,
"track": 1
},
{
"id": 1,
"artist": "The Black Keys",
"album": "Brothers",
"title": "Next Girl",
"length": 198,
"track": 2
},
...
]
Returns a JSON object for a song with given id
.
Request:
curl http://localhost:5000/library/200/
Response:
{
"album": "Nothing But The Beat",
"duration": 196,
"title": "Sweat (Snoop Dogg vs. David Guetta) [Remix]",
"id": 200,
"artist": "David Guetta"
}
Returns a JSON array of playlists.
Request:
curl http://localhost:5000/playlist/
Response:
[
{
"id": 0,
"name": "Ryan's Megamix",
"songs": [
20,
21,
56,
80,
99
]
},
{
"id": 1,
"name": "Ryan's Megamix 2",
"songs": [
20,
21,
56,
80,
99
]
},
...
]
Returns a JSON object with the playlist with given id
.
Request:
curl http://localhost:5000/playlist/0/
Response:
{
"id": 0,
"name": "Ryan's Megamix",
"songs": [
20,
21,
56,
80,
99
]
}
Saves a playlist and returns the id. May create a new playlist or override an old one.
Request:
curl http://localhost:5000/playlist/ -X POST -d '{ "name": "Hi", "songs": [1,2,3,4]}' -H "Content-Type: application/json"
Response:
{
"id": 100
}
Deletes a playlist.
Request:
curl http://localhost:5000/playlist/10/ -X DELETE
Response:
{}