Code Monkey home page Code Monkey logo

leaderboard's Introduction

MapSwipe Leaderboard

https://leaderboard.mapswipe.org

A simple leaderboard to allow display and aggregation of user metrics for the MapSwipe app.

Install and build

To get started, simply run

yarn install

yarn build

Development

To run on local, run

yarn start

This will run the app with local data (not API call) located in lib/json. This folder is ignored in the repo. You can create your own by downloading from Firebase console (Database Tab) those records:

  • users as src/lib/json/msf-mapswipe-users-export-v1.json
  • v2/users as src/lib/json/msf-mapswipe-users-export.json

To run on local with real data, simply run

yarn start:prod

As Firebase API have a limited number of API call, it would better to use real data just as final tests before deployment.

Deploy

The app is deployed using Firebase. You can access the live version of the leaderboard at leaderboard.mapswipe.org To deploy a new version, you will need to use the Firebase login and run:

On staging

yarn deploy:staging

On prod

yarn deploy:prod

leaderboard's People

Contributors

dependabot[bot] avatar ericboucher avatar hagellach37 avatar mamadouologuem avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

leaderboard's Issues

Cost mitigation idea

With the current mapathon ongoing, we've seen the firebase bill go through the roof, even with @Hagellach37 's fix 2-3 days ago on this code (which limits loading to the mappers who've opened the app in the last 24h, instead of all users ever).

There is still a lot of download happening, apparently because users keep refreshing the leaderboard a lot more than we expected.
An option to mitigate this cost in downloads could be to run a function server-side (within firebase) that prepares and caches values to show. For instance, we could imagine running a function every 5 minutes, which would simply run the current query, and copy the result onto some cloud storage (or VPN), and modify the frontend to load that file from bulk storage instead of firebase (and we put some caching logic there so that browsers don't reload more often than once/5 minutes for instance).

This would give us both lower transfer costs (we would effectively only have 1 load/5 minutes), and possibly faster loading for the leaderboard.

🐎 Implement a server side pagination

For now, we are pulling all the users data from the database before making a client-side pagination.
That makes the search, sort, and pagination easier and faster but definitely increases the initial loading time.
It can be useful to add a server-side pagination.

Username no longer appearing in leaderboard

Recently my account -alias sf_olemaire- has stopped showing up in the leadership board. Also my profile only displays nb of tasks swiped it does not show in km2 swipes anymore. It could be related if leadership board shows km2 and my km2 counter Is not updated properly. Indeed the issue happened after the application update.

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.