In the never-ending pursuit to Always Be CLeveling up my coding skills I’ve recently been going through some Udemy courses to learn a few new tech-niques (get it?). So when I saw that Twilio and DEV were putting on a hackathon I thought it would be the perfect opportunity to bust out my new skills to build something fun and maybe even a little helpful.
Believe it or not I actually spent the first half of the month working on a completely different idea for a service that would allow you to set up a nearby contact (like a neighbour) to check in on you if you contracted an illness like COVID-19. After a couple weeks I decided it was a little too involved for such a short development window, so I scrapped the idea and went for something a little simpler.
Not all was lost, though, because I was able to move a lot of foundational setup and code to this new idea. So here we are…
Pals: A simple SMS service that allows you to chat with a random person anonymously.
When I was in elementary school I had the opportunity to have a pen pal. Actually it was an email pal. But the Power Macintosh G3 wasn’t the fastest and dial-up internet was slow enough that it might as well have been a proper pen pal. Anyway, I remember always looking forward to learning more about my new friend on the other side of the planet. So I figured in these crazy times, in this world where we’re isolated in our homes, maybe we could all use a pal of our own.
It’s simple, really. You just send a text to the service’s phone number. From there it’ll ask you for a name that you want to go by, and then you’ll be paired with someone else: your new Pal.
Once you’re connected any message you send will go directly to your Pal. Except one: text
> MENU to access commands that you can use to disconnect and more.
That’s pretty much it. It’s not meant to be complicated, no fancy UI or drawn-out signup process. The beauty in it is that it’s connecting you to someone you would likely never get to learn about otherwise, while at the same time keeping the participants’ phone numbers private.
As I mentioned above I was using this hackathon as an opportunity to play around with some stuff I’d be learning on Udemy. I’m currently enrolled in TypeScript course and I recently finished a Serverless course. So with that in mind, here’s a breakdown of the stack:
- Twilio’s Programmable SMS to deliver messages
Serverless AWS to provision most things and deploy code
- This included setting up the IAM Role statement, setting up VPC configuration, and employing both API Gateway and CloudWatch Events.
- AWS Lambda functions written in Node.js
- MySQL database (AWS RDS Aurora)
- Sequelize for the ORM
- TypeScript on all the things (or at least I tried… sort of)
I guess I should also note this was my first time using Sequelize as well. New things all around! Don’t you dare critique my code! 😁
There’s plenty that could still be done to make it shine, but I wanted to get an MVP in before the deadline.
Finally, I recognize that this probably isn’t a very sustainable model, considering you’re essentially proxying messages between two people. But hey, it was fun to make.
All you need to do is send a text to ███-███-████ and follow the prompts.
Ok, I had this whole post planned and was all excited for everyone to start texting in to meet their new Pals. Everything works as expected when developing and testing locally, but for reasons I am still unsure of I can’t get anything to happen when I execute the Twilio client’s create message function. I’ve spent hours trying to debug. At this point I think it has to do with my VPC/Subnet configuration, but I don’t know enough about it to figure it out just yet. After all, this is my first shot at a Serverless stack. 🙃
If I can figure it out before the deadline, great. If not and it disqualifies the submission, no big deal, I'm still proud of it. Check out the source below if you want to set it up locally and try it for yourself; maybe you'll have better luck than me.
Full source is available on GitHub at jodyheavener/pals.
This was a fun project. I really enjoyed applying some new Serverless knowledge, and at least a little bit of TypeScript. I’d love to hear what you think; what could be added to make Pals even better?