
Create a Twilio account, verify email and phone, and start the free trial to access initial credits as a student. Learn how to buy your first number.
Learn how to obtain a free trial Twilio number, search and release numbers by country, compare SMS availability and pricing, and purchase a number for SMS testing, including US testing.
Create a restricted API key in settings, prefer a bystander key to limit access, and securely store the secret in a file since it won’t be shown again.
Initialize a Node.js backend for Twilio with Express and dotenv, create environment variables in .env, secure tokens and account details, and commit best practices for version control.
Set up dotEnv and environment variables for Twilio, initialize tokens and account credentials in a backend folder, and prepare to send SMS via Express in upcoming steps.
Learn to send your first sms using Twilio with Node.js by configuring from, to, and body, handling asynchronous calls and errors in a simple booking workflow.
Initialize express and set up a basic server on port 3001 with a test route /test that responds hello from express. Verify by visiting localhost:3001/test and streamline development without reloads.
Explore how nodemon auto restarts Express apps during development, compare global vs local setup, and configure an npm script to streamline starting nodemon for a Node.js server.
Install and use LocalTunnel to expose your localhost as a public url, enabling testing of your Twilio and Node.js SMS booking system and consistent webhooks without changing urls.
Configure Twilio webhooks to receive SMS by linking a phone number to a POST endpoint that Twilio will call with SMS data, enabling callback handling for SMS messages.
Set up an express endpoint to receive SMS from Twilio, parse the post body with body-parser, and log the incoming message while preparing a reply with booking options.
Learn to manage stateless SMS with Express sessions, track conversation state via cookies, and respond using Twilio Messaging Response in a Node.js backend.
Demonstrates verifying a new phone number through a text verification flow, selecting the United States, entering the number, and submitting the verification code to send and receive messages.
Explore tracking SMS conversations with Node and Twilio by managing session state, handling first and second messages, and logging message flows to ensure reliable customer communications.
Configure an sms booking flow by replying with booking options on the first message and advancing a step variable through cases one to four, with console logs for each step.
Parse the message body to identify the appointment type: gym, personal trainer, or massage, and book the corresponding session, with fallbacks for unclear requests.
Develop an sms booking flow that parses user replies to identify a weekday, builds a weekdays array from environment variables, and prompts for a single day and available times.
Test the sms booking flow with Twilio and Node.js, fix small mistakes like case sensitivity and spaces, log weekdays, and restart the app to validate Monday booking.
Create a robust regex to extract the requested hour from client replies, handling 1-2 digit hours with optional spaces and various a.m./p.m. formats, anchored to line start.
create a case three flow to extract a time from user input using a regex for hour and am/pm, then confirm the appointment with weekday and type.
Confirm appointments via an sms response by extracting type, weekday, and time from the request, then send a booked slot message with the date, time, and contact for changes.
Refactor your node backend by extracting repeated logic into separate functions and modules, create helpers for match types and request handling, and export them for reuse.
Refactoring part 2 guides you through wiring a match time function, handling request and message context, exporting confirm booking, and returning messages.
Learn the guard pattern to simplify code by returning early on errors and handling correct cases later, improving readability and clarity.
Enhance the Twilio and Node SMS booking app by wiring a dockerized database (MongoDB or relational) to manage times, bookings, and payments with Stripe, plus personalized, automated messaging.
Twilio the world's leading cloud communications platform as a service (CPaaS) that enables you to develop SMS solutions, WhatsApp, Voice, Video, email, and even IoT. Twilio powers communications for more than 190,000 businesses and enables nearly 932 billion human interactions every year.
This course will leverage some of those capabilities to create a fully functional SMS booking system. Here is how it works, the customer interested in booking an appointment send an SMS to a Twilio number; our Node.JS backend application understand the message and send an SMS back to the customer saying:
Hi, do you want to book an appointment to:
see the gym
book a personal trainer
book a massage
After that, we wait for a user reply, such as:
I want to book a massage
After that, our Node application will send an SMS to the user asking:
What date do you want to see the masseur
The customer will reply with a preferred day, such as:
Monday, please
In this case, we will reply with the valid times available on Monday
Do you want to book it on Monday: 10 am, 11 am, 1 pm or 4 pm
After the customer selects the best time for the booking, they will reply saying:
At 11 am is good for me
After collecting all the data, the NodeJS application will send a confirmation to the customer saying:
Your appointment is booked to see the masseur on Monday at 11 am. See you than
Please note all the data above is fictional and hardcoded to the application. The course focuses on sending and receiving the SMSes, leaving all the logic of checking the actual dates and times and finalizing the booking for you to implement.
Said that new Chapters are coming, and as a student, you can help me decide what comes next. So far few ideas I have on a road map are:
Add the logic to read/write on the database been able to validate bookings and available times.
Add a relational database to the application as a Docker container and add the current application to a container with easier development and deployment.
Add an option to cancel a booking.
Add an option to make a payment via SMS using stripe.
Move the NodeJS code to a Serverless function and host it in Twilio.
Any amazing idea you may have.
Enjoy the course!