Appointment reminders app for Bandwidth Voice and Messaging APIs.
Table of Contents
What this Example Does
This application allows you to create an account and login with your phone number. Once you are logged in you can setup and send yourself a reminder!
- Call or text
- Recurring (daily, weekly)
- Toggle reminders on/off
This app demonstrates:
- Sending a code to a phonenumber to log in
- Creating a call and speaking sentence
Accounts and Machine Setup
- Bandwidth Voice and Messaging APIs Account
- Ruby 2.4+
- Ngrok For local Deployment Only
- Heroku For Heroku Deployment Only
BANDWIDTH_USER_ID- Something like
BANDWIDTH_API_TOKEN- Something like
BANDWIDTH_API_SECRET- Something like
DATABASE_URL- Connection path to MONGO DB like
Deploying Locally with ngrok
Ngrok is an awesome tool that lets you open up local ports to the internet.
Once you have ngrok installed, open a new terminal tab and navigate to it's location on the file system and run:
$ ./ngrok http 3000
You'll see the terminal show you information
Installing and running
Once ngrok is up and running. Open a new tab and clone the repo:
git clone https://github.com/BandwidthExamples/ruby-appointment-reminder.git cd ruby-appointment-reminder
# install node js (https://nodejs.org/en/) and yarn (https://yarnpkg.com/) # install or run mongodb. Set environment variable DATABASE_URL to right value for your mongodb instance bundle install # to install gems export BANDWIDTH_USER_ID=<YOUR-USER-ID> export BANDWIDTH_API_TOKEN=<YOUR-API-TOKEN> export BANDWIDTH_API_SECRET=<YOUR-API-SECRET> export DATABASE_URL=<YOUR-MONGO-URI> rake build # to build frontend PORT=3000 rake # to start web app and sheduler # Open in browser url shown by ngrok
# fill .env file with right values # vim ./.env # then run the app (it will listen port 8080) PORT=3000 docker-compose up -d # Open in browser url shown by ngrok
Open the app using the
When the app runs for the first time, it setups the Bandwidth voice and messaging callbacks for the application for you. It sets the callback urls based on the url visited!
http://8a543f5f.ngrok.io link and paste it into your browser.
On first run, the application will create the Bandwidth callbacks and voice/messaging application for you. Be sure you visit the
ngrokurl and not
localhost. Bandwidth needs to be able to send callbacks.