Code Monkey home page Code Monkey logo

survey-node's Introduction

Twilio

Node.js CI

Automated Surveys. Powered by Twilio - Node.js/Express

Instantly collect structured data from your users with a survey conducted over a voice call or SMS text messages. Learn how to create your own survey in the language and framework of your choice. For a step-by-step tutorial see twilio docs.

Local development

First you need to install Node.js as well as MongoDB

To run the app locally:

  1. Clone this repository and cd into it

    $ git clone [email protected]:TwilioDevEd/survey-node.git
    
    $ cd survey-node
  2. Install dependencies

    $ npm install
  3. Copy the sample configuration file and edit it to match your configuration

    $ cp .env.example .env

    Be sure to set MONGO_URLto your local mongo instance uri for example: mongodb://localhost:27017/surveys where surveys is the db name.

  4. Run the application

    $ npm start

    Alternatively 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 index
  5. Expose your application to the wider internet using ngrok. This step is important because the application won't work as expected if you run it through localhost.

    $ npm i -g ngrok
    $ ngrok http 3000

    Once ngrok is running, open up your browser and go to your ngrok URL. It will look something like this: http://9a159ccf.ngrok.io

    You can read this blog post for more details on how to use ngrok.

    Configure Twilio to call your webhooks

    You will also need to configure Twilio to call your application when calls are received

    You will need to provision at least one Twilio number with voice capabilities so the application's users can take surveys. You can buy a number using the twilio console.. Once you havea number you need to configure your number to work with your application. Open the number management page and open a number's configuration by clicking on it.

    Configure Voice

  6. Check it out at http://localhost:3000

Meta

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

survey-node's People

Contributors

acamino avatar alexisbcc avatar dependabot-preview[bot] avatar dprothero avatar hortega avatar jarodreyes avatar jefflinwood avatar joliveros avatar kwhinnery avatar masonicgit avatar smendes avatar tomwanzek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

survey-node's Issues

Application Error on Heroku

Hi Twilio Team,

I read through the interactive tutorial and tried to deploy the example through the Heroku template you guys provided in the readme.md but for some reason I get an application error when I go to the landing page. Any ideas as to why? When I run locally, it appears that 27017 is undefined which means that I don't have a local instance of MongoDB running. However, from Heroku, I saw that a mongoDB instance is running with MongoLabs. What could possibly be the problem then on my Heroku deployed application? Here's the link with the message.
https://twilio-hackprinceton-sample.herokuapp.com/landing.html

Thank you!
Michael

Survey stuck at second question, does not accept DTMF

Been troubleshooting for over a day and no matter how many times i call back the survey gets stuck at the 2nd question. I'm trying to figure out how to add defaults in case a question fails and move on to the 2nd question. I think it's not a good practice to have callers get stuck in the same question for some reason the survey breaks.

MongoError: Unknown modifier: $pushAll

Tried to run the demo, got above error. Seems to be related to mongoose being out of date, should be fixed in upcoming version.

Automattic/mongoose#4865

I found a fix that worked for me.

Adding

usePushEach: true

to SurveyResponseSchema in SurveyResponse.js, worked for me.

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.