Giter Site home page Giter Site logo

codeforpdx / recordexpungpdx Goto Github PK

View Code? Open in Web Editor NEW
49.0 48.0 87.0 18 MB

A project to automate the expungement of qualifying criminal records in Oregon. This project is done in conjunction with Qiu-Qiu Law.

Home Page: https://recordsponge.com

License: MIT License

Python 47.40% Makefile 0.49% CSS 0.40% HTML 0.20% TypeScript 50.04% Dockerfile 0.14% SCSS 0.95% JavaScript 0.03% Jinja 0.35%
record-expungement code-for-america record-clear expungement civic-tech

recordexpungpdx's Issues

Update error methods in the crawler

The parsers have methods that will run when an error is encountered. These methods need to be implemented so that when an error does occur the user and the dev team can be notified appropriately.

Files to be updated:

This is done when...

  • The methods are updated so that it logs the error
  • And the methods raise the error so that the user can be notified of the issue

Usability testing milestone

Once we have a prototype, we'll need an entire sprint focused around usability testing. Without testing users on the experience, we'll not be sure how to iterate on the existing design and validate our assumptions.

This is a milestone (epic) issue that will include all of the tasks for usability testing.

Containerize Flask app

Build a Docker container for our Flask application. This container will run the Python/Flask code.

This involves:

  • adding a Docker file to src/backend/expungeservice
  • adding a stanza to docker-compose.yml
  • adding targets to Makefile for building the image, starting and stopping the container (see how the database container is done)
  • flesh out src/backend/expungeservice/wsgi.py
  • pick a base image, such as library/ubuntu to reference in src/backend/expungeservice/Dockerfile

Endpoint: /api/search

Endpoint for searching the remote site. The web app will POST to this endpoint with search params in the body, and the endpoint will make a request of the remote site.

Data format TBD.

Build project wiki on github

The project wiki on github provides external users with documentation about what our task is, what we're doing and ensures continuity when the project is handed off.

Describe the task here, including any supplemental information.
Tag yourself, or whoever is responsible for it.

This task is done when...

  • build out the project wiki

Sync parser and analyzer data classes

The parser has some data classes (e.g. Case) which are also duplicated in analyzer. Sync the two so that analyzer can understand objects generated by parser.

OR

Have the main app convert from one to another. The analyzer has predefined enums defined for some of the data types which basically stems from the expunge analysis flowchart while the parser objects are likely to have strings as types mostly.

Child of #9

Refactor front end to Tachyon theme

Replace Bootstrap with Tachyon and implement an IA that provides modular and global scopes. Also use BEM naming conventions for class(Names).

Build a project plan with milestones

Partner requests a project roadmap with timelines for deliverables.

Describe the task here, including any supplemental information.
Tag yourself, or whoever is responsible for it.

This task is done when...

  • a project plan is developed and team syncs on deliverables
  • plan is shared with partner agency

Containerize Nginx

Make a Docker container for the webserver. The weberver will:

  • - serve the React application
  • - route requests to the Flask service
    Involves:
  • - writing an Nginx config file config/nginx/nginx.conf with static route to the web app and routes to the Flask services
  • - configuring Nginx to use HTTPS
  • - adding a stanza for the web server to docker-compose.yml
  • - adding a target to Makefile to build the web server image
  • - adding a target to Makefile to build the web application as a docker volume that the web server will use to serve static html/css/images/etc

We also need to pick a Docker image to use for this task. Something like this: nginx - Docker Hub seems like a good place to start

Do not parse charges on Record parser

Context

The record parser extracts the cases from the search results page. It also extracts the charges associated to the case, but this is not necessary since the charges can be extracted from the case details page in more detail.

Tasks

  • Update tests to check the parser skips the charge column.
  • Remove the sections responsible for parsing the charge columns for each case.
  • Ensure all existing functionality does not change.

Endpoint: /api/stats

Endpoint for reporting on system statistics such as number of searches done, number of records expunged, and anything else we think is interesting

type eligibility list interface

I am currently hard coding a list of crimes that are ineligible for expungement (List A, List B, Etc.), however I get the feeling that maybe this list should be stored in the database and have some sort of interface so the public defenders office can view it and/or modify it as necessary.

I imagine that these lists don't change very often, but i'd probably want this feature if i was them.

Class for connecting to database

Write a Python class for connecting to a Postgres database. Constructor should take host, port, name, username, and password and should expose connection and cursor objects. Usage should be:

(in context of HTTP request, such as a GET or POST handler):

import database
g.database = database.Database(db_host, db_port, db_name, db_username, db_password)
g.cursor.execute("""SELECT username FROM users;""")
rows = g.cursor.fetchall()
print(rows)

Cannot install the itsdangerous dependency

Description

When running pipenv install the following error occurs.
Could not find a version that satisfies the requirement itsdangerous==1.0.0

Possible fix

Update to the latest version

Add main backend logic

This would probably implement the logic when user clicks "Search".

This should invoke the crawler/parser to get the data for given input (client name, dob), then call the analyzer, get the results and store it in database.

statute should be normalized before persisting

Description

Currently the charge class is initialized with a statute with whatever string value is passed to it. The Oregon e-courts website displays statutes in a variety of representations. A statute may be 6, 7, or 8 characters long, and may or may not contain decimal points, parenthesis, and other separators.

Have the charge initializer call a method to normalize the statute so that only alphanumeric characters are being persisted.

This task is done when...

  • A charge class is initialized with a statute containing only alphanumeric characters.

Setup hosting environment for prototype

We'll need a dev environment for the prototype of this application.

This task is done when...

  • identify the hosting environment (AWS, et. al.)
  • Setup environment

Add info on setting up the frontend to the README.md

The README.md includes info on setting up and running the backend in development. Here is an excerpt:

Running:

$ make run

will run the Flask app inside a Pipenv virtualenv.

This task is done when:

The README.md includes instructions on setting up the frontend in development (installing npm, npm install, etc.) and running the development server with npm run start

Endpoint: /api/users/

Endpoint for making and getting users. Endpoint should handle POST and GET requests.

POST /api/users/ to create a user:

{
    "username": "<USERNAME>",
    "email": "<EMAIL>",
    "admin": "<TRUE|FALSE">
}

admin is optional and will default to False

GET /api/users/USER_ID to get a user

The GET response is TBD but will include some set of columns in the users table. It could be:

{
    "user_id": "",
    "username": "",
    "email": "",
    "admin": "",
    "date_created": "",
    "date_modified": ""
}

Create a record parser

Build a parser that collects all the data from the search results page on OJCIN that builds a list of cases. Each row in the results page would be a case.

Create crawler

The crawler will accept search terms and login credentials to login & navigate the site using the parsers to scrape payloads required to crawl the site and to extract data from the search results page and each associated case page.

Child of #8

Create Login Form

Build react components that are reusable for building forms and provide form validation configurations.

Create a case parser

Build a parser that returns a list of charges for a case from the case detail page.

Re-visit the system design doc

The design doc is out-of-sync wrt issues logged since and subsequent discussions. We should sync up:

  • endpoint names

  • query parameters: what filters are needed?

  • POST bodies: what does the JSON sent to the server look like?

  • responses: what does the JSON returned by the server look like?

  • headers: what headers does the API require?

  • status codes: what status codes do endpoints return?

Create an "exercise" task to help new folks get up to speed faster

In the apps I've worked on before, we always had an exercise task that newcomers would complete just after joining. This task was designed to make sure newcomers could "learn by doing" by making a set of minimal, full-stack changes to give them something to do while they get familiar with the codebase.

If we had an exercise task like this it would also help with triage when lots of new people join: we could immediately give them something to work on that would teach them about the codebase and help them be more useful when working on features or refactors later on.

This task is done when:

  • There is an exercise task that meets the above requirements. This should probably be a page in the wiki that introduces the different parts of the app code and how the work together, and that walks someone through the process of making a simple, full-stack feature change or addition.

Endpoint: registration & login

Write an endpoint to log the user into the internal website. Take the user's credentials, validate against information stored in the database, and return a token.

This endpoint should handle POST, with the body containing username and password in JSON:

{
    "username": "<USERNAME>",
    "passowrd": "<PASSWORD>"
}

See issue #42

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.