Twilio Messenger
Web application to communicate with lists of people using the latest web technologies.
Goal: Create a simple app that uses Twilio’s API to handle many concurrent conversations.
This application was built using Node.js and React, but the source wasn’t designed to be open. It’s a private project but I would like to share some of the main parts.
The application takes in CSV uploads of names and numbers, then allows for dialogue to happen with each number. A broadcast message can be sent to every selected number, and the returning messages are forwarded from Twilio to the application.
CSVs can be exported with message history and lookup information.
This demonstrates a few useful concepts.
Modules are something I think it’s worth spending the time to think about. They are extremely useful and can find a place in every project.
XLS creation took me a while to get working with Node, Express, and files not being corrupted on the client. The parts are simple once properly strung together and it boils down to…
- Create your columns.
- Populate your rows. In my case they came from a JSON object.
- Build your Excel file.
- Serve it as binary to the client with proper headers so it’s parsed properly.
- Handle Errors.
This informs the browser that a file is to be expected and it will automatically initiate a download. Node can send the result as a binary stream to the client.