An app that connects with the Twilio API and Slack API to create restaurant reservations via SMS or slash command.
You can send a message in the format [Name] [MM-DD] [TTam] to make a reservation. For example, if John wants a reservation at 4pm on August 28, he would send John 08-28 4pm via SMS or Slack.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Please make sure you have the following:
- Twilio create a phone number to use with their Programmable SMS service
- ngrok allows you to test out webhooks locally
- Node.js
- npm The Node.js installer should include this
- Git
- Postgres
- Slack App create a Slack app to
Create a Postgres database for the project and save its connection URL as a DATABASE_URL environment variable.
Run the following terminal commands to get the app running:
Clone this repository onto your local machine:
git clone https://github.com/shahidsarker/reservation_bot.gitMove into the project directory:
cd reservation_bot/Run the following commands to install Node modules, migrate the database, and start the server:
npm install
sequelize db:migrate
npm startIn a separate terminal, move into the client directory then run the following commands to install Node modules and start the client:
cd client/
npm install
npm startIn a separate terminal window, move into the directory containing ngrok and run:
./ngrok http 3001Copy the forwarding address ending in ngrok.io.
Add the following as a Messaging webhook in Twilio:
https://[ngrok url]/reservations/sms
Add the following as a slash command Request URL for your Slack app:
https://[ngrok url]//reservations/slack
To run tests locally, run the following command from the parent directory:
npm test
- Express - The Node.js web framework used
- React
- Twilio API
- Slack API
- Shahid Sarker - shahidsarker Reservation functions, Postgres setup, Travis CI integration
- Cindy Song - zs0606 Initial setup, tests, reservation helpers