SMS Powered Realtime COVID-19 Mask Donation Drive tracker
About
This application provides the ability for users to run grassroots donation drives for coordinating home-made and donated face masks as part of the effort to curb the spread of COVID-19 virus. Users can control their donation drives by sending text messages to a designated auto-provisioned Twilio number and start receiving and distributing face masks.
This is a sample application developed for Twilio x DEV community hackathon.
Twilio APIs Used
- Programmable SMS
- Twilio.Rest.Api.V2010.Account
- Twilio.Rest.Api.V2010.Account.AvailablePhoneNumberCountry
Implementations in other languages:
| .NET | Java | Python | PHP | Ruby |
|---|---|---|---|---|
| YES | TBD | TBD | TBD | TBD |
Demo
How it works
- User who wants to start a donation center sends SMS message with
Startto a designated Twilio number to start a donation drive - The application will respond back with address validation request and once the center address is validated the application sets up a new Twilio phone that the donation center coordinator can share for receving donated masks and also distributing masks
- Donation centers are displayed real-time on Google map
- Donation center coordinator can text
Closeto stop the donation event
Activity Diagram
Donation center establishment process.
Features
- Twilio SMS - to control center opertaions (start/stop event)
- Google Geolocation & Map API - to validate addresses and display map
- Azure Serverless Function - to orchestrate SMS operations
- Azure hosted SignalR service - to broadcast donation centes real-time
- Angular to display realtime map data
Set up
Requirements
Account Settings
Before we begin, we need to collect all the config values we need to run the application:
Twilio Account Settings
| Config Value | Description |
|---|---|
| Account Sid | Your primary Twilio account identifier - find this in the Console. |
| Auth Token | Used to authenticate - just like the above, you'll find this here. |
| Phone number | A Twilio phone number in E.164 format - you can get one here |
Google Services
Configuration values needed.
| Config Value | Description |
|---|---|
| API KEY | API key used for Google Map and Geolocation services - find this in the Goggle Cloud Console. |
How to provision services in Google Cloud Console.
- Go to API Manager
- Click on Overview
- Search for
Google Maps JavaScript API(Under Google Maps APIs). Click on that - You will find Enable button there. Click to enable API.
- Search for Geocoding API and enable that as well
Azure Services
Configuration values needed.
| Config Value | Description |
|---|---|
| SignalR Connection String | Connection string for Azure Hosted SignalR in the Azure portal. |
How to set up a hosted SignalR service
- Go to Azure portal and create a new Hosted SignalR service
- One the service is provisioned get the connection string from the
Service > Keysblade
Local development
- Clone this repo
- Add the following json as
local.settings.jsonfile underOpFaceMask\opFaceMask.Functionsdirectory
{
"IsEncrypted": false,
"Values": {
"Simulated": true,
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"donatedItem": "Masks",
"googleApiKey": "[YOUR GOOGLE API KEY]",
"accountSid": "[YOUR TWILIO ACCOUNT SID]",
"appPhone": "[YOUR TWILIO PHONE NUMBER]",
"webHookUrl": "[YOUR ORCHESTRATOR FUNCTION URL]",
"voiceUrl": "[SAMPLE VOICE URL - CAN USE TwiML Bins]"
}
}
- Add your GoogleMap API key on
OpFaceMask\opFaceMask.Web\ClientApp\srci.e.
<script src="https://maps.googleapis.com/maps/api/js?key=[YOUR GOOGLE API KEY]"
type="text/javascript"></script>
- With command terminal go to
OpFaceMask\opFaceMask.Webfolder and run the command to save the hosted SignalR connection string.
dotnet user-secrets set Azure:SignalR:ConnectionString "<Your connection string>"
-
Run the solution file. (This should bring up Azure Function Console terminal and also start the ANgular map website)
-
Run the Simulator app
fnOpFaceMask.Simulatorafter the website loads.
SMS Operations
- Text 'start' to your Twilio number to start a donation drive
- Text 'close' to your Twilio number to end a donation drive
- Text 'donate' to your Twilio number to donate items
- Text 'receive' to your Twilio number to receive donated items
Running Modes
By default the application runs in demo mode where it accepts text messages from a simulator application. To test with a Twilio number change the Simulated flag in local.settings.json to false.
Resources
Contributing
This repo is open source and welcomes contributions.
License
Disclaimer
No warranty expressed or implied. Software is as is.

