NITDgpOS / cat-forum

A forum for questions related to CAT exam
http://catforum.mntc.in/
MIT License
7 stars 11 forks source link
cms forum ruby ruby-on-rails

Build Status Code Climate Test Coverage Coverage Status

CAT FORUM

CAT forum is the content management system of MNTC's CAT Forum, a web forum for CAT preparations. We use heroku for deployment.

It is written in Ruby on Rails and uses Bootstrap for UI design. We use haml as our HTML templating engine. Some legacy templates are written in simple HTML (PR please!). Please use HAML while writing template code. You can learn HAML from the HAML Tutorial or HAML documentation. Some key features of CAT-Forum include:

!! Important !!

We have recently changed our default branch to master which was github_master previously. Please update your repo to reflect the same. All stable changes will be merged to the master henceforth.

Prerequisites

Ruby

You can use any Ruby managers for Ruby management. We use RVM (https://rvm.io/). Install rvm along with Ruby using these command

Database

We use PostgreSQL both in production and development. Please install the PostgreSQL dev package needed by the pg gem

Image uploads

We use cloudinary as a cloud storage for images. Signup for a cloudinary account so that you can get the cloud name, api key and secret. We use carrierwave to manage uploads to cloudinary.

DEPLOYMENT

Running your local instance

$ cd cat-forum
# install gems
$ bundle install
# setup the database
$ rake db:setup
# start rails server
$ rails s

Go to localhost:3000 in your broswer. Congratulations! Now you are running on rails.

Using database migrations

rake db:setup creates the development and test database using rake db:create, populates the database using the schema.rb file and seeds the data using rake db:seed. When a new migration is introduced you don't need to run rake db:setup again, instead run rake db:migrate to run the migrations and update the database schema.

Testing

Run tests using the command rspec or bundle exec rspec. We are using Rspec as our testing framework. Writing good tests ensure that all new features introduced don't break previous ones. Please, write tests to explain the change you are suggesting.

Ruby code analyzing using Rubocop

We use Rubocop for code analyzing and lint-checking for Ruby. It follows the Ruby Style Guide. Cleaner code is always easier to read and handle. Please run rubocop before submitting any code for lint errors. You can correct them using Ruby Style Guide. The travis build will fail if there are any lint errors.

Contributing

We welcome contributions, and are especially interested in welcoming first time contributors. Read more about how to contribute in our Contribution Guidelines.

License

CAT-Forum is is available as open source under the terms of the MIT License.