courtbot

Your friendly neighborhood court robot. Provides an API for getting court case data. Intended to be modular and interoperable.

View the Project on GitHub opensavannah/courtbot

#Courtbot (Tulsa Edition) Build Status

NOTES

This branch is for development of the Tulsa version. It’s a WIP.

Courtbot

Courtbot is a simple web service for handling court case data. It offers a basic HTTP endpoint for integration with websites, and a set of advanced twilio workflows to handle text-based lookup.

Specifically, the twilio features include:

Running Locally

First, install node, postgres.

Since the app uses twilio to send text messages, it requires a bit of configuration. Get a twilio account, create a .env file by running cp .env.sample .env, and add your twilio authentication information. While you’re there, add a cookie secret and an encryption key (long random strings).

Install node dependencies

npm install

To start the web service:

npm start

Deploying to Heroku

First, get a twilio account and auth token as described above. Then:

heroku create <app name>
heroku addons:add heroku-postgresql
heroku addons:add scheduler
heroku config:set COOKIE_SECRET=<random string>
heroku config:set TWILIO_ACCOUNT=<twilio account SID>
heroku config:set TWILIO_AUTH_TOKEN=<twilio auth token>
heroku config:set TWILIO_PHONE_NUMBER=<your twilio phone number>
heroku config:set COURT_PUBLIC_URL=<where to send people for more info>
heroku config:set QUEUE_TTL_DAYS=<# days to keep a citation on the search queue>
heroku config:set COURTBOT_TITLE=<name for courtbot>
heroku config:set REMINDER_DAYS_OUT=<number of days out to remind users (typically 1)>
heroku config:set API_TOKENS=[<list of api keys you wish to be honored when making privileged requests>]
heroku config:set COURTBOOK_URL=<courtbook url>
heroku config:set COURTBOOK_OAUTH_SECRET=<courtbook oauth secret>
heroku config:set COURTBOOK_OAUTH_CLIENT_ID=<courtbook oauth client id>
heroku config:set COURTBOOK_OAUTH_AUDIENCE=<courtbook oauth audience>
heroku config:set COURTBOOK_OAUTH_TOKEN_URL=<courtbook oauth token url>
heroku config:set OSCN_COUNTY=<county in oklahoma to pull case data from>
git push heroku master
heroku open

Finally, you’ll want to setup scheduler to run the various tasks each day. Here’s the recommended config:

Running Unit Tests

The run the tests:

npm test