Real-time, multi-user chat interface for SMS / text messages. Imagine a call center where customers can send a text message to a single number and have a live chat with any agent(s) available.
To use enviar in production, you'll need a Twilio account for sending SMS and a Postmark account for sending password reset emails. If you're setting enviar up for production, I recommend creating those ahead of time because you'll need your twilio account's "Account SID" and "Auth Token", and your postmark account's "server token" as part of the application install process. If you're not setting up enviar for production, you can skip this part for now.
Free hosted installation
You can use Cloudant's free tier for the database by
setting up an account there. Create a database called
enviar once you've signed up.
You can run the application on Heroku's free tier.
Fill in the parameters from the accounts you've setup, including your Cloudant
account in the
You should be able to view your application at
and login using your Cloudant credentials.
Local / self-hosted
This application uses CouchDB to store messages. Follow their install docs to run CouchDB locally.
By default, CouchDB considers everyone an admin, which is known as "Admin Party."
Disable this by going to the control panel (usually at
and disabling it (image credit @nolanlawson).
In doing so, you'll create your admin account with a password.
- Clone this repo using
git clone https://github.com/timwis/enviar.git
- Install node dependencies via
- Fill in your the
http://localhost:5984), along with the
COUCHDB_PASSyou setup. The other variables are only required in production mode.
- Enable CORS
npm run corsfrom the terminal
- Run the server using
NODE_ENV=development npm start
- Access the server at
You can simulate sending messages using the interface. To simulate receiving a message,
POST request to
POST request: (note the
+ in the phone number is encoded as
curl -X POST -d 'SmsSid=123456&From=%2B12597150948&Body=hello' http://localhost:3000/api/inbound
- Make sure all the credentials are filled out in
- Run the server using
- Point twilio's incoming message webhook to
http://<your-server>/api/inbound(check out ngrok to expose your localhost)
Access the server at
http://<your-server>:3000 (override port using
PORT environment variable)