Proposal for T215682
=Profile Information
Name: Jerop Brenda
IRC nickname on Freenode: brendajerop
Web Profile: https://brendajerop.github.io
Blog: https://medium.com/@brendajerop2
Resume: https://www.resume.com/share/brendajerop
Location: Kenya
Typical working hours: 8:00 AM to 7:00 PM EAT (UTC+3)
---
=Synopsis
==1. Summary of the project
The MediaWiki Action API is a REST API that provides access to wiki features like creating an account, logging in, creating and editing a page, searching for a title and many more. A complete description is available [[ https://www.mediawiki.org/wiki/API:Tutorial | here ]].
This project aims to improve the documentation of the API by re-writing it to follow [[ https://www.mediawiki.org/wiki/API:Documentation_template | this template]] and adding code samples to demonstrate the use of the API modules. A demo app based on some of the modules will also be created and a tutorial to explain its implementation will be written. The complete description of this project is available at T215682
=== Demo app
My idea for the demo app is an app that fetches the day’s holidays and observances from Wikipedia as shown [[https://en.wikipedia.org/wiki/October_31#Holidays_and_observances | here ]]. This idea and its implementation will be subject to change as seen fit by the project mentors.
====Features
- Fetch the day’s holidays and observances using `API:Parse` and list them.
- Allow searching for holidays by date.
- Users can log in to add a new holiday. This will make use of `API:Assert` to check whether the user is logged in. If not, use `API:Login` to log the user in then use `API:Edit` to add a new holiday.
====Implementation
- I will use Python, Flask, HTML, CSS and Jinja templating.
- The app will follow Wikimedia’s design principles and will assume a mobile layout. This is because the app's screens will not have a lot of content hence it will be a better use of space to have the app occupy a smaller area of the screen.
Following a Mobile-First design will also ensure that the app looks and functions well on all platforms with the least amount of code. Having less code will ensure that the tutorial stays simple since it's mostly targeted at beginners.
====Prototypes
- An interactive mock-up of the app is available [[ https://marvelapp.com/5ci723b | here ]]
- I also created a similar but basic app for proof of concept at [[ https://holidaystoday.herokuapp.com| holidaystoday.herokuapp.com ]].
|{F28464355} | {F28464356} | {F28464357} | {F28464358} |
==2. Benefits of the project
By following a template, consistency will be achieved in the documentation. This provides a uniform way to give information hence making the use of the API more intuitive to new users. It also makes it easier for new contributors to understand how to edit and add new information.
Adding code samples and creating a demo app based on the modules will provide a practical means of understanding the API. This is especially important to new users and to users whom the documentation has not been translated into their language.
---
= Possible Mentors
Srishti Sethi @srishakatux, Sarah R. Rodlund @srodlund.
---
=Deliverables
==1. Timeline
!!**Before interns are announced: Today to May 6**!!
- Complete the tasks which are a work in progress and work on new tasks as I go through the tutorials at [[ https://www.mediawiki.org/wiki/API:Main_page | API:Main_page ]] in order to improve my Python, Flask, HTML and CSS skills.
!!**Before the internship starts: May 6 to May 20**!!
- Create a spreadsheet to analyse and document the state of the 50th to the 77th most-viewed pages as shown in [[ https://tools.wmflabs.org/massviews/?platform=all-access&agent=user&source=category&target=https%3A%2F%2Fmediawiki.org%2Fwiki%2FCategory%3AMediaWiki_action_API&range=latest-20&subjectpage=0&subcategories=1&sort=views&direction=1&view=list | Massviews Analysis ]] in order to determine the amount of work needed in each page and the order of the pages to be edited.
- Refine my ideas for the demo app and document my progress [[ https://www.mediawiki.org/wiki/User:Jeropbrenda/Apps | here ]].
!!**May 20 to July 22 (9 weeks)**!!
- Improve the documentation of three API modules per week for a total of at least 27 modules at the end of the 9 weeks . The process followed each week will be similar for each module, i.e:
- Create a separate git branch for the module, write sample code, commit it and open a pull request on GitHub for review.
- Implement the requested changes if any as I work on the respective documentation of the module in my wiki sandbox.
- Once the pull request is merged, I will integrate the sample code into the documentation.
- Once the documentation is ready, I will send it to the mentor for review and implement any feedback received.
- After the documentation has been approved by the project mentor, I will integrate it into the main-space and mark it as modified on T198916.
- Finalize on demo app idea and mock-ups.
!!**July 22 to July 30 (Week 10)**!!
- Start working on the demo app.
- Write the base classes which will be extended by the specific feature classes. This is because some of the app's features will have a slightly similar layout and functionality.
- Implement "List Holidays" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app to the project mentor for review and implement any feedback received.
At the end of week 10, the most basic and working version of the app will be complete.
!! **July 30 to August 6 (Week 11)**!!
- Implement "Search Holidays by Date" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Implement "Logging in" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app for review and implement any feedback received.
!!**August 6 to August 13 (Week 12)**!!
- Implement "Add New Holiday" feature, test it and include instructions for its implementation in a draft of the app's tutorial in my sandbox.
- Submit the app for review and implement any feedback received.
- Make any required improvements and fix any bugs that may have arised.
At the end of week 12, the app will be complete with all the intended features.
!!**August 13 to August 20 (Week 13)**!!
- Refine the app's tutorial and send the final draft to the mentor for review.
- Once the draft has been approved, I will include it in the tutorials section of [[ https://www.mediawiki.org/wiki/API:Main_page | API:Main_page ]] and prepare it for translation.
!!**August 20 onwards**!!
- Keep contributing to Wikimedia and volunteer as a mentor for Google Code-in.
---
=Participation
- I will communicate my progress to my mentor and ask for help on project-related issues through Zulip on the [[ https://wikimedia.zulipchat.com/#narrow/stream/mediawiki-api-documentation-project | mediawiki-api-documentation-project ]] stream.
- I will ask for help on API-related issues on the [[ https://discourse-mediawiki.wmflabs.org/ | Wikimedia Developer Support ]] channel.
- Throughout the internship period, I will document detailed progress through weekly blog posts on [[ https://medium.com/@brendajerop2 | my blog ]].
---
=About Me
- I joined the University of Nairobi, Kenya, in 2015 to pursue Electrical and Electronic Engineering but took a year off in September 2018. On my first holiday from college, I attended a boot camp where I learnt Java and got introduced to Android Programming. On completion, I became a part of NaiCode, a community that teaches programming to high school students in Kenya.
I later got selected for the Google Africa Scholarship Program to learn Intermediate Android Development. During that period, I also served as a community mentor to guide the beginner students through their Android Development course. My certificates for participation as a student and as a mentor are available [[ https://www.dropbox.com/s/w5yh1d7to5oowgz/androidintermediate.pdf?dl=0 | here ]] and [[ https://www.dropbox.com/s/igs3u0m8j2r86so/alcMentorCert.pdf?dl=0 | here ]] respectively.
In August 2018, I applied to Y Combinator’s Startup School and luckily, all the companies that applied were accepted for that cohort. My Startup School profile is available [[ https://www.startupschool.org/companies/hidecontacts | here ]].
- **How did you hear about this program?** I learnt about this program through Twitter, on a previous participant’s timeline.
- **Will you have any other time commitments, such as school work, another job, planned vacation, etc, during the duration of the program?** No, I will not have any other time commitments during the duration of the program.
- **We advise all candidates eligible for Google Summer of Code and Outreachy to apply for both programs. Are you planning to apply to both programs and, if so, with what organization(s)?** I took a year off from school so I will not be able to apply for Gsoc this round.
- **What does making this project happen mean to you?** As an avid user of FOSS(I use Linux, Firefox, LibreOffice and VLC), this project provides a platform through which I can give back to FOSS because most open-source organisations use MediaWiki-powered wikis. It will also grant me a good entry point into open-source contribution.
This project will also boost my skills, improve my confidence and shape me as a programmer. This is because I will be working in a mentored environment with a structured workflow where proper code documentation, organization, testing and coding styles need to be followed. Also, I love both writing and programming, and this project is a bridge between the two.
---
=Past Experience
==1. Contributions to Wikimedia
===!!Microtasks!!
- **API:Querypage**: Improved the documentation and wrote sample code to demostrate its use in querying uncategorized pages.
- [[ https://www.mediawiki.org/wiki/API:Querypage | Documentation ]]: `Approved`
- [[ https://github.com/wikimedia/MediaWiki-Action-API-Code-Samples/pull/61 | Sample code ]]: `Merged`
- **API:RecentChanges**: Improved the documentation and wrote sample code to demostrate its use in fetching the three most recent changes with their sizes and flags.
- [[ https://www.mediawiki.org/wiki/API:RecentChanges | Documentation ]]: `Approved`
- [[ https://github.com/wikimedia/MediaWiki-Action-API-Code-Samples/pull/60 | Sample code ]]: `Merged`
- **API:Links**: Wrote sample code to demonstrate its use in fetching missing links from a page. I also added this example to the documentation.
- [[ https://www.mediawiki.org/wiki/API:Links#Example_2:_Fetch_missing_links | Documentation ]]: `Approved`
- [[ https://github.com/wikimedia/MediaWiki-Action-API-Code-Samples/pull/52 | Sample code ]]: `Merged`
===!!Documentation and API-related!!
- [[https://github.com/addwiki/mediawiki-api/pull/51|I added a new feature to Addwiki's mediawiki-api library to get all the pages that are linked to from a given page]]: T186581 `Merged`. I used `API:Info` as a property and `API:Links` as a generator in order to complete the task. While working on this task,I learnt how to use both `prop` and `generator` in one request in order to get the desired result, and that module parameters should be prefixed with a `g` if the module is being used as a generator. The library is coded in PHP and I had never used PHP before so I also got to learn PHP as a bonus:)
- I documented the undocumented classes in Addwiki's mediawiki-api library, a PHP library for interacting with the MediaWiki Action API. The different classes use different API modules hence I interacted with their corresponding MediaWiki API modules in order to have a better understanding of how the classes work. As a result, I got to understand how to use these API modules. The classes which I documented are:
- [[ https://github.com/addwiki/mediawiki-api/pull/53 | LogListGetter ]]: `Merged`. LogListGetter gets all logged events in a wiki by using `API:Logevents`.
- [[ https://github.com/addwiki/mediawiki-api/pull/52 | UserGetter ]]: `Merged`. UserGetter gets information about a user in a wiki by using `API:User` .
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/14c3acdb4f661ff98c2e9b031cb323cc2e21f87b | RevisionUndoer ]]: `Awaiting Review`. RevisionUndoer undoes a certain revision in a wiki by using the "undo" parameter of API:Edit.
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/e86274f5077a75991e1ca82e4bd0326d35f131f0 | RevisionRollbacker ]]: `Awaiting Review`. RevisionRollbacker reverts the last series of edits made to a wiki page by using `API:Rollback`.
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/358fd8274e990ad624adb20606e0920881c859af | RevisionDeleter ]]: `Awaiting Review`. RevisionDeleter deletes the content of a revision by using the `hide` parameter of `API:Revisiondelete`.
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/956721199821a49c3f713fe478b62987b68bf19a | RevisionRestorer ]]: `Awaiting Review`. RevisionRestorer restores content that has been revision-deleted by using the `show` parameter of `API:RevisionDelete`.
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/74bae0deda5a1cae2a84a0e571822653b3284608 | RevisionPatroller ]]: `Awaiting Review`. RevisionPatroller patrols a revision by using `API:Patrol`.
- [[ https://github.com/addwiki/mediawiki-api/pull/54/commits/e47d8058c2572f88dd1de7ffb395ccbb4e2c502b | RevisionSaver ]]: `Awaiting Review`. RevisionSaver saves edits to a revision by using `API:Edit`.
- [[ https://www.mediawiki.org/wiki/Help:VisualEditor/User_guide/Citations-Full | I documented how to add citations to a page if the Citoid service has been configured on a wiki ]]: T108980 `Merged`. While working on this page, I learnt about [[ https://www.mediawiki.org/wiki/Documentation/Style_guide | Wikimedia’s guide ]] to technical documentation, which I followed in order to give structure, clarity and consistency to the guide. I also got to learn how to work with translatable pages and learnt about concepts like qqx. Working on the guide also improved my wiki markup skills.
- [[ https://gerrit.wikimedia.org/r/496115 | I corrected the auto-generated documentation for parameter `headhtml` in module `parse` ]]: T139567 `Merged`. When starting to work on this task, I wasn't sure if I was editing the correct file so I set up a local MediaWiki instance in order to confirm if the changes to the code were reflected on the wiki. Having a local MediaWiki instance later came in handy while working on tasks which required a wiki user to have admin or bureaucrat permissions. For instance when trying to create a test account on Wikipedia via the API, the limit per IP address is 6 trials in 24 hrs but with a local MediaWiki instance, I could raise the limit.
In some cases, the documentation includes examples which have API parameters that are introduced by extensions(e.g OpenID). In this case having a local MediaWiki instance where I could install the extensions was helpful.
- [[ https://gerrit.wikimedia.org/r/#/c/497132/ | I included links of the corresponding API modules in Pywikibot methods. ]]: T100521 `Merged`. I modified the docstrings of all APISite methods in site.py which are thin wrappers around a MediaWiki API module to include a link to the corresponding API documentation. Working on this task helped me discover more MediaWiki API modules and what they do. I also learnt how to write docstrings in Epytext format.
- [[https://www.mediawiki.org/wiki/Help:Merge_history | I documented Special:MergeHistory ]]: T195271 `Merged`. While working on this page, I got to improve my documentation and wiki markup skills. I also got a better experience in working with translatable pages.
- I added unit tests to the Africa Wikimedia Stats Tool: T205450. I added unit tests for two methods which had not been covered by tests. I had never written unit tests before and working on this task introduced me to and helped me learn how to write unit tests. I chose this task in order to learn how to write unit tests in case it will be a requirement when developing the demo app. The links to my patches are:
- https://gerrit.wikimedia.org/r/497311 `Merged`
- https://gerrit.wikimedia.org/r/500546 `Merged`
- [[https://github.com/wikimedia/MediaWiki-Action-API-Code-Samples/pull/115 | Refactored sample code for account creation]]: `Awaiting Review` I refactored code for account creation via the MediaWiki API if captcha is enabled in a wiki.
- [[ https://github.com/commons-app/apps-android-commons/pull/2551 | I added a feature to Wikimedia Commons Android app to include tabs that display featured images from Wikimedia Commons and images uploaded via the Android app.]]: `Merged`. The images were fetched using the Commons API hence I got to learn about other Wikimedia APIs and what they do.
- [[ https://gerrit.wikimedia.org/r/496792 | Modified the auto-generated documentation to include information about hidden parameters which have been revision-deleted ]]: T186573 `Awaiting review`. While working on this task, I got a deeper understanding of the MediaWiki Action API because I had to do revision-deletion on a wiki and then query these modules to in order to check their responses after revision-deletion. As a result, I got to understand how to use these modules. The modules are:
- API:Revisions
- API:AllRevisions
- API:RecentChanges
- API:UserContribs
- API:Watchlist
- API:Compare
- API:Imageinfo
- [[https://www.mediawiki.org/wiki/User:Jeropbrenda/Sandbox/Batchcomplete|I documented the `batchcomplete` element of the MediaWiki Action API]]: T84977 `Awaiting review`. Working on this task helped me get a deeper understanding of the API and also improved my technical documentation and wiki markup skills. I queried several modules in several ways, e.g using them as a generator or as a property submodule in order to find cases where the batchcomplete element was not returned. As a result, I learnt a lot about generators, property submodules and how to use `continue` until the batchcomplete element is returned. I also learnt that batchcomplete is meant for modules which are submodules of the query module.
- [[ https://commons.wikimedia.org/w/index.php?title=User:Jeropbrenda/Sandox/Template:IsNum|Wrote and modified documentation for Commons Template:IsNum]]: T120366 `Awaiting review`. Working on this task gave me a deeper understanding of templates, how they work and how to use them. It also improved my wiki markup skills.
===!!Other!!
- [[ https://github.com/commons-app/apps-android-commons/pull/2556 | Added code to automatically close the Floating Action Button. ]]: `Merged`. I added an enhancement to automatically close the Floating Action Button in the upload activity after a user has uploaded an image.
- I added a LICENSE file and added the license code to extension.json in extensions which did not have license information: T123943 `Awaiting review`. The extensions are:
- [[ https://gerrit.wikimedia.org/r/498061 | ArticleRatings ]]
- [[ https://gerrit.wikimedia.org/r/498026 | Contributors ]]
- [[ https://gerrit.wikimedia.org/r/498076 | Athena ]]
- [[ https://gerrit.wikimedia.org/r/498068 | DiscussionThreading ]]
- [[ https://gerrit.wikimedia.org/r/498070 | GoogleDocTag ]]
- [[ https://gerrit.wikimedia.org/r/498071 | GoogleGeoCode ]]
- [[ https://gerrit.wikimedia.org/r/498072 | GooglePlaces ]]
- [[ https://gerrit.wikimedia.org/r/498074 | MintyDocs ]]
- [[ https://gerrit.wikimedia.org/r/498081 | Tabber ]]
- [[ https://gerrit.wikimedia.org/r/498075 | SecureSessions ]]
==2. Contribution to open source
===!!The Mifos Initiative!!
- [[ https://github.com/openMF/android-client/pull/1032 | Added support for Swahili to Mifos Android Client ]]: `Merged`. Working on this task helped me learn how to use git for collaboration. I learnt how to rebase, squash commits and resolve merge conflicts.
- [[ https://github.com/openMF/android-client/pull/1028 | Added code to Mifos Android Client to remove irrelevant space in an accordion ]]: `Under Review`
==3. Other projects
===!!Python!!
- [[ https://github.com/brendajerop/Holidays-Viewer | Holidays Viewer ]]- A web-app that fetches the current day’s holidays and observances from Wikipedia using API:Parse and lists them. I created this app in order to practise building the demo app and to refresh my Python, Flask, HTML and CSS skills. While working on the app, I learnt about and followed Wikimedia’s design principles in regards to colours, typography and visual style.
- [[ https://github.com/brendajerop/hogwarts | A simple school system app ]]- A Flask CRUD web app that allows creation, editing and deletion of student data. This app was created as part of a group assignment at school. While working on this app, I got introduced to Python, Flask, HTML, CSS and SQL.
- [[ https://github.com/brendajerop/django-intro | Simple blog ]]-I created a simple blog while learning how to use Django at a Django Girls event.
===!!Android!!
- [[ https://github.com/brendajerop/github-repos | Github-Repos ]]- An app that fetches a users repositories using the GitHub API. Working on this app helped me understand how APIs work, specifically REST APIs.
- [[ https://play.google.com/store/apps/details?id=nothingapps.com.secondarycontacts | HideContacts ]]-A contacts app that can’t be read by other apps. It doesn’t save contacts in vcf format so other apps like Whatsapp and Facebook don’t recognize it as a contacts app and hence they can’t read contacts from it. This improves privacy. I created this app after completing YC’s Startup School program where I learnt about concepts like Key Performance Indicators and Lean Software Development. The app currently has 1000+ users.
- [[https://play.google.com/store/apps/details?id=com.kaizen.orodha | Orodha ]]- An app that simplifies the process of creating an exam merit list for Kenyan teachers who don’t have access to computers.
- [[ https://github.com/brendajerop/tic-tac-toe| TicTacToe ]]- An Android version of Tic Tac Toe. I created this as a capstone project for an Android development course.
- [[ https://github.com/brendajerop/goodnight| Goodnight ]]- An android app to auto-send a goodnight message to specific people at a specific time
===!!Java!!
I created these apps during a hackathon to demonstrate the usage of the Java GUI.
- [[ https://github.com/brendajerop/screensaver | Screensaver ]]- An app that creates wallpapers and screensavers by drawing spirographs on the screen.
- [[ https://github.com/brendajerop/paint-app | Paint app ]]- A painting app that allows you to paint on a screen by dragging the mouse. You can also change the colour of the pen, the background colour and the thickness of the pen.
- [[ https://github.com/brendajerop/touch-type-practice | Touch-type Practice ]]- An app that allows you to practise touch-typing by giving you a word to type against a set time limit. It has a virtual keyboard on the screen that highlights any key pressed.
- [[ https://github.com/brendajerop/animated-card | Animated-card ]]- An animated get-well-soon card with background music.
===!!Matlab!!
- [[https://github.com/brendajerop/medical-diagnosis | Medical-Diagnosis ]]- An app to diagnose lifestyle diseases using Matlab’s Neural Network Toolbox. I created this app as a requirement of a class assignment.