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:
public_activity
gemdevise
gem and facebook login using omniauth-facebook
pg_search
gem.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.
You can use any Ruby managers for Ruby management. We use RVM (https://rvm.io/). Install rvm along with Ruby using these command
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
Ubuntu users: You may need to enable Run command as a login shell
in Ubuntu's Terminal, under Edit > Profile Preferences > Title and Command. Close the terminal and reopen it. You may also want to run source ~/.rvm/scripts/rvm
to load RVM.
We use PostgreSQL both in production and development. Please install the PostgreSQL dev package needed by the pg
gem
sudo apt-get install postgresql postgresql-contrib libpq-dev
sudo yum install postgresql-server postgresql-contrib postgresql-devel
brew install postgres
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.
rake secret
to generate the secret key, copy the generated key and paste it for devise_key
. Do the same for secret_key_base
. Enter the _cloudname, _apikey and _apisecret that you got from cloudinary in the cloud_name
, cloud_api_key
and cloud_api_secret
fieldsfb_app
and fb_secret
$ 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.
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.
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.
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.
We welcome contributions, and are especially interested in welcoming first time contributors. Read more about how to contribute in our Contribution Guidelines.
CAT-Forum is is available as open source under the terms of the MIT License.