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
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:-
- Topcoder TCO19 India Regionals Finalist.
- First Prize in Smart India Hackathon 2019- World’s largest hackathon with over 40,000 participants.
- Third Prize in Topcoder/IBM Call for Code Global Hackathon
- First Prize in Microsoft MS Hacks 2.0
- First Prize in MMU Hackathon
- First Prize in SAP Cloud Hackathon
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
Timeframe | Start Date | End Date | Task |
Community Bonding Period | 4-May-2020 | 1-June-2020 | Getting Familiarized with app structure, Wikimedia Api, and Community. Familiarize me with JavaRx. Go through Documentation once again. |
Week 1 | 1-June-2020 | 7-June-2020 | Update UI of achievements activity to display level (current activity) in first tab and Leaderboard in the second tab (based on uploads). |
(SubTask) | 1-June-2020 | 3-June-2020 | Complete the Leaderboard Fragment UI |
(SubTask) | 4-June-2020 | 7-June-2020 | Add the Leaderboard to the Achievements Activity. |
Week 2 | 8-June-2020 | 14-June-2020 | Designing 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-2020 | 10-June-2020 | Discuss and Design the API and ER Diagram and make a Swagger File |
(SubTask) | 11-June-2020 | 14-June-2020 | Code the API in Python and Test it using Postman and Ngrok before hosting. |
Week 3 | 15-June-2020 | 21-June-2020 | Display user's Avatar and rank on Leaderboard screen fetched from API. |
(SubTask) | 15-June-2020 | 18-June-2020 | Fetch the results from the API using Retrofit |
(SubTask) | 19-June-2020 | 21-June-2020 | Adjust the UI to display the results gracefully |
Week 4 | 22-June-2020 | 28-June-2020 | Designing 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-2020 | 24-June-2020 | Discuss and Design the API and ER Diagram and make a Swagger File |
(SubTask) | 25-June-2020 | 28-June-2020 | Code the API in Python and Test it using Postman and Ngrok before hosting. |
Week 5 | 29-June-2020 | 5-July-2020 | Use 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-2020 | 3-July-2020 | First Evaluation |
(SubTask) | 29-June-2020 | 30-June-2020 | Fetch the results from the API using Retrofit |
(SubTask) | 1-July-2020 | 4-July-2020 | Adjust the UI to display the results gracefully |
(SubTask) | 5-July-2020 | 5-July-2020 | Blog Post |
Week 6 | 6-July-2020 | 12-July-2020 | Complete Unit Tests for APIs fetch |
(SubTask) | 6-July-2020 | 9-July-2020 | Complete Unit Tests for APIs for calculating and displaying ranks of the User |
(SubTask) | 10-July-2020 | 12-June-2020 | Complete Unit Tests for APIs for displaying leaderboard based on that 2 parameters |
Week 7 | 13-July-2020 | 19-July-2020 | Add pagination in the leaderboard screen to load more users on scrolling down. |
(SubTask) | 13-July-2020 | 16-July-2020 | Implement Pagination and AutoScroll to user’s rank |
(SubTask) | 17-July-2020 | 19-July-2020 | Add Loaders and Improve UX |
Week 8 | 20-July-2020 | 26-July-2020 | Complete Tests for Pagination and Auto-Scroll |
(SubTask) | 20-July-2020 | 23-July-2020 | Write Tests for Pagination |
(SubTask) | 24-July-2020 | 26-July-2020 | Write Tests for Auto-Scroll Feature |
Week 9 | 27-July-2020 | 2-August-2020 | Add 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-2020 | 31-July-2020 | Second Evaluation |
(SubTask) | 27-July-2020 | 29-July-2020 | Implement Filter Classes |
(SubTask) | 30-July-2020 | 1-August-2020 | Update the UI to use filters and improve UX |
(SubTask) | 2-August-2020 | 2-August-2020 | Blog Post |
Week 10 | 3-August-2020 | 9-August-2020 | Change the UI to show 3 different results (based on uploads, nearby, used). - add 2 more tabs |
(SubTask) | 3-August-2020 | 5-August-2020 | Update the UI to enclose three different kinds of leaderboards |
(SubTask) | 6-August-2020 | 7-August-2020 | Improve the UX |
(SubTask) | 8-August-2020 | 9-August-2020 | Write Unit Tests for duration filters and this Feature |
Week 11 | 10-August-2020 | 16-August-2020 | 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, . |
(SubTask) | 10-August-2020 | 13-August-2020 | Implement Click Event for User Profile |
(SubTask) | 14-August-2020 | 16-August-2020 | Write Unit Tests for this Feature |
Week 12 | 17-August-2020 | 23-August-2020 | Add an option for users to change Avatar, Store user's Avatar in the cache for a month. |
(SubTask) | 17-August-2020 | 19-August-2020 | Add Option to change Avatar |
(SubTask) | 20-August-2020 | 23-August-2020 | Write Unit Tests for this Feature |
Week 13- Final | 24-August-2020 | 31-August-2020 | Over all Evaluation |
(SubTask) | 24-August-2020 | 27-August-2020 | Any Remaining Bug Fixes or Tests and Suggestions |
(SubTask) | 24-August-2020 | 31-August-2020 | Final Evaluation |
(SubTask) | 31-August-2020 | 31-August-2020 | Overall 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.
Date | PR Number | Title | Issue Number | Status |
20-March-2020 | 3556 | Fixes #3473 Changed Names and Order of Theme Options | 3473 | Merged |
17-March-2020 | 3537 | Fixes 3536 Use actual value of author name instead of static string | 3536 | Merged |
16-March-2020 | 3521 | Fixes #3465 Use AndroidX Pref | 3465 | Merged |
9-Mar-2020 | 3475 | Added AboutActivityTest | 2889 | Merged |
4-Mar-2020 | 3460 | Added Support for System Wide Dark Theme | 3377 | Merged |
28-Feb-2020 | 3439 | Moved some Java files to kotlin | 747 | Merged |
23-Feb-2020 | 3427 | Added progress dialog for setting wallpaper | 3425 | Merged |
8-Feb-2020 | 3393 | Fixes #3392 Fixed Nearby List Item Icon's Background | 3392 | Merged |
7-Feb-2020 | 3383 | Fixes #3382 Fixed Notification Message Icon Background | 3382 | Merged |
7-Feb-2020 | 3381 | Fixes #814 Added App Shortcuts | 814 | Merged |
6-April-2019 | 2866 | Added Appetize badge | 2842 | Merged |
5-April-2019 | 2862 | Added Quick Launch Icon to the Home Screen Widget #1296 | 1296 | Merged |
4-April-2019 | 2856 | Fixed Width of Navigation Drawer for Tablets | 2854 | Merged |
4-April-2019 | 2851 | Moved hardcoded URLs to a constant file Fixed #2850 | 2850 | Merged |
4-April-2019 | 2849 | Adjusted the gravity of SKIP THIS IMAGE Fixed #2848 | 2848 | Merged |
2-April-2019 | 2834 | Fixed #2825 where user was able to add one lang twice | 2825 | Merged |
30-March-2019 | 2826 | Fixed Night Mode Problem in Spinner #2809 | 2809 | Merged |
30-March-2019 | 2808 | Completed TODO init views using bind view #2804 | 2804 | Merged |
29-March-2019 | 2807 | Fixed Navigation UI Problem in Split Screen mode # 2788 | 2788 | Merged |
28-March-2019 | 2799 | Removed duplicate File: from deletion notification | 2794 | Merged |
28-March-2019 | 2787 | Fixed App Crash on Tablets | 2766 | Merged |
28-March-2019 | 2780 | Fixed Padding for FAB in nearby #2779 | 2779 | Merged |
28-March-2019 | 2775 | Refactor LoginActivity #2690 | 2690 | Merged |
27-March-2019 | 2772 | Fixed Location of Checkbox in Permission Request Dialog | 2771 | Merged |
27-March-2019 | 2768 | Added Click To View Photo on Home Screen Widget | 2767 | Merged |
26-March-2019 | 2758 | Added Title to the Pic of the Day App Widget | 2757 | Merged |
20-March-2019 | 2687 | Added SignUp Button Unit Test | 2686 | Merged |
20-March-2019 | 2683 | Added information dialog to Statistics #2599 | 2599 | Merged |
15-March-2019 | 2600 | Fixed overlapping text bug for tablets #2592 | 2592 | Merged |
14-March-2019 | 2587 | Fixed bug #2324 - Number of Contributions not updating unless app is restarted | 2324 | Merged |
12-March-2019 | 2579 | Moved Images via Nearby Places to top, fixes #2524 | 2524 | Merged |
21-Feb-2019 | 2499 | Add Device Support Information to Feedback Intent #2494 | 2494 | Merged |
20-Feb-2019 | 2491 | Fix Bug #2489 | 2489 | Merged |
19-Feb-2019 | 2488 | Fix Bug #2477 | 2477 | Merged |
16-May-2018 | 1523 | Added Basic Pic Of the Day App Widget | 1296 | Merged |
13-March-2018 | 1304 | Fix Underline Tag Bug in About Page | 1303 | Merged |
04-March-2018 | 1259 | Revamp the Settings page | 1039 | Merged |
03-March-2018 | 1242 | Add Forgot Password Option in LoginActivity | 1063 | Merged |
Open PRs | ||||
13-March-2020 | 3504 | Added option to remove a language description | 2810 | Open |
23-March-2019 | 2725 | Updated Navigation Base Activity Unit Tests | 2724 | Open |
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
Date | Issue Number | Title | Status |
17-3-20 | 3536 | Replace static summary in custom author name with actual value | Closed |
7-3-20 | 3473 | Change the names and order of Theme options | Closed |
2-3-20 | 3444 | Updating Logos for Github, Facebook and Website in About Activity | Closed |
25-2-20 | 3437 | Add an option to clear cache | Closed |
22-2-20 | 3425 | "Set as Wallpaper" is not working properly | Closed |
8-2-20 | 3392 | White Background for Logo in Night Mode | Closed |
7-2-20 | 3382 | Notification message icon's background stays white in night mode | Closed |
5-2-20 | 3377 | Automatic Switching to Night Mode if system wide Dark Theme is enabled | Closed |
20-12-19 | 3301 | [GCI Ideas] Update the app on Appetize to latest version and update URL on Readme | Closed |
3-12-19 | 3266 | [Code-In Task] Create a video for Commons Android app | Closed |
17-4-19 | 2889 | Write Instrumentation Tests for AboutActivity | Closed |
10-4-19 | 2875 | Network Error while Logging In | Closed |
5-4-19 | 2865 | Fade the background when FAB is open | Closed |
4-4-19 | 2854 | Navigation Drawer is huge in Tablets | Closed |
4-4-19 | 2850 | Moving hardcoded URLs from About Activity to a constant file | Closed |
4-4-19 | 2848 | Skip this image title should be in center in landscape mode | Closed |
3-4-19 | 2842 | Hosting app on Appetize | Closed |
30-3-19 | 2825 | The user should not be allowed to add the same language twice. | Closed |
30-3-19 | 2809 | Night Mode: Language selection dialog is not readable | Closed |
29-3-19 | 2804 | Initialize all views using bind view in NearbyMapFragment | Closed |
28-3-19 | 2788 | Navigation UI problem in split screen mode | Closed |
28-3-19 | 2779 | Upload FAB Missing Padding in Nearby | Closed |
28-3-19 | 2778 | Moving GPS FAB to bottom right corner | Closed |
28-3-19 | 2776 | Replace Search Button with FAB | Closed |
28-3-19 | 2771 | Location Permission Required Dialog's UI Fix | Closed |
27-3-19 | 2776 | Add Click to View Photo to Home Screen Widget | Closed |
27-3-19 | 2766 | App Crashing on Tablets | Closed |
27-3-19 | 2764 | Handle and Fix the Delay in Logout | Closed |
27-3-19 | 2757 | Add title of the picture to the App Widget | Closed |
26-3-19 | 2756 | Pic of the Day Widget API not working on beta | Closed |
21-3-19 | 2690 | Refactor LoginActivity code for better readability | Closed |
21-3-19 | 2686 | Write Unit Test for Login Activity | Closed |
15-3-19 | 2599 | Adding information dialog to Statistics | Closed |
15-3-19 | 2592 | Overlapping text in login screen in landscape mode | Closed |
23-2-19 | 2509 | Count on Contributions does not update on deletion | Closed |
21-2-19 | 2502 | Swipe to delete specific recent searches | Closed |
20-2-19 | 2494 | Collection of device's essential information when user want to share feedback | Closed |
19-2-19 | 2489 | Click event not showing button layout without scrolling for last item in the list | Closed |
13-3-18 | 1305 | Replace New Image Upload with Floating Action Button (Material Design) | Closed |
13-3-18 | 1303 | Fix Underline Tag in "About Page" | Closed |
13-3-18 | 1296 | Widget | Closed |
13-3-18 | 1295 | Navigation Drawer too large for landscape mode | Closed |
5-3-18 | 1260 | Nothing happens on clicking a notification | Closed |
Open Issues | |||
19-3-20 | 3551 | [Structured Commons] Remove both captions and description instead of just descriptions | Open |
11-3-20 | 3487 | [Discussion] Replace ProgressDialog with ProgressBar | Open |
30-12-19 | 3311 | Update the app on Appetize using the API | Open |
18-4-19 | 2891 | Revamp the About Activity | Open |
5-4-19 | 2864 | Using Outlined Edit Text from Material Design for Login Screen | Open |
4-4-19 | 2857 | Achievements Activity getting recreated on rotation | Open |
30-3-19 | 2810 | Option to Remove a new language description while uploading | Open |
27-3-19 | 2770 | Incomplete Nearby List shown in Landscape mode | Open |
23-3-19 | 2724 | Complete the NavigationBaseActivityTest | Open |
16-3-19 | 2616 | Wrong bookmarked item expanding onResume | Open |
14-3-19 | 2590 | Adding bubble scroll view to the app | Open |
23-2-19 | 2508 | Popup to get more user rating on app store | Open |
3-3-18 | 1247 | Add Photo Challenge Activity to app | Open |