- node v14
- npm
# install dependencies
npm install
# run development
npm run dev
can be stored in a file called .env.local
TWILIO_ACCOUNT_SID=Your-Account-SID
TWILIO_AUTH_TOKEN=Your-Twilio-Auth-Token
TWILIO_PHONE_NUMBER=Your-Twilio-Number
NEXT_PUBLIC_PHONE_NUMBER=Twilio-Number-Used-For-Display
MONGODB_URI=Your-MongoDB-URI
LOG_LEVEL=Log-Level
BASIC_AUTH_USERNAME=username-for-basic-auth
BASIC_AUTH_PASSWORD=password-for-basic-auth
# load test data
npm run loadtestdata
# delete test data
npm run deletetestdata
# install twilio cli
npm install -g twilio-cli
# set env variable from .env.local
set -a
source .env.local
set +a
# set twilio webhook to local server
twilio phone-numbers:update "$TWILIO_PHONE_NUMBER" --sms-url="http://localhost:3000/api/sms"
# install heroku if not already
# linux
curl https://cli-assets.heroku.com/install.sh | sh
# log into heroku
heroku login
# add project to heroku
heroku git:remote -a vtcourtbot
# add config vars
# heroku config:set VARIABLE_NAME=value
# deploy latest site
git push heroku main
# add scheduler for sending reminders
# install scheduler
heroku addons:create scheduler:standard
go to (heroku dashboard)[https://dashboard.heroku.com/] and create a job with the following command
node -r esm scripts/send-reminders.js
Set it to run at 9PM UTC which is 5PM EDT or 4PM EST.