Page MenuHomePhabricator

Add leaderboard based on user's edits using Commons Android app
Open, Needs TriagePublic



The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Commons is not only the image repository for Wikipedia, but an independent project that seeks to document the world with photos, videos and recordings.


Github link:

The project is about adding a leaderboard based on user's edits using Commons. The feature will include only edits made with the mobile app, and users who have shown interest in this activity.

Project schedule:

  1. Update UI of achievements activity to display level (current activity) in first tab and Leaderboard in second tab (based on uploads).
  2. Designing and implementing the APIs for calculating and displaying ranks of the User (all time, monthly, weekly).
  3. Display user's Avatar and rank on Leaderboard screen fetched from API.
  4. Designing and implementing the APIs for displaying leaderborad (user list) based on 2 parameters - duration (all time, monthly, weekly), type (uploads, nearby, images used).
  5. Use the APIs to fetch leaderboard (user list) based on uploads via mobile app (all time) and display it in Leaderboard screen.
  6. Add pagination in the leaderboard screen to load more users on scrolling down.
  7. Add duration filters in leaderboard screen and show results based on selected filter (weekly, monthly, yearly, all time). Change the UI to show and select filter.
  8. Change the UI to show 3 different results (based on uploads, nearby, used). - add 2 more tabs
  9. Tapping the name of a user in the leaderboard should open the gallery of that user's pictures, probably as a browser URL for now.
  10. Write unit tests , documentation, fix bugs and Release (at least in alpha) - (2 weeks)
  11. If time permits, Add option for users to change Avatar, Store user's Avatar in cache for a month.


The score could reuse some numbers from achievements, but should only count edits done with the mobile app, because otherwise Vicuna/etc users will dominate the top of the leaderboard even if they don't use the mobile app.

Actually, I suggest listing in the leaderboard only the users who have ever opened the achievements activity. We must keep track of that information server-side. So the leaderboard would only list app users who have an interest in this kind of game.

Tapping the name of a user in the leaderboard should open the gallery of that user's pictures, probably as a browser URL for now. Knowing they are being watched by their peers will probably reduce the temptation to "cheat" (for instance by uploading 1000 pictures of the same spoon)

The user's name should be highligthed. Random idea: The length of the leaderboard could be dynamic, for instance if I am 3rd it could be 10 people, but if I am 13rd it could be 20 people. Or just make more people appear when scrolling down.

There could be weekly (last 30 days) rankings, yearly (last 365 days) rankings, all-time rankings.

To make it more visually attractive, I suggest using as a kind of avatar the user's most successful picture (the one which is used the most in the wikipedias/etc, or a random one if the user's pictures are not used yet anywhere). Random idea: Users like to personalize their avatar, so we could also offer the option to select one of the user's uploads as an avatar picture, but that may lead to more selfies, so this option could be an privilege to unlock (only users who are above level 5 for instance).

There is a lot of data to show, so we have to think the UI carefully. Here is just an idea:

The vegetable is a placeholder for the user's avatar.
I forgot to write the position number (1, 2, 3, etc). It is important because I want to know whether I climbed from 37th to 36th, and counting is boring.


The leaderboard lists should probably be calculated on the server where we currently perform achievement calculations, and cached (re-serve the same results if less old than 1 hour). The user will probably upload a few more pictures in 5 minutes and come see the leaderboard again. So we could recalculate only that user's new scores (and let the other people's scores the same until the next hour comes). In other words, only the users who keep looking at the leaderboard would have their score grow at smaller intervals than 1 hour. That 1-user-only recalculation itself should be cached something like 1 minute because a picture can not be neatly uploaded in less time, and to avoid useless server load.

The avatar miniatures (generated by mediawiki) should be cached by the app for like a month.

Skills required

  • Android SDK
  • Android UI design
  • Understanding of RxJava
  • Basic knowledge of Wikimedia APIs

Nice to have skills

  • Familiarity with Python
  • Familiarity with Kotlin


@maskaravivek and @Ujjwalagrawal17

Get started

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 1 2019, 7:34 PM
maskaravivek updated the task description. (Show Details)Mar 1 2019, 7:35 PM
maskaravivek updated the task description. (Show Details)Mar 1 2019, 7:39 PM

@maskaravivek Is there anything remaining in the project to do before this task can be closed?