Giter VIP home page Giter VIP logo

lead-alerts-node's Introduction

Twilio

Instant Lead Alerts for Node.js and Express

This demo application shows how to implement instant lead alerts using Node.js and Express. Notify sales reps or agents right away when a new lead comes in for a real estate listing or other high value channel.

Read the full tutorial here!

Local development

To run this project on your computer, you will need to download and install either Node.js or io.js, both of which should also install npm. You will also need to sign up for a Twilio account if you don't have one already.

  1. First clone this repository and cd into it.

    $ git clone [email protected]:TwilioDevEd/lead-alerts-node.git
    $ cd lead-alerts-node
  2. Next, open .env at the root of the project and update it with values from your Twilio account and local configuration. You'll need to set TWILIO_AUTH_TOKEN, TWILIO_ACCOUNT_SID, and TWILIO_NUMBER.

For the TWILIO_NUMBER variable you'll need to provision a new number in the Manage Numbers page under your account.

The AGENT_NUMBER variable represents the number alerts will be sent to. Please make sure you have allowed SMS to be sent to the Country this number belongs to on the Global SMS Permissions page. Also, if you are on a trial account, make sure you have verified this number on the Verified Callers IDs page.

The phone numbers should be in E.164 format.

Run source .env to export the environment variables.

  1. Navigate to the project directory in your terminal and run:
$ npm install

This should install all of our project dependencies from npm into a local node_modules folder.

  1. To launch the application, you can use node . in the project's root directory. You might also consider using nodemon for this. It works just like the node command, but automatically restarts your application when you change any source code files.
$ npm install -g nodemon
$ nodemon .

Docker local development

  1. Install Docker and docker-compose.

  2. Make sure you performed step 2 on the previous section.

  3. Copy the template .env file and set the required environment variables.You can find these values at https://www.twilio.com/user/account/voice and at https://dashboard.authy.com.

    cp .env.example .env
  4. Load the variables in your session:

    source .env
  5. Finally, run the following commands to start your Docker containers:

$ docker-compose up -d

Warning: If you previously ran npm install locally, the node_modules folder will conflict with the file structure of the container when you run the above command. We recommended installing your node dependencies one folder up from the rest of your source code.

  1. You can then visit the application at http://localhost:3000/. If you're using boot2docker to run Docker on OS X, you'll need to use the value of boot2docker ip instead of localhost.

  2. To stop your containers, run docker-compose stop.

You can then visit the application at http://localhost:3000/.

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

lead-alerts-node's People

Contributors

joliveros avatar hortega avatar kwhinnery avatar brodan avatar atbaker avatar eliux avatar kathyguerron avatar smendes avatar nebtrx avatar

Watchers

James Cloos 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.