Git Product home page Git Product logo

aula-audio-player's Introduction

How to start the project

yarn

Install the modules.

yarn db:migrate

Will perform all necessary database migrations.

yarn start:server

Starts the Express.js server (located in ./server folder). The server will run by default on port 8080. The Node.js version used was 12.0.0

yarn start

Note: Run this in a different terminal window

Starts the React.js front-end. The client will run by default on port 3000.

Notes about the back-end

There are two available routes:

  • GET /songs - retrieves all songs metadata. Receives two query parameters:
    • page, which gives the metadata for the songs in the current page taking into account the page size. Defaults to 0.
    • pageSize, which gives the amount of results to be returned (offset). Defaults to 10.
  • GET /songs/**/*.wav - retrieves .wav files from server/public folder.

Examples:

Improvements

Front-end

  • Add previous and next buttons to go to the previous and next pages;
  • The React Audio Player that is being used to create the player creates a PAUSE event right before the END event, which is unnecessary (creates two updates in the player reducer);
  • Contains some tests for the reducers but there are no tests for the components. react-testing-library or enzyme could have been used;
  • It might make more sense to have the frond-end organized by feature if the codebase grows;
  • Heading to http://localhost:3000/songs/1 will not work as this solution is not server rendered;
  • The UX can be improved as in the list page the user has to press the play button to play a song, but there is no play button on the details page (only the audio player one). In order to start a song in the details page the user has to press the play button from the audio player.

Back-end

  • The back-end misses a proper way to pass the database connection through the handler(s);
    • One way to do this is by creating a middleware that sets the database in app.locals and is included for every route as app.use(setupDBMiddleware). This allows db to be accessed through app.locals but I'm not sure if it is the right/default way to do it.
  • The public folder is being exposed in /songs endpoint, maybe a better naming could be used here (note that only .wav files are exposed);
  • Misses Tests on the back-end.

aula-audio-player's People

Contributors

sericaia avatar

Watchers

 avatar  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.