sfbrigade / sf-crime-data

Search SFPD incidents from SF OpenData with focus on campus safety.
http://sfcrimedata.org
MIT License
26 stars 39 forks source link

SF Crime Data

Pull incident reports from SF Open Data and display results using Mapbox.

Initial Use Case:

Universities and colleges are required by a federal law, the Jeanne Clery Act, to report crime statistics on specific crimes that happened within ~500 feet of anywhere their student population went. The SFPD fields about 2,500 requests per year from universities and colleges for information about those crimes, which take between 20-40 minutes to fulfill... per request, which is about ~156.25 8-hour days. They need to do a radial search around a specific address (or list of addresses), as provided by the universities or colleges.

This application does exactly that. It performs a radial search of variable size around an address provided by the user, and then offers the datapoints (crimes, in this case) for download.

At the moment, the application is 100% browser-based. No servers at all. Just API calls, HTML, CSS, and JavaScript. It's likely that the immediately pending version can stay this way... not necessarily as likely for the "Wouldn't it be cool if..." version.

Vision (initial versions)

Satisfy SFPD crime reporting needs, as well as other interested parties, including watch dog groups, organizations with reporting requirements (like universities), and civic hackers, while ensuring an easily maintainable product.

Vision (bigtime, but specific to the Clery Act)

(Note: that this comes after Vision #1 is complete, so the rest of the README doesn't address this vision.) Create a single place for all universities and colleges in the United States to collect the data for their Clery Act reporting requirements, incorporating data from as many police departments in the country as possible.

Project Needs

Note: this repository takes advantage of ZenHub. If you haven't added it to your Github yet, it's recommended to better understand how issues are prioritized.

Running Codebase Locally

If you want to download the github repository and run the code locally on your Apple machine,

Creating Your Own Test Site

If you want your pull request apporoved, please make a test page so that the group can test your new functionality. You may use any hosting services as your own server, Heroku, or AWS. We prefer using Github Pages. Although it's convinient, github pages will only display when you have your files in a repo named username.github.io and all of your files are in the master branch. This gets a bit tricky.

Follow these directions in order to create test site:

Contributing: Getting Started

Contributing: Working in Github

If you want to contribute to this project please follow these instructions:

Contributing: Running Codebase Locally

If you want to download the github repository and run the code locally on your Apple machine,

Contributing: Promoting a Change to Production

  1. You have worked an issue and resolved it. Great!
  2. It works on your local web server. Great!
  3. Do a regression test to make sure nothing else broke.
  4. Publish your changes to your personal public hosting location like GitHub pages or Firebase.
  5. Post a note on Slack channel #prj-sf-crime-data with your personal public hosting URL and ask the team to test.
    • We need at least one other teammate to approve moving forward.
  6. Submit a pull request.
    • Do not "pretty up" the code. That makes it super difficult to do a code review.
    • Change only the lines that need to change to resolve the Issue.
  7. A team member will review the pull request, do a code review and perform the merge (or advise with any changes needed).

Stack

The following are among the libraries and extensions used:

Bootstrap – "a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development"

jQuery - "The Write Less, Do More, JavaScript Library"

Leaflet – "An open-source JavaScript library for mobile-friendly interactive maps"

Moment.js – "Parse, validate, manipulate, and display dates and times in JavaScript"

noUiSlider – "JavaScript Range Slider"

What's Next?

After speaking with the Crime Data Analysis Unit at the SFPD on 5/6/16 for initial user research, the current prototype satisfies their minimum needs. They plan to direct future inquiring universities and colleges directly to [http://sfcrimedata.org]. Great!

However, the prototype has a few things that could be greatly improved (also listed as issues), which were discovered during initial user testing. Specifically:

Wouldn't It Be Cool If...

When prompted to think about other uses for this web app, the SFPD crime data analysts asked for the following: