music-server

A stateless NodeJS app that leverages AWS S3 & serves music through a REST API

View project on GitHub

NodeJS Music Server

Code Standard Greenkeeper badge Build Status Maintainability codecov dependency status devDependency status Known Vulnerabilities

  • A stateless NodeJS app that leverages AWS S3 & serves music through a REST API

Available endpoints

name | description | Method |
— | — | — | <BASE>/api/songs | Get all songs available | GET <BASE>/api/songs/:key | Get a song using it’s key | GET <BASE>/api/songs/:key/metadata | Get a song’s metadata using it’s key | GET <BASE>/api/songs | Upload song(s) | POST

Requirements

  • NodeJS v7.6+
  • Yarn
  • AWS Account (to leverage S3)

Install

$ git clone https://github.com/shierro/music-server
$ cd music-server && yarn install

Set your Environment vars (important)

$ cp .env.example .env
  • Change .env vars with actual values
  • Set CREATE_BUCKET_IF_NOT_EXIST=true to let the app create bucket on start-up. If not, make sure that value of S3_BUCKET_NAME is a bucket that exists

Dev mode

$ yarn dev

Unit test & generate coverage

$ yarn run cover

Prod mode w/ docker-compose

$ docker-compose up -d

Things to improve

  • Get songs API to return list w/ metadata
  • Comment on all functions using jsdoc standards
  • Integrate swagger for better API documentation
  • Integrate jsdoc to auto-generate code documentation
  • More unit tests. Make average 80% -> 95%+
  • Secure APIs. JWT or oAuth2