Giter Site home page Giter Site logo

playlist-challenge's Introduction

Playlist Challenge

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

Features

Start by building out these features:

  1. Load the library of songs and show it in the browser.
  2. Add songs from the library to a playlist.
  3. Name and save a playlist.
  4. List saved playlists.
  5. 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:

  1. Play sounds! ๐ŸŽต
  2. Deal with authentication. ๐Ÿ”
  3. Work across browsers. Pick your favourite and get it working there. ๐Ÿ„

We reserve the right to ask you about how to implement them later ๐Ÿ˜€

API

Everything from /public/ is served at http://localhost:5000/.

The API provides the following methods:

GET /library/

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
    },
    ...
]

GET /library/:id/

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"
}

GET /playlist/

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
    ]
  },
  ...
]

GET /playlist/:id/

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
    ]
}

POST /playlist/ or POST /playlist/:id/

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
}

DELETE /playlist/:id

Deletes a playlist.

Request:

curl http://localhost:5000/playlist/10/ -X DELETE

Response:

{}

playlist-challenge's People

Contributors

kpuri94 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.