TxtJokes - A Twilio Hackathon project
Tags: twiliohackathon, django, python
Published: 2020-04-23 19:05:11


Let's be honest, the world is a pretty lonely and sad place for most of us during the COVID-19 pandemic. Self-isolation sucks, Quarantines suck, etc. I thought it would be fun to get a few laughs while creating a project for the #twiliohackathon

## What I built
<a href="txtjokes.herokuapp.com">txtjokes.herokuapp.com</a>

Send nerdy jokes by SMS. Just create an account, login, and put in your number and get a joke text on your phone!

## Demo Link
 <a href="txtjokes.herokuapp.com">txtjokes.herokuapp.com</a>

## Link to Code
https://github.com/paqman85/txtjokes

## How I built it (what's the stack? did I run into issues or discover something new along the way?)

I built this project using Django as my backend and the built-in templating engine paired with a bootstrap 4 template (<a href="https://bootswatch.com/minty/">bootswatch minty</a>) as a stylish front end.

I'm using several libraries in this build: <a href="https://www.twilio.com/docs/libraries/python">Twilio's python package</a> to facilitate sending SMS, <a href"https://pyjok.es/">Pyjokes</a> as a joke library, Docker, Pipenv, and the demo is running on Heroku.

I ran into several issues that had me pulling out some hair. Dealing with phone numbers in a Django form and converting the input into a usable number for Twilio was a bit of a hurdle. I found <a href="https://github.com/stefanfoulis/django-phonenumber-field">Django-Phonenumber-Field</a>; which uses Google's phone number library. I was able to leverage this package to help parse the input into the right format for Twilio.

I added user registration and forced the user to be logged in to send SMS msgs.

Email transactions for authentication are sent via <a href="https://www.twilio.com/sendgrid>Twilio SendGrid</a> - using their API and the <a href="https://pypi.org/project/sendgrid-django/">SendGrid-Django package</a>.

## Additional Resources/Info
Find the app live at <a href="txtjokes.heroku.com">txtjokes.heroku.com</a>

This project was a fun one day build. I found Twilio's tech and docs pretty user friendly for python.

###I have ideas to expand the project:
* Txt counter to show how many jokes were sent.
* Notification bubble to show the joke sent
* Expanding joke library
* Subscription service for daily jokes

And I also think that this project would be a great base for many spin-off ideas such as:

* Daily motivation messenger (Don't give up!)
* Reminder service ("Don't forget the milk" - texted as you finish your workday)
* COVID-19 daily info msgs (Daily stats send in brief to your phone)
* Daily Gifs -- Combine this service with Giphy API
* Anonymous SMS service
* Daily riddles (24 hours to solve before the answer is sent)
* Chess by SMS - learn to play blind chess with notations

If I get a lull in dev work, I'll be sure to pick one of these great projects to expand on Twilio's tech - I especially love the chess one. :D

You can find me typically lurking here on Dev, or <a href="https://atomicgrowth.co">developing web applications</a> for money! I love working with <a href="https://www.djangoproject.com/">Django</a>. Currently also learning some <a href="https://nim-lang.org/">Nim</a>. Always happy to make new friends, collaborate, and talk shop.