githero.es is a simple web app which lets developers vote for their heroes on GitHub by using their GitHub credentials. It was a weekend project done just before New Years and it surprisingly got featured on The Next Web.
I decided to open-source it in the hope that its helpful as a starting point for someone trying to setup a Rails 3.1 application. Some of the "fancy" tech which has gone into this is:
- PostgreSQL Windowing and Ranking
- GitHub OAuth
You can read more about the windowing and ranking here.
Setup PostgreSQL: Unfortunately githero.es doesn't work with databases other than Postgres. You will have to set it up yourself using brew or a package manager of your choice.
Setup database.yml: Copy
config/database.ymland make sure you have the database specified in
config/database.ymlcreated in PostgreSQL. By default its
githeroes_developmentfor development and
Setup GitHub keys: You need to setup a GitHub OAuth application and choose whatever name you like. If you're testing out githero.es locally, set the Main URL to be
http://localhost:3000(assuming you're running on port 3000 of course) and set the callback URL to be
http://localhost:3000/heroes/auth/github/callback. For production use, change the host to whatever your production host is but the paths remain the same.
Setup your gem bundle: Run
bundle installfrom the root of the app.
Specs: There are some specs, which you can run using rspec from the root of the app -
rspec spec/(You need to have setup the test database before you can run specs)
5.1 Setting up the test database schema: After you setup the test database in PostgreSQL, you need to run
rake db:test:preparefrom the root of the app to import the current database schema to your test database.
This is a simple app which was hosted on Heroku and I have no plans to continue to support it. If you'd like to use it, you can under the terms of the MIT License.