Skip to content

OpenPolice empowers people to prepare, file, and track police misconduct complaints. By allowing users to publish reports online, we aim to establish an independent and transparent repository of police activity in the U.S.

Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

FlexYourRights/OpenPolice

Laravel SurvLoop License: GPL v3

Table of Contents

About

OpenPolice is an open-source, open data web app empowering citizens to prepare, file, and track reports of police conduct. The site helps users submit complaints or commendations to appropriate police oversight agencies. By allowing users to publish reports online, we aim to establish better public transparency and oversight of police activity in the U.S. OpenPolice extends SurvLoop, which runs atop Laravel.

OpenPolice.org

It is currently in continued, heavy development, with the pilot program rolling now in early 2019. I plan to provide more documentation in the coming weeks. Thank you for your interest and patience! This software began as an internal tool to design our database, then prototype survey generation. Then it was adapted to the Laravel framework, and has continued to grow towards a content-management system for data-focused websites.

The upcoming OpenPolice web app can be tested out here, feedback welcome via the end of the beta demo submission process:
/file-your-police-complaint
The resulting database designed using the engine, as well as the branching tree which specifies the user's experience: /db/OP
/tree/complaint
Among other methods, the resulting data can also be provided as XML included an automatically generated schema, eg.
/complaint-xml-schema
/complaint-xml-example
/complaint-xml-all

Requirements

Getting Started

Installing OpenPolice

Full install instructions also describe how to set up a development environment using VirutalBox, Vargrant, and Laravel's Homestead.

Install Laravel Using Composer

$ composer create-project laravel/laravel openpolice "7.6.*"
$ cd openpolice

Edit the environment file to connect the default MYSQL database:

$ nano .env
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Next, install Laravel's out-of-the-box user authentication tools, and push the vendor file copies where they need to be:

$ composer require laravel/ui
$ php artisan ui vue --auth
$ echo "0" | php artisan vendor:publish --tag=laravel-notifications

Install FlexYourRights/OpenPolice

From your Laravel installation's root directory, update composer.json to require and easily reference OpenPolice:

$ nano composer.json
...
"require": {
    ...
    "flexyourrights/openpolice": "^0.2.18",
    "rockhopsoft/survloop": "^0.2.18",
    ...
},
...
"autoload": {
    ...
    "psr-4": {
        ...
        "OpenPolice\\": "vendor/flexyourrights/openpolice/src/",
        "SurvLoop\\": "vendor/rockhopsoft/survloop/src/",
    }
    ...
}, ...

After saving the file, run the update to download OpenPolice, and any missing dependencies.

$ composer update

Add the package to your application service providers in config/app.php.

$ nano config/app.php
...
'providers' => [
    ...
    OpenPolice\OpenPoliceServiceProvider::class,
    SurvLoop\SurvLoopServiceProvider::class,
    Intervention\Image\ImageServiceProvider::class,
    ...
],
...
'aliases' => [
    ...
    'OpenPolice' => 'FlexYourRights\OpenPolice\OpenPoliceFacade',
    'SurvLoop' => 'RockHopSoft\SurvLoop\SurvLoopFacade',
    'Image' => Intervention\Image\Facades\Image::class,
    ...
], ...

Swap out the OpenPolice user model in config/auth.php.

$ nano config/auth.php
...
'model' => App\Models\User::class,
...

Update composer, publish the package migrations, etc...

$ echo "0" | php artisan vendor:publish --force
$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravelRecent"
$ cd ~/homestead
$ vagrant up
$ vagrant ssh
$ cd code/openpolice
$ php artisan migrate
$ composer dump-autoload
$ php artisan db:seed --class=OpenPoliceSLSeeder
$ php artisan db:seed --class=OpenPoliceSeeder
$ php artisan db:seed --class=OpenPoliceDeptSeeder
$ php artisan db:seed --class=ZipCodeSeeder
$ php artisan optimize:clear

For now, to apply database design changes to the same installation you are working in, depending on your server, you might also need something like this...

$ chown -R www-data:33 app/Models
$ chown -R www-data:33 database

You might need to re-run some things outside the virtual box too, e.g.

$ exit
$ cd ~/homestead/code/openpolice
$ php artisan optimize:clear
$ composer dump-autoload

Initialize OpenPolice Installation

Then browsing to the home page should prompt you to create the first admin user account:

http://openpolice.local

If everything looks janky, then manually load the style sheets, etc:

http://openpolice.local/css-reload

After logging in as an admin, this link rebuilds many supporting files:

http://openpolice.local/dashboard/settings?refresh=2

Documentation

Once installed, documentation of this system's database design can be found at /dashboard/db/all . This system's user experience design for data entry can be found at /dashboard/tree/map?all=1&alt=1 or publicly visible links like those above.

Better documentation is juuust beginning to be created...

openpolice.org/code-package-files-folders-and-classes

More on the SurvLoop level is also starting here: https://survloop.org/package-files-folders-classes.

Roadmap

Here's the TODO list for the next release (1.0). It's my first time building on Laravel, or GitHub. So sorry.

  • Correct all issues needed for minimum viable product, and launch Open Police Complaints.
  • Integrate options for MFA using Laravel-compatible package.
  • Code commenting, learning and adopting more community norms.
  • Add decent levels of unit testing. Hopefully improve the organization of objects/classes.

Change Logs

Contribution Guidelines

Please help educate me on best practices for sharing code in this community. Please report any issue you find in the issues page.

Reporting a Security Vulnerability

We want to ensure that Open Police Complaints is a secure HTTP open data platform for everyone. If you've discovered a security vulnerability in OpenPolice.org, we appreciate your help in disclosing it to us in a responsible manner.

Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern, please email us at rockhoppers at runbox.com. We'll work with you to make sure that we understand the scope of the issue, and that we fully address your concern. We consider correspondence sent to rockhoppers at runbox.com our highest priority, and work to address any issues that arise as quickly as possible.

After a security vulnerability has been corrected, a release will be deployed as soon as possible.

About

OpenPolice empowers people to prepare, file, and track police misconduct complaints. By allowing users to publish reports online, we aim to establish an independent and transparent repository of police activity in the U.S.

Topics

Resources

License

You can’t perform that action at this time.