TapGives – Clean Water Subscription Service

Project phases

Published: May 27, 2022

Last Updated: 2 years ago.

View All Projects

We Make Impact is an organization that creates and manages potable water sites in rural Kenya and Uganda, in regions where drinking water is scarce or unsafe. To manage water distribution to communities in need, We Make Impact, in collaboration with the UBC Cloud Innovation Centre (CIC), has developed a solution, TapGives, to easily connect villagers to a nearby water site for a nominal monthly fee, using only a cellular device and USSD technology.

Approach

The solution empowers three users involved in the potable water distribution cycle in Kenya: (i) Villagers: any individual from a village who subscribes to obtain water from a specific water filtration site, (ii) Site Managers: individuals who work at, and manage, the water filtration site and, (iii) TapGives Administrators (admins): individuals responsible for administering the TapGives subscription service, granting permission to users, creating the filtration sites/stations in the system, and managing the financials. 

To develop the TapGives system for villagers in rural Kenya, several factors required consideration, such as accessibility to Wi-Fi in remote regions of Africa, subscription validation, limited smartphone accessibility and language needs. With this in mind, UBC CIC developed a USSD solution utilizing the USSD gateway aggregation service, Africa’s Talking. The TapGives solution enables villagers to purchase a subscription to a water filtration site, allowing them to collect jerry cans of filtered water from the water site nearest to them.  

For TapGives admins, UBC CIC developed a web interface to provide admins with the infrastructure to manage and operate rural water sites. The web interface enables admins to assign site managers to specific water sites and the ability to authorize villager collections. Admins can also edit filtration site details such as the estimated number of jerrycans available/remaining on a subscription and communicate site information to all, or specific, site villagers and site managers with a broadcast messaging feature. 

The web interface and USSD application have been developed in two languages, English and Kiswahili, with the ability to add more languages to increase user accessibility.

Supporting Artifacts

Architecture Diagram

Architecture diagram that the technical resources used and the processes for the administrator and site manager website, and the customer and site manager USSD interaction, through icons representing individual AWS services and arrows that connect them.

User Interface

Web Admin Application Dashboard

Picture of the web admin application dashboard includes a list of Sites on the left, then a panel in the middle of Site information, then a map on the right to show the Site's location.

Web dashboard showing Filtration Sites

A screenshot of the Site Manager's view for changing site ownership. On the left is a table showing the Site Manager's profile. On the right is a list of sites for the Manager to select from.

Site manager designation function

Screenshot of page to search for site customers shows a list of sites on the left and the customer's details in the website's body component.

Search for Site Customers

Technical Details

The solution is divided into two major sections: i) web admin application and ii) the villager and site manager USSD interaction. Both interfaces are built to work together to deliver the developed solution to each of the three users identified above.

i) Web Admin Application Details

Both TapGives admins and Site Managers can connect to the webpage using any device capable of displaying a modern browser. It enables TapGives admins to create and update water filtration sites and grant permissions to site managers for sites they can view and manage. They can also modify the language preferences for mobile and website interfaces and provides data on customer activity and habits to inform admins of peak times in site visits.

An infographic for the interaction process of a Web Admin. The first of five steps is web login, then Site Manager assignment, set Site Manager permissions, access, review, and edit site details, and send message broadcasts.

Once connected to the browser, users are authenticated by AWS Cognito and requests are routed through AWS AppSync. The user’s selected language is loaded from a S3 bucket. 


Through AppSync and Cognito, the solution retrieves data on filtration sites using DynamoDB and Amazon Locations. Site information such as name, shortcode, and physical coordinates is pulled from DynamoDB as Amazon Locations converts these geographical coordinates into a corresponding map.

When a villager’s transaction is made, it is passed to the DynamoDB streams followed by a Lambda function which invokes Kinesis Data Firehose, which aggregates, converts and stores the data in a correct format in S3.


The web portal analytics capabilities such as the number of site visits by the hour per month, is processed through AppSync, which calls a lambda function that converts the request to an SQL query for Athena.

AppSync allows TapGives admin to broadcast messages to villagers by calling a Lambda function to retrieve relevant phone numbers. From there, it uses Amazon Pinpoint to message selected villagers and site managers.

ii) USSD Interaction

The solution uses USSD technology for the villager and site manager’s interaction, making the solution compatible with any cellular device. As a result, villagers can conveniently register with the TapGives project, purchase a subscription with access to a water site and view personal account information. In addition, the USSD interaction allows site managers to verify a villager’s subscription and process their water collections.

The villager dials the TapGives USSD shortcode for the solution, requesting communication with the system. The Mobile Network Operator forwards the request to the USSD aggregation service, Africa’s Talking, which then forwards it to the Amazon API Gateway endpoint listed for the TapGives USSD shortcode.

This connection opens the bridge of communication that will last until the session is terminated or times out. The Amazon API Gateway modifies the contents, received and sent, to match the required Africa’s talking format and the USSD Menu lambda function directs the entire interaction. 


The USSD Menu lambda function invokes various lambda functions to perform tasks such as villager role creation, the modification of villager information, the recording of villager transactions, and the retrieval of villager, site and site manager information. These lambda functions utilize AppSync to read and write to Amazon DynamoDB, which stores villager and transaction data along with filtration sites information.


When a villager purchases a subscription, the USSD Menu Lambda function invokes an AWS Step Function, named M-PESA State Machine, to automate the payment process.

The transfer of funds from villagers to TapGives is facilitated using Safaricom’s M-PESA payment API. Finally, Amazon Pinpoint notifies the villager regarding the success of the transaction and changes in their subscription status.

An infographic that describes the Customer subscription process. Their first step is to register, second is to activate their subscription, then confirm the subscription with a monthly subscription code, have the code validated by Site Managers, and collect water once verified.

Link to solution on GitHub: https://github.com/UBC-CIC/TapGives

Acknowledgements

We Make Impact: A not-for-profit Water Filtration Empowerment Group

Photo by We Make Impact at wemakeimpact.org

About the University of British Columbia Cloud Innovation Centre (UBC CIC)

The UBC CIC is a public-private collaboration between UBC and Amazon Web Services (AWS). A CIC identifies digital transformation challenges, the problems or opportunities that matter to the community, and provides subject matter expertise and CIC leadership.

Using Amazon’s innovation methodology, dedicated UBC and AWS CIC staff work with students, staff and faculty, as well as community, government or not-for-profit organizations to define challenges, to engage with subject matter experts, to identify a solution, and to build a Proof of Concept (PoC). Through co-op and work-integrated learning, students also have an opportunity to learn new skills which they will later be able to apply in the workforce.