This is the repository for the Green Commons project.
Note: Pushing to
master will auto-deploy to production.
We follow thoughtbot's git guide to determine the development workflow.
Setup (OS X)
Setting up the repository
Clone the repo and run the setup script:
git clone email@example.com:greencommons/commons.git cd commons ./bin/setup
To start the app locally run the command (make sure postgres is running):
foreman start -f Procfile.dev
You should be able to visit http://localhost:3000/ within your browser and see the Green Commons homepage.
You will need to run the following while you have foreman running in another terminal window, otherwise you will get ElasticSearch errors:
You can optionally use
to refresh the page automatically
when you've saved changes to a file.
bundle exec guard
and be sure to install the appropriate browser extension
listed in the gem's
Using the ElasticSearch Index
Anything added, created, or deleted in the
Resource model will automatically be indexed in ElasticSearch. If you'd like to recreate the index for any reason, you can use the following rake task:
bundle exec rake elasticsearch:reset_resource_index
This will delete the index and re-import all the records in the resources table.
bundle exec rake
We should update gems regularly for security and bugfix reasons.
We use a tool called bummr to update the dependencies for us.
It will update each gem individually, then run the tests and if any fail,
git bisect to figure out which one is the problem.
Every week or so, run this command:
Adding New Resources to the Database
See ETL.md for more information.
Web API Usage
See API.md for more information.