Code Monkey home page Code Monkey logo

playerstatpml's Introduction

playerstatpml

It is an express-typescript api or proxy that returns the stats provided by the Premier League.

CI codecov License: MIT

API status dashboard

playerstatpml's People

Contributors

celeroncoder avatar

Watchers

 avatar

playerstatpml's Issues

Cluster Support

Add Cluster Support for scalability of the server.

  • use node-js cluster module to create distribution over available clusters.
  • use throng module to make scalability over the server on different workers.

Refactor the API root navigation

Description
In the API root the navigation object topClubs has the wrong route, i.e api/v1/stats/top/players/:category.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to API-ROOT
  2. See the topClub.route prop.
  3. See the error

Expected behavior
topClubs.route should be api/v1/stats/top/clubs/:category.

Create a api root listing all the category types

What is category type?

Category type is my personal abbreviation to the names that have categories, currently i.e "players", "clubs".

Is your feature request related to a problem? Please describe.
When working with a client we have to hardcode the category type as a list.

Describe the solution you'd like
Create a new API route that will return an array of the category types.

Top Clubs Stat

Add top-clubs stats in different categories.

Add clubs stats with rank and their stats in different categories.

app not starting on production

The server is working fine in test and dev env but when NODE_ENV is set to production the server did not start up on the port.

Steps to reproduce the behaviour:

  • cd in the project root directory
  • run npm run build && npm start or NODE_ENV=production npm run dev
  • Even after a long time the server didn't start up and log that the server has started.

Expected behaviour
The server should startup as in the NODE_ENV=devlopment and log to the terminal The server started on port 8080

Screenshots

  • The server start in the NODE_ENV=development
    Screenshot from 2021-09-19 20-04-16
    The server start in NODE_ENV=production
    Screenshot from 2021-09-19 20-07-10

Desktop (please complete the following information):

  • OS: Linux/Ubuntu
  • Browser: Chrome and Firefox
  • Version: 20.04.3 LTS

Data Check Unit Test

Data Check of some unit-tests is returning an empty array.

To Reproduce
Steps to reproduce the behavior:

  1. Go to root of the project.
  2. Run yarn test.
  3. Scroll down to scraper.test.ts test runs.
  4. See error.

Expected behavior
The data check of clubs must return an array of type ClubData and it's length must not be equal to 0.

Log

● data check of fouls › should return 20 entries of players

    expect(received).toBe(expected) // Object.is equality

    Expected: true
    Received: false

      22 |         it("should return 20 entries of players", async () => {
      23 |             const clubData: ClubData[] = await scrapeClubData(data);
    > 24 |             expect(clubData.length > 0).toBe<boolean>(true);
         |                                         ^
      25 |         });
      26 |     });
      27 | }

      at test/scraper.test.ts:24:41
      at fulfilled (test/scraper.test.ts:5:58)

How to fix

  • Check if those categories exits.
  • Check if the pml website have the data for those categories.
  • Check the return of those categories on the API.

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.