Git Product home page Git Product logo

adopt-a-hydrant's Introduction

Adopt-a-Hydrant

Build Status Dependency Status Coverage Status

Claim responsibility for shoveling out a fire hydrant after it snows.

Screenshot

Adopt-a-Hydrant

Demo

You can see a running version of the application at http://adopt-a-hydrant.herokuapp.com/.

Installation

This application requires Postgres to be installed

git clone git://github.com/codeforamerica/adopt-a-hydrant.git
cd adopt-a-hydrant
bundle install

bundle exec rake db:create
bundle exec rake db:schema:load

Usage

rails server

Seed Data

bundle exec rake db:seed

Deploying to Heroku

A successful deployment to Heroku requires a few setup steps:

  1. Generate a new secret token:

    rake secret
    
  2. Set the token on Heroku:

    heroku config:set SECRET_TOKEN=the_token_you_generated
    
  3. Precompile your assets

    RAILS_ENV=production bundle exec rake assets:precompile
    
    git add public/assets
    
    git commit -m "vendor compiled assets"
    
  4. Add a production database to config/database.yml

  5. Seed the production db:

    heroku run bundle exec rake db:seed

Keep in mind that the Heroku free Postgres plan only allows up to 10,000 rows, so if your city has more than 10,000 fire hydrants (or other thing to be adopted), you will need to upgrade to the $9/month plan.

Google Analytics

If you have a Google Analytics account you want to use to track visits to your deployment of this app, just set your ID and your domain name as environment variables:

heroku config:set GOOGLE_ANALYTICS_ID=your_id
heroku config:set GOOGLE_ANALYTICS_DOMAIN=your_domain_name

An example ID is UA-12345678-9, and an example domain is adoptahydrant.org.

Contributing

In the spirit of free software, everyone is encouraged to help improve this project.

Here are some ways you can contribute:

  • by using alpha, beta, and prerelease versions
  • by reporting bugs
  • by suggesting new features
  • by translating to a new language
  • by writing or editing documentation
  • by writing specifications
  • by writing code (no patch is too small: fix typos, add comments, clean up inconsistent whitespace)
  • by refactoring code
  • by closing issues
  • by reviewing patches
  • financially

Submitting an Issue

We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and operating system. Ideally, a bug report should include a pull request with failing specs.

Submitting a Pull Request

  1. Fork the repository.
  2. Create a topic branch.
  3. Add specs for your unimplemented feature or bug fix.
  4. Run bundle exec rake test. If your specs pass, return to step 3.
  5. Implement your feature or bug fix.
  6. Run bundle exec rake test. If your specs fail, return to step 5.
  7. Run open coverage/index.html. If your changes are not completely covered by your tests, return to step 3.
  8. Add, commit, and push your changes.
  9. Submit a pull request.

Supported Ruby Version

This library aims to support and is tested against Ruby version 2.3.0.

If something doesn't work on this version, it should be considered a bug.

This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the version above.

If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be personally responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.

Copyright

Copyright (c) 2014 Code for America. See LICENSE for details.

Code for America Tracker

adopt-a-hydrant's People

Contributors

24glinka avatar cmgiven avatar danmelton avatar drkk avatar equiamos avatar jasnow avatar kmacedo avatar max-mapper avatar mick avatar mlevans avatar monfresh avatar ralreegorganon avatar raudabaugh avatar sferik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adopt-a-hydrant's Issues

git clone command listed in README

Used:

 git clone [email protected]:codeforamerica/adopt-a-hydrant.git

Vs.

 git clone git://github.com/codeforamerica/adopt-a-hydrant.git

as listed in the readme. Command listed kept giving a:

 fatal: unable to connect to github.com:
 errno=Operation timed out

Admin-Reminders-Add New - From User field missing

I am installing Adopta for Raleigh, NC as we are using it to adopt bus shelters. In the admin screen under reminders - add new, the from user field is not available yet it is a required field. Maybe I am missing a configuration somewhere.

Also, I'm unclear on what to set the environment variables to for these values. Should users be getting an email confirmation when they sign up? If so, then that is not working for me and probably related to setting these values below. Any advice is appreaciated.

user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: ENV['SENDGRID_DOMAIN'],

You can see our install here: http://adoptashelter.raleighnc.gov

Force SSL (to protect passwords and personal info)

I believe looking at the code and experimenting with packet capture against the demo site that sign-up and login info is being sent in the clear (ie, info including password is being sent across the wire unencrypted)? Is that right?

Ideally, the app it should force connections to HTTPS to avoid this. And it's easy enough to use force_ssl to do this. Okay to do that?

Incorrect Marker Image Display Scenario 1

If Thing X's state is abandoned and a marker icon assigned to represent Thing X is viewed from within StreetView and then subsequently viewed, while MapTypeId.ROADMAP, and User adopts Thing X, then the marker icon assigned to represent Thing X, while MapTypeId.ROADMAP, is non-representative of the adopted state of Thing X.
link
link
link
link

EventMachine 0.12.10 does not work under Windows 7 64-bit/Ruby 1.9.2

While trying to install this project, EventMachine kept kicking back on me. A little googling led me to: http://stackoverflow.com/questions/6927907/ruby-problem-installing-eventmachine-under-windows-7

What I did was to change the Gemfile.lock to "Ruby 1.0.0.beta.4.1" which seems to have solved the problem as far as the install goes. I'm still very new to Rails (and GitHub for that matter), so I don't know if this appropriate for a pull request or an issue.

Application does not work in IE7

Specifically the map does not work. I was not able to debug fully yet, but wanted to get this issue in. There were a number of errors that popped up.

I don't think it is an issue with Google Maps as it should support IE7 still.

More, real information coming soon.

More Hydrants on map by default

I would like to show more Hydrants on the map on my homepage. Now it shows 10 hydrants and as you zoom/change area more drop in. Where can I edit this? Thanks

Text alerts

More of a milestone suggestion.

Let's say a user passes by a fire hydrant and sees that it's mostly covered in snow, for example. They don't have time to shovel it themselves, so they log in to the site. From there, they can mark the hydrant as needing management, and the hydrant's owner (adopter?) will receive a text telling them the hydrant is snowed in/in need of repair.
Alerts would be limited to 1/hr, and maybe the hydrant owner could downvote/report the person who alerted them if the issue didn't actually occur. People with a certain amount of false alerts would have to wait to get their alerting privileges back.

I'd like to be able to make some contributions to this hopefully. Thoughts?

Unable to search on an address

Chrome developers tools tell me 404 error, not found. Check models/address.rb MultiGeocoder appears to be using GoogleGeocoder but that has been deprecated. Changing this to GoogleGeocoder3 appears to fix it.

class Address
include Geokit::Geocoders

def self.geocode(address)
GoogleGeocoder3.geocode(address).ll.split(',').map{|s| s.to_f}
end
end

Automatic Reminders

This is a feature which I'm trying to implement but don't really have the necessary programming experience/knowledge.

A tie-in to a weather service API such as Forecast.io which is set up in such a way that it can be configured by each municipality separately to automatically remind users to shovel when there is an x percent chance that it will snow y amount at z amount of time before the predicted snowfall. This would make it so that reminders would not have to manually be sent to users by the municipality when snow was predicted.

Seeding to Heroku Fails

very inexperienced at rails.

after deploying looking to see with data. looks like this is the issue
https://stackoverflow.com/questions/23437830/undefined-method-attr-accessible

is there a work around?

instance here: https://adopt-a-vb.herokuapp.com/

➜  vb_storm_data git:(master) ✗ heroku run bundle exec rake db:seed
Running bundle exec rake db:seed on ⬢ adopt-a-vb... up, run.8957 (Hobby)
[SKYLIGHT] [0.10.6] authentication token required; disabling Skylight agent
  ActiveRecord::SchemaMigration Load (1.0ms)  SELECT "schema_migrations".* FROM "schema_migrations"
rake aborted!
NoMethodError: undefined method `attr_accessible' for #<Class:0x00000006917ac0>
Did you mean?  attr_accessor
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/app/db/seeds.rb:6:in `<class:Thing>'
/app/db/seeds.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:547:in `load_seed'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:251:in `load_seed'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:183:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

Facilitation of Data Intake

I think the collection of data and subsequent injection into a given data store should be facilitated through the inclusion of an additional toolset within the application.

Create an AdoptA Rails Engine - or something like that

Like many brigades, Open Twin Cities has deployed a version or two of Adopt-A. One of our more active projects at the moment is Adopt-A-Tree, which is a fork of this Adopt-A-Hydrant repo. Not surprisingly, we had to make some minor changes to our fork (trees instead of hydrants, Minneapolis instead of Boston). We've also made some more significant changes to the UI and data models based on the needs of our partner organization. Predictably, we're now in a situation in which it is difficult for our fork to pull in commits from this repo, and it is difficult for us to send merge requests for code that might be useful to all adopt-a users. Difficult enough, in fact, that we haven't rebased in 6 months. I'm guessing we're not the only people in this situation.

Given the nature of Adopt-A, and all the potential slightly (or significantly) different deployments it might have, it might be a good idea to create an AdoptA Rails Engine. This way, updates to the AdoptA platform could be pulled in by deployed AdoptA's by simply updating the engine, and there would be a much clearer path for coders to contribute back to the main repo. This would also make it much easier for groups deploying their own Adopt-A to manage their own bespoke code. Plus, it would get around GitHub's limit on how many forks of a repo a single person/org can have (1), which is problematic if your group wants to do Adopt-A-Hydrant, Adopt-A-Drain, Adopt-A-Tree, Adopt-A-Siren, Adopt-A-whateverEverythingCanBeAdopted.

Scroll to Zoom In & Out

Just curious is there a specific reason that zoom in and out doesn't work with the scroll bar?
I think it might be a good addition.

Incorrect Marker Image Display Scenario 2

Given an instance, A, where User A is signed in, & instance, B, where User A is also signed in. If User A abandons/adopts Hydrant X within instance A, the marker image representing Hydrant X is non-representative of the abandoned/adopted state of Hydrant X within instance B.
link

Bundle Install Not Working on Windows

When following the directions for installing the bundles and code, lots of problems arose concerning bundle installation. Had to research ways of installing the bundles separately. Still cannot get all the bundles installed specifically the puma bundle.

It was a huge problem for me on Windows OS but others have reported long processes to get all the bundles on other systems.

Can't mass-assign protected attributes: city_id, lng, lat

I was just installing adopt-a-hydrant locally and came across a mass assignment issue. (Keep in mind that I'm brand new to Rails!)

I ran bundle exec rake db:seed and got the following error: "Can't mass-assign protected attributes: city_id, lng, lat."

So I went into the Thing model (app/models/thing.rb) and changed line 3 to attr_accessible :name, :city_id, :lng, :lat. The seed process now works, and the application is loading the seed data correctly.

Is this a temporary fix or the correct solution?

The project description in github has the wrong url

The project description links to adopt-a-hydrant.heroku.com instead of adopt-a-hydrant.herokuapp.com. It redirects properly, but (at least in chrome) it presents a TLS mismatch warning. The security certificate is registered for *.herokuapp.com.

Remove secret_token.rb now that the app is using secrets.yml

When the app was upgraded to Rails 4.1, it seems like secret_token.rb was left behind by mistake. It should probably be removed.

Also, secrets.yml now points to ENV['SECRET_KEY_BASE'] for production, but before the upgrade to Rails 4.1, the env var was called SECRET_TOKEN. This will cause issues during Heroku deployment. The env var should either stay the same, or a note should be added to the README.

Thoughts?

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.