Before you start working on a task, make sure it's assigned to you on the issue tracker. You either assign it to yourself, or the project lead assigns it to you.
The following steps will help you prepare your environment and get the project running on your local machine. However, if you just want to work on the front-end part of Manshar, you can reuse the existing dev backend api-dev.manshar.com
and not have to install the whole backend and its dependencies including the database. Please refer to the wiki page Contributing to Web Client for more details.
Install Homebrew (OS X)
Homebrew is the best package manager out there for OS X.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
We recommend you to use one of the Ruby version control. We mainly use Ruby 2.0.
brew install openssl
brew install ruby-build
brew install rbenv # Follow the instructions after installing rbenv
brew install rbenv-gemset
brew install redis # Make sure to also run redis afterwards.
rbenv install 2.0.0-p247
[Install Postgres, NodeJS, and PhantomJS] (https://github.com/manshar/manshar/wiki/Installing-Postgres,-NodeJS,-and-PhantomJS)
Fork the repository to your account then clone it to your machine
git clone https://github.com/USERNAME/manshar.git manshar && cd manshar
cp backend/.env.sample backend/.env
cp backend/config/database.yml.sample backend/config/database.yml
# Installing backend dependencies.
cd backend
gem install bundler
bundle install
# Installing web-client dependencies.
cd web-client
sudo gem install sass
npm install
bower install
# Create postgres role and leave the password empty when prompted.
createuser -P -s -e postgres
cd backend
bundle exec rake db:create
bundle exec rake db:migrate
# Optional: Seed the Database with some test data.
bundle exec rake db:seed
# Running the backend.
cd backend
rails s
# Running the web-client.
cd web-client
gulp
# Backend Tests.
cd backend
rspec spec
# TODO(mkhatib): Document running tests and coverage after moving them to
the new gulp-task flow.
<!--
# Web-client tests.
cd web-client
# This will also show you the test coverage.
grunt test
# If you want to dive deeper into the code coverage to see what is not covered.
# You can run the following command and go to manshar/web-client/coverage/
# Folder and copy paste the folder name after the localhost:5555 that opened.
# You'll end up with something like: localhost:5555/PhantomJS 1.9.2 (Mac OS X)
grunt coverage
-->
We recommend you to add manshar/manshar
as upstream
git remote add upstream https://github.com/manshar/manshar.git
git fetch upstream
git merge upstream/master
Before that, *try* to have your repository synced.
Let's say you want to contribute to XYZ feature, for your local repository create a branch for this feature
# you are on master
git branch xyz
git checkout xyz
After implementing the feature and its test cases, push it to your github account
If your edits touch the web-client code, make sure to also run gulp
to build the web-client. And make sure
it builds successfully without errors or jshints warnings (try to fix jshints warnings).
git add .
git commit -m "feature XYZ"
git push origin xyz
Then open a pull request so we get notified for the feature you've implemented.