Page MenuHomePhabricator

[GSoC Proposal] Add leaderboard based on user's edits using Commons Android app
Closed, ResolvedPublic

Description

Add leaderboard based on user's edits using Commons Android app

Project Repository: https://github.com/commons-app/apps-android-commons

GSoC Idea Link: https://phabricator.wikimedia.org/T244197

Relevant Skills:

Github Workflow and Git Version Control

Linux and CLI

Android SDK

Android UI design

Understanding of RxJava, Dagger2, Androidx

Retrofit and OkHttp

Unit testing for Android

Familiarity with Kotlin

Familiarity with Python

Understanding of REST APIs with Python

Basic knowledge of Wikimedia APIs

Profile Information:

Name: Madhur Gupta

Email: madhurgupta10@gmail.com

University: Chitkara University, Punjab, India

IRC nickname on Freenode: madhurgupta10

Web Profile/Linkedin: madhur-gupta-in

Github Link: madhurgupta10

Other Communication Method: Google Hangouts, Zulip, Gitter, Slack

Location (country or state) during GSoC: Punjab, India (UTC +5:30)

Typical working hours (include your timezone) during GSoC: Between 5 pm to 2 am UTC +5:30

Possible Mentor(s)

Mentor: @Nicolas_Raoul (Nicolas Raoul)

Mentor: @maskaravivek (Vivek Maskara)

Synopsis

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: https://github.com/commons-app/apps-android-commons/issues/2074

Commons Android App Repo (for UI): https://github.com/commons-app/apps-android-commons/

Commons Misc Repo(for APIs): https://github.com/commons-app/commonsmisc

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.

About Me

I am a Final Year Computer Science Engineering Undergraduate student at Chitkara University, Punjab, India.

My expected graduation date is mid of August (based on last year's stats) but due to ongoing situation with COVID-19 it is expected to be delayed till mid of September.

I am Not Joining any Company for a full time or part-time job after my graduation. My current ongoing Internship at Sigfox Paris, France will be completed by mid of may after that I will come back to India. There will not be any examination or course work for my final semester after my internship.

I love Android Development and I have been doing it for the past three years. I am also a strong supporter of open source and I love contributing to it. I have contributed to the Commons Android app since March 2018.

In my first year of college, I was awarded the APJ Abdul Kalam IGNITE Award from the President of India for my innovation.

I have participated in many Hackathons and won prizes in various National and International Hackathons, few of them are:-

And many others…

I was also the recipient of Udacity and Google India’s Challenge Scholarship and Facebook’s PyTorch Scholarship.

Past Experience

I have completed my Software Development Engineering Internship at a Bangalore based Startup - Get My Parking where I worked on Backend Systems (Django/SQL) and Android App (Bluetooth Low Energy).

Currently, I am working as a Software Engineering Intern at a French Company - Sigfox Paris, France. This internship is three months long and it will be completed before GSoC. I am currently working on Cloud and Backend Systems.

I have also completed Udacity’s Android Developer Nanodegree Program for which I received a Graduation Scholarship. I also completed the Python Foundation Nanodegree and Data Structures Nanodegree.

I also worked as Udacity’s Mentor and Code Reviewer where I helped students with their doubts and guided them to follow best practices and also provided them personalized feedback on their projects.

I have developed many android apps and published some to Google Play Store.

  • Popular Movies App - This app is similar to IMDB App, it helps you discover popular and top-rated movies.
  • Baking App - With this app, you can learn about various baking recipes and can follow step by step guide to make them.
  • WalaAlarm - This app is an alarm clock with a twist which works with Walabot, where a user can set a goal for each morning like doing 10 PushUps, or Leave the Room, or Meditate to stop the alarm.
  • Weather App - This app helps you see the weather forecast of your favorite cities.

    And many more…

Apart from developing apps, I have experience in Backend and Frontend Development, etc. You may explore my Github and Linkedin for all my projects. Most of them were built in hackathons.

I have also conducted various workshops/seminars with Cisco and Topcoder for many students of the college. I worked as a Student Ambassador for both of these companies.

Other Skills - Developing Websites (Frontend and Backend) using HTML, CSS, Javascript, Python and NodeJs, Databases (SQL and NoSQL), Amazon Alexa and Google Assistant Skills, Arduino and Raspberry Pi, Blockchain and DApps, Docker, etc.

Participation

Project

  • What is the current state of the App/Project?

    People around the world use the Commons app to upload images of various things. Currently, the only way to encourage people to contribute more is Achievements. There is no way to compete with one another.
  • What is your goal for this GSoC Task and how will it benefit Wikimedia projects?

    The Goal of this GSoC Task is to build a Leaderboard where contributors can see the number of contributions they have made per week, per year and overall. This will encourage more and more people to contribute more media to the Wikimedia Commons.
  • Have you discussed this GSoC Task with your mentors already?

    Yes, this idea is discussed with all the possible mentors and project members you may find the discussion on this link
  • What does making this GSoC Task happen mean to you?

    Completing this project means a lot to me. I am a strong supporter of free and open-source work, by the completion of this GSoC Task more and more people will engage in contributing media to the Commons Android app.

Implementation

  • What can be implemented?

A new section called Leaderboard next to Achievements can be created. This leaderboard will show User’s Avatar, Name, and Score. 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.

Listing in the leaderboard only the users who have ever opened the achievements activity. We will keep track of that information server-side. So the leaderboard would only list app users who have an interest in this kind of game.

We can add auto-scroll to the user's current rank and highlight it so that users don't have to look at all results to see the rank, also a button can be added which will automatically jump to the user's rank on clicking.

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

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. 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 a privilege to unlock (only users who are above level 5 for instance).

  • How can it be implemented?

The leaderboard lists should 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 re-calculate only that user's new scores (and let the other people's scores stay 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 re-calculation 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.

We can automatically add the user in the leaderboard, once he performs any of these actions:

  • login
  • or upload
  • or nearby upload

    In our backend, we will have:
  • A list of users(with option 1 or 2) for whom we need to calculate statistics
  • Periodically fetch the statistics (every 1 or 4 hours). Update the statistics in our tools forge DB
  • When the Commons app does an API call to get leaderboard info, serve the statistics using tools forge DB instead of calculating real-time.

Mockups

Design 1 - Original Discussion/Suggestion from GSoC Idea List

Design 2(A) - Ongoing Discussion/My Suggestion

Design 2(B) - With a Button to Jump to Your Rank directly, this will be only shown when the user starts scrolling

Involvement

  • How are you involved with open-source?

    I am actively contributing to the Commons Android app project since March 2018, so far I have about 38 PR merged and also I have opened a lot of issues. I have also contributed to the other open-source organizations like Aossie, FossAsia, OpenMRS, Yogdaan, etc.
  • Apart from coding do you have any other kind of involvement with the organization?

    Yes, apart from Coding I have also worked as a GCI-Mentor 2019 for Wikimedia Foundation.

Availability

  • Eligible for Google Summer of Code and Outreachy?

    I am only Eligible for Google Summer of Code.
  • Do you plan to submit any other proposal apart from this one?

    No, I am only submitting this proposal.
  • Do you have any other plans this summer?

    No, I don’t have any other internship or plans for this summer. My current internship at Sigfox Paris will end by the first week of May and after that, I will return to India. I don’t have any holiday or vacation planned for this summer. I will also not have any coursework or examination during the GSoC period. I am not applying for any other program. Google Summer of Code is the topmost priority for me this summer.
  • How many hours per week can you dedicate for this?

    I will dedicate a minimum of 40 hours each week for this project, I am willing to dedicate more if needed.
  • Have you been accepted to GSoC before?

    No, I applied to this project under the Wikimedia Foundation last year but was not selected.

Timeline

TimeframeStart DateEnd DateTask
Community Bonding Period4-May-20201-June-2020Getting Familiarized with app structure, Wikimedia Api, and Community. Familiarize me with JavaRx. Go through Documentation once again.
Week 11-June-20207-June-2020Update UI of achievements activity to display level (current activity) in first tab and Leaderboard in the second tab (based on uploads).
(SubTask)1-June-20203-June-2020Complete the Leaderboard Fragment UI
(SubTask)4-June-20207-June-2020Add the Leaderboard to the Achievements Activity.
Week 28-June-202014-June-2020Designing and implementing the APIs for calculating and displaying ranks of the User (all-time, monthly, weekly). These would be Python APIs in commons-misc repo.
(SubTask)8-June-202010-June-2020Discuss and Design the API and ER Diagram and make a Swagger File
(SubTask)11-June-202014-June-2020Code the API in Python and Test it using Postman and Ngrok before hosting.
Week 315-June-202021-June-2020Display user's Avatar and rank on Leaderboard screen fetched from API.
(SubTask)15-June-202018-June-2020Fetch the results from the API using Retrofit
(SubTask)19-June-202021-June-2020Adjust the UI to display the results gracefully
Week 422-June-202028-June-2020Designing and implementing the APIs for displaying leaderboard (user list) based on 2 parameters - duration (all-time, monthly, weekly), type (uploads, nearby, images used).
(SubTask)22-June-202024-June-2020Discuss and Design the API and ER Diagram and make a Swagger File
(SubTask)25-June-202028-June-2020Code the API in Python and Test it using Postman and Ngrok before hosting.
Week 529-June-20205-July-2020Use the APIs to fetch leaderboard’s (user list) based on uploads via mobile app (all time) and display it in the Leaderboard screen.
(SubTask)29-June-20203-July-2020First Evaluation
(SubTask)29-June-202030-June-2020Fetch the results from the API using Retrofit
(SubTask)1-July-20204-July-2020Adjust the UI to display the results gracefully
(SubTask)5-July-20205-July-2020Blog Post
Week 66-July-202012-July-2020Complete Unit Tests for APIs fetch
(SubTask)6-July-20209-July-2020Complete Unit Tests for APIs for calculating and displaying ranks of the User
(SubTask)10-July-202012-June-2020Complete Unit Tests for APIs for displaying leaderboard based on that 2 parameters
Week 713-July-202019-July-2020Add pagination in the leaderboard screen to load more users on scrolling down.
(SubTask)13-July-202016-July-2020Implement Pagination and AutoScroll to user’s rank
(SubTask)17-July-202019-July-2020Add Loaders and Improve UX
Week 820-July-202026-July-2020Complete Tests for Pagination and Auto-Scroll
(SubTask)20-July-202023-July-2020Write Tests for Pagination
(SubTask)24-July-202026-July-2020Write Tests for Auto-Scroll Feature
Week 927-July-20202-August-2020Add duration filters in the leaderboard screen and show results based on the selected filter (weekly, monthly, yearly, all-time). Change the UI to show and select filters.
(SubTask)27-July-202031-July-2020Second Evaluation
(SubTask)27-July-202029-July-2020Implement Filter Classes
(SubTask)30-July-20201-August-2020Update the UI to use filters and improve UX
(SubTask)2-August-20202-August-2020Blog Post
Week 103-August-20209-August-2020Change the UI to show 3 different results (based on uploads, nearby, used). - add 2 more tabs
(SubTask)3-August-20205-August-2020Update the UI to enclose three different kinds of leaderboards
(SubTask)6-August-20207-August-2020Improve the UX
(SubTask)8-August-20209-August-2020Write Unit Tests for duration filters and this Feature
Week 1110-August-202016-August-2020Tapping the name of a user in the leaderboard should open the gallery of that user's pictures, probably as a browser URL, for now, .
(SubTask)10-August-202013-August-2020Implement Click Event for User Profile
(SubTask)14-August-202016-August-2020Write Unit Tests for this Feature
Week 1217-August-202023-August-2020Add an option for users to change Avatar, Store user's Avatar in the cache for a month.
(SubTask)17-August-202019-August-2020Add Option to change Avatar
(SubTask)20-August-202023-August-2020Write Unit Tests for this Feature
Week 13- Final24-August-202031-August-2020Over all Evaluation
(SubTask)24-August-202027-August-2020Any Remaining Bug Fixes or Tests and Suggestions
(SubTask)24-August-202031-August-2020Final Evaluation
(SubTask)31-August-202031-August-2020Overall Blog Post

Previous Contributions

So far I have made over 47 Pull Requests to the project out of which 38 are already merged and 2 are open. You can see all my Pull Requests here.

DatePR NumberTitleIssue NumberStatus
20-March-20203556Fixes #3473 Changed Names and Order of Theme Options3473Merged
17-March-20203537Fixes 3536 Use actual value of author name instead of static string3536Merged
16-March-20203521Fixes #3465 Use AndroidX Pref3465Merged
9-Mar-20203475Added AboutActivityTest2889Merged
4-Mar-20203460Added Support for System Wide Dark Theme3377Merged
28-Feb-20203439Moved some Java files to kotlin747Merged
23-Feb-20203427Added progress dialog for setting wallpaper3425Merged
8-Feb-20203393Fixes #3392 Fixed Nearby List Item Icon's Background3392Merged
7-Feb-20203383Fixes #3382 Fixed Notification Message Icon Background3382Merged
7-Feb-20203381Fixes #814 Added App Shortcuts814Merged
6-April-20192866Added Appetize badge2842Merged
5-April-20192862Added Quick Launch Icon to the Home Screen Widget #12961296Merged
4-April-20192856Fixed Width of Navigation Drawer for Tablets2854Merged
4-April-20192851Moved hardcoded URLs to a constant file Fixed #28502850Merged
4-April-20192849Adjusted the gravity of SKIP THIS IMAGE Fixed #28482848Merged
2-April-20192834Fixed #2825 where user was able to add one lang twice2825Merged
30-March-20192826Fixed Night Mode Problem in Spinner #28092809Merged
30-March-20192808Completed TODO init views using bind view #28042804Merged
29-March-20192807Fixed Navigation UI Problem in Split Screen mode # 27882788Merged
28-March-20192799Removed duplicate File: from deletion notification2794Merged
28-March-20192787Fixed App Crash on Tablets2766Merged
28-March-20192780Fixed Padding for FAB in nearby #27792779Merged
28-March-20192775Refactor LoginActivity #26902690Merged
27-March-20192772Fixed Location of Checkbox in Permission Request Dialog2771Merged
27-March-20192768Added Click To View Photo on Home Screen Widget2767Merged
26-March-20192758Added Title to the Pic of the Day App Widget2757Merged
20-March-20192687Added SignUp Button Unit Test2686Merged
20-March-20192683Added information dialog to Statistics #25992599Merged
15-March-20192600Fixed overlapping text bug for tablets #25922592Merged
14-March-20192587Fixed bug #2324 - Number of Contributions not updating unless app is restarted2324Merged
12-March-20192579Moved Images via Nearby Places to top, fixes #25242524Merged
21-Feb-20192499Add Device Support Information to Feedback Intent #24942494Merged
20-Feb-20192491Fix Bug #24892489Merged
19-Feb-20192488Fix Bug #24772477Merged
16-May-20181523Added Basic Pic Of the Day App Widget1296Merged
13-March-20181304Fix Underline Tag Bug in About Page1303Merged
04-March-20181259Revamp the Settings page1039Merged
03-March-20181242Add Forgot Password Option in LoginActivity1063Merged
Open PRs
13-March-20203504Added option to remove a language description2810Open
23-March-20192725Updated Navigation Base Activity Unit Tests2724Open

Issues

So far I have opened 56 issues out of which 43 are solved/closed and 13 are open: Click here to view all issues

DateIssue NumberTitleStatus
17-3-203536Replace static summary in custom author name with actual valueClosed
7-3-203473Change the names and order of Theme optionsClosed
2-3-203444Updating Logos for Github, Facebook and Website in About ActivityClosed
25-2-203437Add an option to clear cacheClosed
22-2-203425"Set as Wallpaper" is not working properlyClosed
8-2-203392White Background for Logo in Night ModeClosed
7-2-203382Notification message icon's background stays white in night modeClosed
5-2-203377Automatic Switching to Night Mode if system wide Dark Theme is enabledClosed
20-12-193301[GCI Ideas] Update the app on Appetize to latest version and update URL on ReadmeClosed
3-12-193266[Code-In Task] Create a video for Commons Android appClosed
17-4-192889Write Instrumentation Tests for AboutActivityClosed
10-4-192875Network Error while Logging InClosed
5-4-192865Fade the background when FAB is openClosed
4-4-192854Navigation Drawer is huge in TabletsClosed
4-4-192850Moving hardcoded URLs from About Activity to a constant fileClosed
4-4-192848Skip this image title should be in center in landscape modeClosed
3-4-192842Hosting app on AppetizeClosed
30-3-192825The user should not be allowed to add the same language twice.Closed
30-3-192809Night Mode: Language selection dialog is not readableClosed
29-3-192804Initialize all views using bind view in NearbyMapFragmentClosed
28-3-192788Navigation UI problem in split screen modeClosed
28-3-192779Upload FAB Missing Padding in NearbyClosed
28-3-192778Moving GPS FAB to bottom right cornerClosed
28-3-192776Replace Search Button with FABClosed
28-3-192771Location Permission Required Dialog's UI FixClosed
27-3-192776Add Click to View Photo to Home Screen WidgetClosed
27-3-192766App Crashing on TabletsClosed
27-3-192764Handle and Fix the Delay in LogoutClosed
27-3-192757Add title of the picture to the App WidgetClosed
26-3-192756Pic of the Day Widget API not working on betaClosed
21-3-192690Refactor LoginActivity code for better readabilityClosed
21-3-192686Write Unit Test for Login ActivityClosed
15-3-192599Adding information dialog to StatisticsClosed
15-3-192592Overlapping text in login screen in landscape modeClosed
23-2-192509Count on Contributions does not update on deletionClosed
21-2-192502Swipe to delete specific recent searchesClosed
20-2-192494Collection of device's essential information when user want to share feedbackClosed
19-2-192489Click event not showing button layout without scrolling for last item in the listClosed
13-3-181305Replace New Image Upload with Floating Action Button (Material Design)Closed
13-3-181303Fix Underline Tag in "About Page"Closed
13-3-181296WidgetClosed
13-3-181295Navigation Drawer too large for landscape modeClosed
5-3-181260Nothing happens on clicking a notificationClosed
Open Issues
19-3-203551[Structured Commons] Remove both captions and description instead of just descriptionsOpen
11-3-203487[Discussion] Replace ProgressDialog with ProgressBarOpen
30-12-193311Update the app on Appetize using the APIOpen
18-4-192891Revamp the About ActivityOpen
5-4-192864Using Outlined Edit Text from Material Design for Login ScreenOpen
4-4-192857Achievements Activity getting recreated on rotationOpen
30-3-192810Option to Remove a new language description while uploadingOpen
27-3-192770Incomplete Nearby List shown in Landscape modeOpen
23-3-192724Complete the NavigationBaseActivityTestOpen
16-3-192616Wrong bookmarked item expanding onResumeOpen
14-3-192590Adding bubble scroll view to the appOpen
23-2-192508Popup to get more user rating on app storeOpen
3-3-181247Add Photo Challenge Activity to appOpen

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2020, 6:48 PM

@Madhurgupta10 Your proposal looks great. Also, your profile is quite impressive. :)

I just have a few comments:

  • You mentioned that you are in your final year of under-graduation. Can you mention when will your college end? Also, if you are joining any company after your bachelors then please mention its joining date.
  • The unit testing task can be split into multiple weeks rather than keeping it for the end.
  • Instrumentation tests are optional. So you could mention it as a stretch goal or remove it completely(and allocate more time to some of the other tasks).

@maskaravivek Thank you for the feedback, I have made the changes. Please let me know if anything else needs to be improved.

@srishakatux @Pavithraes

Update on this task:

1. The Commons Android App Achievement activity is now Profile Activity which now has two sections - Achievements and Leaderboard.
The code is correct in a separate branch - leaderboard

  • Link to branch

https://github.com/commons-app/apps-android-commons/tree/leaderboard

  • Link to Issue

https://github.com/commons-app/apps-android-commons/issues/3789

  • Link to PR

https://github.com/commons-app/apps-android-commons/pull/3794

2. Leaderboard API and Database are created
The code is in a different phabricator repository

  • Link to repo

https://phabricator.wikimedia.org/source/tool-commons-android-app

  • Link to Issue

https://github.com/commons-app/commonsmisc/issues/20

  • Link to Commits

https://phabricator.wikimedia.org/source/tool-commons-android-app

3. API and Database documentation is added
The code is in a different GitHub repository

  • Link to repo

https://github.com/commons-app/commons-app-documentation

  • Link to Issue

https://github.com/commons-app/commons-app-documentation/issues/23

  • Link to PR

https://github.com/commons-app/commons-app-documentation/pull/24

Google-Summer-of-Code (2020) is over! I believe you have already documented your project here https://www.mediawiki.org/wiki/Google_Summer_of_Code/Past_projects#2020. If not, I would encourage you to do so. Also, is there anything else remaining in this task to address? If not, please consider closing this task as resolved.

Madhurgupta10 closed this task as Resolved.Sep 23 2020, 10:13 AM

@srishakatux @Pavithraes Thank you for a wonderful GSoC 2020!