This readme covers the basic setup of the FightClub application. More documentation is available in our wiki.
As of the time of writing, a live demo is hosted on Heroku.
- Ruby 2.2.x
- PostgreSQL (tested on version 9.4.5)
- API keys for the web services that we use:
Clone the project and go into the clone
$ git clone https://github.com/ase-15/fightclub.git $ cd fightclub
Install gem dependencies
$ bundle install
Configure your database for access via UNIX socket or enter your credentials in the
Configure your API keys for external services
config/application.ymlfile and enter the following into it:
# Git-ignored file containing API keys that are meant to be SECRET! # Only used in local development configuration; Heroku and Travis are configured through environment variables. # All values in this file populate the ENV hash. # Cloudinary CLOUDINARY_URL: "cloudinary://" # PayPal PAYPAL_CLIENT_ID: "" PAYPAL_CLIENT_SECRET: "" PAYPAL_MODE: "sandbox" # Facebook FACEBOOK_APP_ID: "" FACEBOOK_SECRET: "" # Pushbullet PUSHBULLET_TOKEN: "" PUSHBULLET_BASE_URL: "http://localhost:3000"
Complete each field with your personal API key
Create the database. This will delete and recreate the fightclub_development database according to the latest schema.
$ rake db:drop db:create db:schema:load
(Optional) Populate the database with test data.
$ rake db:seed
You can now start the web server
$ rails s
We use the git flow branching strategy. Installing the git flow plugin is optional but guarantees correct usage.
We use a number of git hooks to ensure proper code quality. You need to install them before coding!
$ overcommit --install
Our test framework is RSpec. Additionnaly, we are using capybara and cucumber. We use factory_girl and faker to populate the database with fake data.
Overcommit will automatically run the RSpec tests before each push. You still need to manually run the Cucumber tests however.
All tests can be run by running the following command:
$ bundle exec rspec spec $ bundle exec cucumber
We have a Travis-CI instance running our tests after each commit. It is publically accessible.