Coder Social home page Coder Social logo

city-finder's Introduction

CityFinder

Crime and Economic Data Visualization for National, States, and Cities

A brief description of your project, what it is used for and how does life get awesome when someone starts to use it.

Installing / Getting started

To get the app running....

git clone https://github.com/wratterman/city-finder.git
cd city_finder
bundle
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
rails s

The app is separated out in a way that very little is being passed through the controllers to the views directly, but rather being hit with internal api requests.

Features

Backend

Source Data

Heroku URL (Example for API Endpoints)

https://spooky-werewolf-89206.herokuapp.com/api/v1/crime_states/6/cities

Endpoints

ย 

  • api/v1/crime_years Returns JSON of national crimes and crime rates from 1994-2013. This does accept params api/v1/crime_years?year="YEAR_HERE", which will only return reports for years after and including the provided year
  • api/v1/crime_years/:year Return a JSON of a specific year. Additionally, All State Crime data is based on 2013, or the last crime year available. This endpoint is in effect 'National Average' for given year
  • api/v1/most_dangerous_cities Returns a JSON of 20 cities with the highest Violent Crime Rate, by default, with a population > 100000. Optional Params are ?crime="CRIME"$limit="LIMIT" where crime can be violent_crime, murder, rape, robbery, aggrevated_assault, property_crime, burglary, larceny_theft, motor_vehicle_theft. This will sort the cities by the provided crime You can also control the amount of cities you get back from the url with limit.
  • api/v1/safest_cities Returns a JSON of 20 cities with the lowest Violent Crime Rate, by default, with a population > 100000. Optional Params are ?crime="CRIME"$limit="LIMIT" where crime can be violent_crime, murder, rape, robbery, aggrevated_assault, property_crime, burglary, larceny_theft, motor_vehicle_theft. This will sort the cities by the provided crime You can also control the amount of cities you get back from the url with limit.
  • api/v1/crime_states Returns a JSON of all states will all their cities. Don't hit, too big.
  • api/v1/crime_states/:state_id/cities Returns a JSON of State with an array of all the cities that belong to that state.
  • api/v1/crime_states/:state_id/cities/:city_id Returns a JSON of a specific City
  • api/v1/crime_states/:state_id/most_dangerous_cities Same as above api/v1/most_dangerous_cities, but only for cities the belong to the provided state. Optional params included as well
  • api/v1/crime_states/:state_id/safest_cities Same as above api/v1/safest_cities, but only for cities the belong to the provided state. Optional params included as well
  • api/v1/avg_weekly_reports Econmonic Reports for all states, recorded in three increments at Sept 2016, Aug 2017, Sept 2017. The recorded information is average weekly hours worked, average hourly wages, average weekly earnings during that recording period.
  • api/v1/avg_weekly_reports/:state_id View Economic Reports only associated with the provided state
  • api/v1/:state_id/display_reports We don't want to display ALL cities associated with a state in the graphs in our front end, so a lot of times I controlled the amount of of JSONs we were getting back. Display reports quickly returns an array of economic reports for that state, and nothing else. Meant for graphing.
  • api/v1/:state_id/display_cities Cities associated with the provided state, ordered by population size with optional ?limit="DESIRED SIZE". I load 10 by default

Frontend

Graphing Libraries

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.