Giter VIP home page Giter VIP logo

glazedgallopers's Introduction

Safe Hippo

By crunching real time crime data, Safe Hippo will SMS you the safest route home.

Team

  • Product Owner: Sam Henderson
  • Scrum Master: Guy Thomas
  • Development Team Members: David Minehan, Bea Subion

Suggested improvements

  • Configure Twilio to receive SMS' containing origin & destination address, and to then reply with the safest route between their current location and their desination address.
  • Assess more 'dummy routes' than the 3 Google Maps Directions gives us. New dummy routes could be suggested by specifying a random waypoint between origin and destination.
  • Connect the back end to a React Native Mobile App.
  • Extend to more cities e.g. Chicago has a crime statistics API (https://data.cityofchicago.org/api/views/ijzp-q8t2/rows.json?accessType=DOWNLOAD). Remember, the DB queries need to be in terms of distance on the Earth rather than latitude degrees because a 1 degree of latitude isn't the same Earth surface distance on the equator as it is at the poles.
  • Validation on the client forms to reject locations outside of SF.

How Safe Hippo Works

This section explains what happens 'under the hood' when a user interacts with Safe Hippo. When you go to www.safehippo.com, enter your destination, mobile number and click 'Go'. The following will occur:

  • HTML5 geolocater determines your current latitude & longitude
  • A GET request is sent to /safestRoute with the origin, destination & mobile in the params
  • We check the Redis DB if that particular route has been requested before. If it has, we return the safest route straight away.
  • If that route hasn't been requested before, we call the getSafestRoute method which does the following:
    • We query the Google Directions API which provides 3 potential routes to get from A to B.
    • We space the waypoints (lat,long pairs along a given route) out evenly using a helper function called 'david', because David wrote the algorithm. He's a genius.
    • Our database contains every recoreded crime that occured in San Francisco in 2015 with it's latitude and longitude. We populated the DB with data from the SF OpenData API at this endpoint: https://data.sfgov.org/resource/ritf-b9ki.json. For each waypoint on a given route, we query the db to see how many crimes happen within 80 metres of that waypoint. Each waypoint has a crime score equal to how many crimes happened near that point. We then sum up how many crimes happened on each route - each route's score is the sum of all the waypoint's crime score on that route. We then return the route with the lowest crime score. This will be the route where the fewest recorded crimes have occured over the past year.
  • We then SMS the provided mobile number the Google Maps URL of the safest route using Twilio's API
  • We return an object back to the client which contains all the waypoints of the safest route as well as the Google Maps URL.

Contribution Guide

  • Fork this repo.
  • Clone down your forked version down to your local machine
git clone https://github.com/<INSERT YOUR GITHUB USERNAME HERE>/giddygoats.git
git remote add upstream https://github.com/giddygoats/giddygoats.git
  • Commit work often and provide informative commit messages
git add .
git commit -m <INSERT INFORMATIVE COMMIT MESSAGE HERE>
  • Push to your forked repo (by default, the remote name is 'origin').
git push origin master
  • Each developer on the team has a branch titled that developers name. As of 31st Oct 2016, Guy Thomas administers the account. Email [email protected] and ask him to create a branch for you.

  • Submit a pull request to your branch. After a code review, your new feature can be merged into the main repo!

glazedgallopers's People

Contributors

9yoi avatar amadk avatar beacoding avatar guyathomas avatar hackreactor-students avatar shenders13 avatar spiritphyz avatar terrapanda avatar

Watchers

 avatar  avatar

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.