Giter Club home page Giter Club logo

courtbot's Introduction

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:

  • Payable Prompt. If a case can be paid immediately, the app offers a phone number and link to begin payment.
  • Reminders. If a case requires a court appearance, the app allows users to sign up for reminders, served 24 hours in advance of the case.
  • Queued Cases. If a case isn't in the system (usually because it takes two weeks for paper citations to be put into the computer), the app allows users to get information when it becomes available. The app continues checking each day for up to 16 days and sends the case information when found (or an apology if not).

Running Locally

First, install node, postgres, and foreman.

To get started:

git clone https://github.com/codeforamerica/courtbot
cd courtbot
npm install

Then, to create the tables and load in initial data:

node utils/createQueuedTable.js
node utils/createRemindersTable.js
node utils/loaddata.js

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 mv .env.sample .env, and add your twilio authentication information. While you're there, add a cookie secret and an encryption key (long random strings).

To start the web service:

foreman 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>
heroku config:set TWILIO_AUTH_TOKEN=<twilio auth token>
heroku config:set TWILIO_PHONE_NUMBER=<twilio phone number>
heroku config:set PHONE_ENCRYPTION_KEY=<random string>
git push heroku master
heroku run node utils/createQueuedTable.js
heroku run node utils/createRemindersTable.js
heroku run node utils/loaddata.js
heroku open

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

scheduler settings

courtbot's People

Contributors

glassresistor avatar samhashemi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

courtbot's Issues

Add tests

@pui reached out and I'm happy to help with this - @samhashemi would you be interested in pairing at some point? Let's roll up our sleeves! ☔

loaddata.js

We were just trying to load the CSV data by using the URL string provided in the loaddata.js file in the utils folder. This is the string here:

var yesterday = moment().subtract('days', 1).format('MMDDYYYY');
var url = 'http://courtview.atlantaga.gov/courtcalendars/' +
'court_online_calendar/codeamerica.' + yesterday + '.csv';

That file doesn't seem to be available anymore.

Does anyone have a current URL that works, or a sample of a csv file that came from the link in the past. We are just trying to show judiciary here what other states provide.

Thanks!

Add link to courtbot evolution

Provide a link at the top of the Readme to this Code for America discourse page which lists recent iterations.

Include reference to the #courtbot channel within the Code for America Slack.

Atlanta Courtbot Status

The court website is now https://court.atlantaga.gov/
You can look up things under “find my case” but we don’t see anything about text reminders.
The data in the original Atlanta code seems to come from http://courtview.atlantaga.gov, but that site is now down.

seems to be an issue with lodash in knex dependencies

$ DATABASE_URL=127.0.0.1:5432 node utils/createQueuedTable.js
at createTable 127.0.0.1:5432
/Users/kuanbutts/Documents/cfa/courtbot/node_modules/knex/node_modules/lodash/lodash.js:8878
throw new TypeError(FUNC_ERROR_TEXT);
^

TypeError: Expected a function
at Function.rest (/Users/kuanbutts/Documents/cfa/courtbot/node_modules/knex/node_modules/lodash/lodash.js:8878:15)
at Object.knex.schema.(anonymous function) as createTable
at createTable (/Users/kuanbutts/Documents/cfa/courtbot/utils/createQueuedTable.js:11:22)
at Object. (/Users/kuanbutts/Documents/cfa/courtbot/utils/createQueuedTable.js:25:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)

Service 503

This isn't quite the correct place to report this issue, I supposed, but the http://courtbot.herokuapp.com/ site is down as a 503 right now:

<h1>Application Error</h1>
<div class="article"> 
    <p>An error occurred in the application and your page could not be served.  Please try again in a few moments.</p>
    <p>If you are the application owner, check your logs for details.</p>
</div>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.