Skip to content

MassBailFund/MassBailFund

Repository files navigation

Build Status Coverage Status

Mass Bail Fund

The Massachusetts Bail Fund is committed to the harm reduction of freeing individuals serving pre-trial sentences, and to abolishing pre-trial detention and supervision in the long-term. We pay up to $500 bail so that low-income people can stay free while they work towards resolving their case, allowing individuals, families, and communities to stay productive, together, and stable.

This site is the code for the administrative back end of the bail fund. If you are interested in contributing to the code, welcome! Take a look at the contribution guidelines below. If you work or volunteer with another bail fund and would like help adapting this code for your own organization, let us know by opening an issue! We're happy to help.

Contribution Guidelines

Anyone at any experience level who wants to contribute is welcome! We have open tickets to work on here, and have tagged ones that we think would be good tickets to start with as good-first-ticket.

Once you have cloned down the repo and gotten everything working locally, the flow would be to create a new feature branch for your issue, write tests covering any new code, and make a pull request. We'll try to review them in a timely fashion, but feel free to tag the current maintainer (RSid) if you've waited more than 2 weeks for a response.

We could specifically use:

  • regular contributors (infrequent but steady is fine! all levels of experience welcome)
  • code reviewers
  • UX designers
  • domain experts (run a bail fund? work as a public defender? an incarcerated/formerly incarcerated person? Let us know what more bail funds & bail fund tech can do!)

Setup

  1. Clone down repo
  2. Download and install mysql
  3. Download and install node if it's not already installed
  4. I'd advise using a ruby version manager such as chruby or rvm, and make sure that you're using >= ruby 2.3. Run bundle install. (You may have to run gem install bundler if you do not already have it)
  5. Run MA_BAIL_USER_PASSWORD=[your desired user password here] rails db:reset You may also wish to alter the username associated with that user in seed.rb.
    • If you run into errors, check that the username and password for your root mysql user matches those in database.yml
    • Also confirm that your desired user password meets the minimum length requirements
  6. Check to see that all tests are passing with rspec spec.
  7. Run the site with rails s, then go to localhost:3000 to see if it works!

Important Dependencies

Tool Description
Rails Batteries included web application framework
Devise Powerful user authentication/activation/password resets
CanCanCan Define abilities for users in one place
PaperTrail Keeps a history of model changes
SimpleForm A Rails form builder plugin

Important Development Dependencies

Tool Description
FactoryBot Easily create models to test with
Faker Generate realistic looking fake data

Models [TODO: update]

Entity-Relationship Diagram (To update this image after the schema changes run bundle exec erd)

The models are currently a work in progress. We are waiting to look at the current schema before making decisions on how to model things.

Deployment

We are currently using Heroku to deploy. Heroku's docs on getting set up are pretty thorough, and are located here.

You will need to take a couple of extra steps if this is your first time provisioning and deploying to a new environment. The dummy user the app's initialized with will draw its password from an environment variable MA_BAIL_USER_PASSWORD. You'll also need to install the cleardb add-on here in order to use MySQL, and follow the instructions for the mysql2 gem in order to get your database url. Then, you'll need to make an environment variable with that as the value and the key DATABASE_URL. You will also, if this is a first deployment, want to run rake db:migrate and rake db:seed to populate dropdowns, etc.

About

Administrative site for the Massachusetts Bail Fund - learn more about our work here:

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published