GithubHelp home page GithubHelp logo

akgunberk / reactjs-challange Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yigit-bwise/reactjs-challange

0.0 0.0 0.0 68 KB

Code challenge for React.js

Home Page: reactjs-challange.vercel.app

HTML 9.42% JavaScript 45.68% SCSS 44.90%

reactjs-challange's Introduction

Buddywise Reactjs Coding Challenge [Spotify Music ๐ŸŽง] ย 

You can find deployed version of the challenge from https://reactjs-challange.vercel.app/

Please read the details below for the implementation approach of this challange. ย 

Goals/Outcomes โœจ

  • To test knowledge of consuming APIs and handling responses
  • Loading state and knowing where and how to make multiple API calls efficiently
    To reach the goals and outcomes, I followed the steps below.

ย 

Think about ๐Ÿ’ก

  • Taking a look at the Spotify API documentation
    I got help from the documentation authorization guide. Also checked the endpoints and their response in the documentation.
  • Do you resolve each API request one after the other or in parallel?
    Firstly, I resolved requests via Promise.all that executes axios promises in parallel to fasten the loading process. However, if one of the requests would fail all the others will be unaccessible. That's why i used Promise.allSettled and set state if the matching request fulfilled. I think it will increase the average user experience. At the end of day, they may not even realize if there is an error came from the service.
  • Where do you make the API requests?
    I choose Discover component in order not to block other components to be rendered.
  • How much logic do you offload out of the UI components?
    I made an api instance and completely offload services from the UI. To make them to be easily found, create an api folder and name files according to the endpoint. It also make it easier to test each services if we want to.

ย 

Pre-requisites โœ…

  • Add your Spotify client ID & secret to config.js
    To prevent CORS and security issues, since client_credentials is used and it only works server-to-server, a small Nodejs-Express application deployed on Heroku to serve access token to the client side. Heroku application will be dismissed in a week.

ย 

Requirements ๐Ÿ“–

  • Fetch and display Released This Week songs
  • Fetch and display Featured Playlists
  • Fetch and display Browse genres
    Singleton pattern is used to create an axios instance for adding Auth_Token to all request will be made
    Axios interceptors used to shape the data came from server for clean responses
  • Loading state/UI (optional, current UX is already clean)
    A spinner from fortawesome library is added to show loading state. For the error cases, user will be notified with an apology message.

reactjs-challange's People

Contributors

akgunberk avatar yigit-bwise 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.