Welcome to the Top Artists App Project. The project is split into folders, named appropriately for the client and server. Follow the installation instructions below.
Top Artists App requires Node.js v6+ to run.
Simply fire up a terminal window and run the following commands from the project root.
$ cd server
$ npm install && npm start
The Server should now be running on Port 3000. To test this, fire up Postman (or your browser) and navigate to: http://localhost:3000/topArtists
Once again, fire up a terminal window and run the following commands from the project root.
$ cd client
$ npm install && npm start
The client should now be running, and should've opened up a tab in your browser, but if not, you can navigate to http://localhost:3001
The server app has a Dockerfile included, and you can build a docker container using docker-machine
and docker-build
locally.
There are some basic tests set-up for the server API project, to access just run the following commands from the root.
Note: Using some 3rd party libraries including: Mocha, Chai and Async.
$ cd server
$ npm test
The following are items of work needed to better improve the codebase of this project:
Server
- More unit tests, including failing scenarios etc.
- More validation around the LastFM API and data
Client
- Apply more DRY principals and abstraction with methods
- Add unit tests
Whilst using the Last FM API, I have noticed some odd behaviours at times with the limit
and page
params. For example, consider these URL.
If you hit this URL, you will receive more than 5 results, however the attributes shows the perPage
attribute as 5, although it's not respecting it.
http://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=david bowie&format=json&limit=5&page=4&api_key=d3f706c99f731811d7da46348c32bcc2
If you hit another page (e.g. on either side of this, page 3 or 5), then it will respect it.
http://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=david bowie&format=json&limit=5&page=5&api_key=d3f706c99f731811d7da46348c32bcc2