Skip to content

codeforkansascity/TrashTrackerSMSApp

Repository files navigation

Trash Tracker SMS

License

Table of Contents

Description

Trash Tracker is a simple, lightweight system that allows residents and staff of the Lykins neighborhood to report illegal dumping with a simple text message. This app is one of its three repositories. It performs the function of recording the reporting messages.

Prerequisites

Installation

  1. Install dependencies

    npm install -g yarn && \
    yarn install
  2. Copy the sample configuration file and edit it to match your configuration

    $ cp .env.EXAMPLE .env

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings.

Usage

To run the application, enter:

```bash
$ node ./controllers/flow.js
```

Any users can send a text message to our Twilio phone number (816) 608-6096 and start the conversation! The following photo shows an example:

Example of text communication

After the conversation is complete, you can go to http://localhost:1337/ to see the reporting information.

Local Development

You will need a webhook url on the public Internet. To do that, you need to install ngrok to expose your local network to the public Internet. After you install it and configure the authentification, open a second terminal and enter the following command:

$ ngrok http 1337

Once you acquire a forwarding url from ngrok, copy and paste it in http_request_english and http_request_spanish widgets in your Twilio Studio flow. You will need to update the url everytime you run that script. The below photo shows an example.

Example of http_request widget

Other Usages

If you want to design your own app without using Twilio flow, here are some resources:

  1. To initiate or send a custom message, enter:

    $ node ./controllers/mms-send.js
  2. To fetch a message sent to your Twilio number, enter:

    $ node ./controllers/mms-fetch.js
  3. To set up an auto-generated reply to messages sent to your Twilio number, enter:

    $ node ./controllers/sms.js
  4. To send an image to your webhook url, enter the following command and go to http://localhost:1337/ to see the images received.

    $ yarn start

Credits

Twilio documentations have been tremendous help for this project, especially the ones on Programmable SMS and on Twilio Studio. The 4th usage of "other usages" of this repository uses almost all code from the Twilio repository receive-mms-node.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages