Giter Club home page Giter Club logo

musicritic-server's People

Contributors

joserenan avatar jrobsonjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

musicritic-server's Issues

Unexpected errors are not being treated

When an unexpected error is thrown, it is not being treated and it's not returned on the HTTP response, making the request look like it hasn't finished yet.
It's needed to use a generic treatment for this kind of server errors returning the following response and logging the error stack, what will make the system more debuggable and won't let the client wait the time limit to get an answer from server.

default response:

{
       "status": 500,
       "message": "Unexpected server error ocurred"
}

Create an endpoint for search tracks, albums, playlists, users, etc.

Description

On Musicritic, we have a search page where we can search for tracks, albums, artists and playlists. Currently, we are requesting this data directly from the Spotify API endpoint, but in the near future we will need to search the Musicritic users too, and, therefore, the client would have to make 2 requests to different APIs.
This process would be simplified by creating an endpoint that solves both searches at the same time. One of the benefits of implementing this issue is that the user wouldn't have to be logged in or to have connected Musicritic with Spotify to make searches.

In order to do this, it is required to generate a Spotify token for the server that will make the request from Spotify. As for the users, they can be requested from Firebase Admin SDK.

endpoint example:

  • GET: /search?type=artists%20tracks%20users,

where type is a string with the types of things you want to search (one or more of artists, tracks, playlists, users and albums).
To request more than one type, you could separate the types by a single space, similarly to how it is done by the Spotify Web API.

return data example:

{
     "users": [],
     "tracks": [],
     "artists": []
}

Tasks:

  • Retrieve the Spotify Web API token and save it in the memory;
  • Make the requests to search for tracks, albums, artists and playlists (which is currently done) on Spotify;
  • Add the support to search for Musicritic users by username on the Cloud Firestore.

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.