Bandwidth API Sample App for Appointment Reminders
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
readme_images
spec
.babelrc
.editorconfig
.env
.gitignore
.rspec
.travis.yml Fixed travis file Aug 11, 2017
CODE_OF_CONDUCT.md ContributionTemplates Nov 13, 2017
CONTRIBUTING.md
Dockerfile
Gemfile Reverted ruby version Nov 19, 2018
Gemfile.lock
ISSUE_TEMPLATE.md
LICENSE Create LICENSE Aug 30, 2017
PULLREQUEST.md
PULL_REQUEST_TEMPLATE.md
Procfile
README.md
Rakefile
app.json
app.rb
config.ru
database_backend.rb
docker-compose.yml
helper.rb
host_backend.rb Fixes in detection of protocol Aug 11, 2017
package.json fixes in package.json Aug 10, 2017
reminder_scheduler.rb Changed running of scheduler. Updated README Aug 15, 2017
run-dev.sh
webpack.config.js Initial commit Aug 7, 2017
yarn.lock

README.md

Appointment Reminder Ruby Example

Appointment reminders app for Bandwidth Voice and Messaging APIs.

Deploy

Build Status

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!

Features

  • Call or text
  • Recurring (daily, weekly)
  • Toggle reminders on/off

This app demonstrates:

Prerequisites

Accounts and Machine Setup

Env Variables

  • BANDWIDTH_USER_ID - Something like u-asdf
  • BANDWIDTH_API_TOKEN - Something like t-asf234
  • BANDWIDTH_API_SECRET - Something like asdf123asdf
  • DATABASE_URL - Connection path to MONGO DB like mongodb://localhost:27017

Deploying Locally with ngrok

Ngrok is an awesome tool that lets you open up local ports to the internet.

Ngrok how

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

ngrok terminal

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

Directly

# 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

Via Docker

# 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 ngrok url

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!

Copy the 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 ngrok url and not localhost. Bandwidth needs to be able to send callbacks.

landing page

mainpage