Rally Call - An Emergency Comm Hub App in Just 14 Days
Tags: dohackathon, flask, python, twilio
Published: 2021-01-11 06:50:30

Rally Call is designed as an emergency communications hub for groups of people (we call them Crews) who have lost use of traditional comm channels like cell phones. Functioning as a group voicemail-box, Crew members can dial in from _any_ touchtone phone and listen to or record voice messages for other members of the Crew to hear. There are no login requirements, no device requirements, and no complex passwords to remember; you only need the foresight to sign up for an account before disaster strikes.    

Spin up your own instance of this app in minutes    

[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/chrsstrm/rallycall/tree/main?refcode=36448d570679)    

### Category: Program for the People


### App Link: https://rallycall-lf9t4.ondigitalocean.app/


### Screenshots    
![Rally Call Homepage](https://dev-to-uploads.s3.amazonaws.com/i/yztnxddak1uan25frn7y.png)
![Registration](https://dev-to-uploads.s3.amazonaws.com/i/hreiyld3lol9e81ryjjk.png)
![Sign In](https://dev-to-uploads.s3.amazonaws.com/i/t2yqcg1gmky565hloa7i.png)
![System admin dash](https://dev-to-uploads.s3.amazonaws.com/i/w40hgv15xi3b30thjhbk.png)
![System admin Crews](https://dev-to-uploads.s3.amazonaws.com/i/m95kr28axu2t0o99owho.png)
![System admin single Crew](https://dev-to-uploads.s3.amazonaws.com/i/q5fqyfa3o3dmh602uzk7.png)
![Crew admin dash](https://dev-to-uploads.s3.amazonaws.com/i/6lbgb9i5qnr3b257y1sb.png)
![Crew admin Messages](https://dev-to-uploads.s3.amazonaws.com/i/5g1wtsp02vtunq0zdbqm.png)
![Crew settings](https://dev-to-uploads.s3.amazonaws.com/i/4olobuvp0fpp25xm3geu.png)    

### Description:    
How would you communicate with your friends and family in an emergency if your cell phone didn't work? Rally Call is a group voice message system designed to keep you in touch using nothing more than a touchtone phone - a cell phone, landline, feature phone, pay phone, your neighbor's phone, VOIP, a fax machine - any phone!    

Someone from your Crew needs to register (before disaster strikes) and will create an account. This Crew Admin will be shown the dial-in number and the Crew's Account PIN. Share this information with anyone you want in your Crew. When a member of your Crew needs to communicate with the other members, all they need to do is dial in from any phone, enter the Account PIN, and they will be prompted to either listen to Messages in the account or record their own Message. Your Crew can use these Messages to stay connected - let others know you are OK, organize a meeting place, request supplies, etc.    

Messages are always presented as newest first, and basic Crew members cannot delete Messages, so there's no worry that a Message will be missed. If your Crew prefers a more secure account, the Crew Admin can add an Access Code - just another 6 digit code which protects access to your account much like your debit card PIN.    

With a little foresight and access to any touchtone phone device, your Crew can stay connected when other channels are down. 
 

### Link to Source Code: (https://github.com/chrsstrm/rallycall)

### BSD-3 Licensed
 
## Background


### How I built it 
Starting from scratch, the first thing I always do with a new project is map out the business logic flow.     

![Rally Call flowchart](https://dev-to-uploads.s3.amazonaws.com/i/fqvia6h7nqarmtk1rtgr.png)    

With the logic flow figure out it's time to map out the entities involved and build a data model.    

![Rally Call data models](https://dev-to-uploads.s3.amazonaws.com/i/x6h1k6zhowv97j1zp5m2.png)    

At this point we're ready to build. I chose Python and Flask, which makes scaffolding a CRUD app super simple. After building endpoints and interfaces to manage Users, Crews, and Messages, the only piece left is working with Twilio.    

While I've worked with Twilio before, getting started isn't too difficult. Phone numbers in Twilio will make a request to a URL of your choosing when a call comes in. You tell Twilio how to handle a call by responding with TWiML, which is based on XML. Using the Twilio Python SDK makes building Twilio responses easy. Following the logic flow I created earlier, I direct Twilio to Say, Gather, or Record based on input from the caller.     

Containerizing the application and deploying it with Digital Ocean's App Platform was relatively simple. After linking my GitHub, specifying the ENV vars the project needs and requesting a database, it only took one click to push the project live.    


### Additional Resources/Info    
This app requires a Twilio account to run. If you clone or fork the app, make sure to sign up for Twilio and buy a number first. When first booted, the app will automatically adjust your Twilio account settings to make sure the number endpoint is up to date.