Code Monkey home page Code Monkey logo

massbailfund's Introduction

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.

massbailfund's People

Contributors

alexriina avatar katee avatar rsid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

massbailfund's Issues

Allow password resets

Right now, only admin users can access the settings page, and once an admin has set a user's password, if the user forgets it the admin needs to delete them and recreate a new user and password.

It'd be nicer if either the admin or the user could hit a reset password link, and do that thing if they forget (or if the original password is somehow compromised)

Access Denied Error when accessing admin url

Users attempting to access url/admin/clients/1 directly when the session has expired receive an access denied error.

Steps:

  1. Login to instance.
  2. Wait an hour?
  3. Go to url/admin/clients/1.

Expected: Redirect user to login url.
Actual: Access denied.

Screen Shot 2019-03-21 at 7 54 47 AM

Security

My instinct is there's a lot of personal information here that we might want to take pains to make more secure. Need to think about this more, once everything else is done.

New form fields

wanted to flag for both of you that I'd like to add a few more fields to the form. I'm adding this information manually when I do reporting, and that seems silly if we could gather it from the lawyers.

  1. County
  2. Ride Information (instead of reference information)
  3. Drop Down Menu for Court Houses
  4. Gender - this will likely be a little more complicated since it's going to serve a couple of functions - first, as a flag for us that the person is potentially in a jail where they are misgendered and second to be able to report on who we post for. I'm open to suggestions on how to do this responsibly and sensitively.

Uploading files

Uploading files doesn't work currently, and it should! Would want to hear about where we're storing them & how before implementation though.

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.