Coder Social home page Coder Social logo

twilio-sms-chatbot_9rv3's Introduction

Bi-directional SMS demo app

Features

  • send and receive SMS right from the web browser
  • threaded conversations
  • select from different phone numbers to use for SMS

Installation

This demo is built with NodeJS and MongoDB. Requirements:

  • npm
  • node
  • mongo
  • ngrok (for running locally and testing)

To get started, clone this into your local repo with:

$ git clone [email protected]:twiliosa/demo-app-bidirectional-sms-nodejs.git

Once you have it cloned locally, edit the config.js file (config/config.js) and set the following variables to your Twilio information (which can be found in your Twilio account portal).

process.env.TWILIO_ASID = '{{YOUR ACCOUNT SID}}';
process.env.TWILIO_AUTH_TOKEN = '{{YOUR AUTH TOKEN}}';
process.env.TWILIO_PHONE_NUMBERS = ['{{TWILIO PHONE NUMBER}}','{{TWILIO PHONE NUMBER}}'];

Once you set the values in config.js, run the following:

$ npm install

Running locally

Start mongo and you can begin your node server.

$ mongod
$ node server.js
$ ngrok 3000

Make sure to configure your Twilio phone numbers (the ones set in config.js). Set their SMS URLs to

Deploying to Heroku

$ heroku create
$ git add .
$ git commit -m "push to heroku"
$ git push heroku master

This will give you a fresh version of this app deployed to Heroku. When it is successful, you will see the following:

$ http://your-app-domain.herokuapp.com deployed to Heroku

You'll need that URL to do the last bit of configuration on Twilio:

Go to the Twilio number you specified in config.yml and set it's SMS URL to:

Now you're all set. Enjoy!

                         ____
                      ,''    ''.
                     / `-.  .-' \
                    /( (O))((O) )
                   /'-..-'/\`-..|
                 ,'\   `-.\/.--'|
               ,' ( \           |
             ,'( (   `._        |
            /( (  ( ( | `-._ _,-;
           /( (  ( ( (|     '  ;
          / ((  (    /        /
         //         /        /
         //  / /  ,'        /
        // /    ,'         /
        //  / ,'          ;
        //_,-'          ;
        // /,,,,..-))-))\    /|
          /; ; ;\ `.  \  \  / |
         /; ; ; ;\  \.  . \/./
        (; ; ;_,_,\  .: \   /
         `-'-'     | : . |:|
                   |. | : .|

twilio-sms-chatbot_9rv3's People

Contributors

akulkarni7a avatar trellixvulnteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.