/adopt-a-hydrant

A Ruby on Rails application that allows citizens to "adopt" civic infrastructure, such as fire hydrants.

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Adopt-a-Hydrant (Twin Cities)

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

For original documentation, see the this Adopt-a-Hydrant Github page.

Have an Issue, Comment, Feature, Suggestion?

Use the Issue Queue.

Installation and Setup

Install locally

These instructions are for Mac.

  1. Install RVM. This is needed because Mac comes with Ruby 1.8 and you'll need 1.9.
  2. Setup a Postgres database (instructions?)
  3. If you have credentials for your Postgres, update config/database.yml as needed.
  4. Install gems: bundle install
  5. Setup database: bundle exec rake db:create; bundle exec rake db:schema:load
  6. Seed the data: bundle exec rake db:seed
  7. Run the server: rails server

Deploying to Heroku

  1. Create a heroku app (change app name as needed): heroku apps:create otc-adoptahydrant
  2. Set up a DB: heroku addons:add heroku-postgresql
  3. Push the code and deply the application: git push heroku master
  4. Set up the db: heroku run rake db:create; heroku run rake db:schema:load
  5. Seed the data: heroku run rake db:seed
  6. Go to application: http://otc-adoptahydrant.herokuapp.com

Rails Admin

The data seeding (see below) will create an admin user. Make sure to log into the application with the default credentials:

accounts@opentwincities.org
CHANGE.ME

And CHANGE THE PASSWORD. Do note that this may not be the best way to make a new admin user, so suggestions are welcome.

The admin dashboard is located at /admin on your server.

Development

Javascript Development

Still a work in progress.

  • Configuration values should go in: app/assets/javascripts/main.conf.js.erb
  • Main application logic in: app/assets/javascripts/main.js