recordexpungPDX

A project to automate expunging qualifying criminal records. This project is done in conjunction with the Multnomah County Public Defender's Office. Learn more in the wiki.

Waffle.io - Columns and their card count

Build Status

Table of Contents

Installation

  1. Fork, and clone the repo.

  2. Install Python:

    • Mac

      To install the latest version of Python on Mac run:

      $ brew install python3
      

      note: This will pull the latest version of Python, so when Python 3.8 or greater is released it will install that version.

    • Linux

      • Ubuntu 18.04

        To install Python 3.7 on Ubuntu 18.04 run the command:

         $ sudo apt-get install python3.7 -y 
        
      • Ubuntu 16.04

        To install Python 3.7 on Ubuntu 16.04 follow the instructions here.

    • Windows

      To install Python 3.7 on Windows, follow the instructions in this guide..

  3. Install Pipenv

    Install the pipenv package manager which also automatically creates and manages virtual environments.

  4. Install NPM if you don't already have it installed. This link provides instructions on how to install Node.js and NPM

  5. Install backend dependencies:

    A Makefile controls installing dependencies, running the Flask app, and removing build artifacts. While in the directory of your local recordexpungePDX repo, install the backend dependencies by running:

    $ make install
    

    Make will read Pipfile and install listed Python packages into a Pipenv virtualenv.

  6. Install frontend dependencies

    While in the directory of your local recordexpungePDX repo, enter into your command line and run:

  $ cd src/frontend

  $ npm install

Running Components

Backend

Running Backend Development Server

While in the directory of your local repo, run:

$ make run

Doing so runs the Flask app inside a Pipenv virtualenv (the Flask app will also install dependencies as part of this process). On success, a development server for the backend should be started on http://localhost:5000. To check this, navigate to http://localhost:5000/hello. If everything worked correctly, your browser should display the text Hello, world!.

Cleaning

While in the directory of your local repo, run:

$ make clean

in order to remove build artifacts.

Frontend

Running Frontend Development Server

While in your recordexpungePDX, directory, enter into your command line and run:

  $ cd /src/frontend

  $ npm start

If successful, the above should start a development server that can be viewed at http://localhost:3000/.

Testing

Currently using pytest for testing.
Run all tests with the following command:

$ make test

Project Layout

.flaskenv: Environment variables read by flask command-line interface via python-dotenv

Makefile: GNU Makefile controlling installing dependencies and running the application

Pipfile: Pipenv file listing project dependencies

config: Project configuration files

doc: Developer-generated documentation

settings.py: python-dotenv configuration file

src: Source dir

src/backend/expungeservice/app.py: Flask application `

Contributing

  1. Fork the repo on GitHub
  2. Clone the project to your own machine. Replacing YOUR-USERNAME with your github username.
 $ git clone https://github.com/YOUR-USERNAME/recordexpungPDX.git
  1. cd into recordexpungPDX
 $ cd recordexpungPDX
  1. Configure upstream to sync with your fork
 $ git remote add upstream https://github.com/CodeForPortland/recordexpungPDX.git
  1. Create a branch to work on. Replacing BRANCH_NAME with a descriptive name of the work planned such as update_contributing_doc
  $ git checkout -b BRANCH_NAME
  1. Commit changes to your branch (never to master)
  2. Push your work back up to your fork
  $ git push
  • NOTE: The first time you do git push on your branch it will error with:
 fatal: The current branch BRANCH_NAME has no upstream branch.
 To push the current branch and set the remote as upstream, use

     git push --set-upstream origin BRANCH_NAME
  • Copy the output and run it. Then afterwords simply push more commits by running git push.
  1. Submit a Pull request
  • NOTE: For future contributions be sure to sync master with upstream
  $ git checkout master
  $ git pull upstream master
  $ git checkout -b BRANCH_NAME

License

TODO: Add license