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.
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.
https://spooky-werewolf-89206.herokuapp.com/api/v1/crime_states/6/cities
ย
api/v1/crime_years
Returns JSON of national crimes and crime rates from1994-2013
. This does accept paramsapi/v1/crime_years?year="YEAR_HERE"
, which will only return reports for years after and including the provided yearapi/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 yearapi/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 beviolent_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 beviolent_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 Cityapi/v1/crime_states/:state_id/most_dangerous_cities
Same as aboveapi/v1/most_dangerous_cities
, but only for cities the belong to the provided state. Optional params included as wellapi/v1/crime_states/:state_id/safest_cities
Same as aboveapi/v1/safest_cities
, but only for cities the belong to the provided state. Optional params included as wellapi/v1/avg_weekly_reports
Econmonic Reports for all states, recorded in three increments atSept 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 stateapi/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