fairmondo/fairmondo

View on GitHub
README.rdoc

Summary

Maintainability
Test Coverage
= Welcome to the Fairmondo repository

{<img alt='Stories in Ready' src='https://badge.waffle.io/fairmondo/fairmondo.png?label=ready&title=Ready' />}[https://waffle.io/fairmondo/fairmondo] {<img src="https://travis-ci.org/fairmondo/fairmondo.svg?branch=develop" alt="Build Status" />}[https://travis-ci.org/fairmondo/fairmondo] {<img src="https://coveralls.io/repos/fairmondo/fairmondo/badge.svg?branch=develop" alt="Coverage Status" />}[https://coveralls.io/r/fairmondo/fairmondo?branch=develop] {<img src="https://codeclimate.com/github/fairmondo/fairmondo.png" />}[https://codeclimate.com/github/fairmondo/fairmondo] {<img src="https://gemnasium.com/fairmondo/fairmondo.svg" alt="Dependency Status" />}[https://gemnasium.com/fairmondo/fairmondo] {<img src="http://inch-ci.org/github/fairmondo/fairmondo.png" alt="Inline docs" />}[http://inch-ci.org/github/fairmondo/fairmondo]
http://info.fairmondo.de/wp-content/uploads/2013/03/Fairmondo_Logo_web-rgb.png

Fairmondo is a free market place in the hand of the users.

Read more about it at: http://www.fairmondo.de

Please help us out by contributing code.


== Getting started

=== Installing Ruby and Ruby on Rails

If you are not sure how to <em>install Ruby and the Ruby on Rails framework</em> on your computer, have a look at Michael Hartl's excellent {tutorial}[http://rails-4-0.railstutorial.org/book/beginning#sec-rubygems] on the subject.

Make sure you install <em>2.2.2</em>. and not <em>ruby 1.9.3-p392</em>.

=== Fairmondo Project Setup

* Set up a local git repository and switch to branch "develop"
    git clone git@github.com:fairmondo/fairmondo.git
    cd fairmondo/
    git checkout develop

* Install required gems
    bundle install

* Set up local version of secrets.yml
    cp config/secrets.yml.example config/secrets.yml

* {set up Postgres for development environment}[https://github.com/fairmondo/fairmondo/wiki/Postgres-Setup]

* set up database, load schema and seed
    rake db:create db:schema:load db:seed

* if you would like to test the mailer, please open the copied file and update it according to your testing mail server

* you may like to adopt the config/database.yml according to your wishes

* to use the recaptcha you have to add your keys into your secrets.yml file. You can get the keys at https://www.google.com/recaptcha/admin/list

* start rails and have fun
    rails server

=== Known Issues
* Could not find pg-0.15.1 in any of the sources

  If you have an error like
   ...
   rake aborted!
   Could not find pg-0.15.1 in any of the sources
   ...

  Install the Postgres Library:

   sudo apt-get install libpq-dev

  Run Bundler
   bundle install

* (Mac) Invalid gemspec [...ZenTest-4.9.1.gemspec]

  If bundler constantly complains about an invalid ZenTest gemspec, run the following:

   gem uninstall ZenTest
   rm [path to the ZenTest-4.9.1.gemspec it gave you in the error message]
   gem update --system
   bundle

* (Mac) libv8 issues with Mac osx catalina

   brew install v8@3.15
   bundle config build.libv8 --with-system-v8
   bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
   bundle install

=== Testing

To run the tests, type

  rake test

NOTE: The tests need elasticsearch to run through (see below)

If you update your branch from before, you may have to migrate the test database:

  RAILS_ENV=test rake db:migrate

{Click here}[https://github.com/fairmondo/fairmondo/wiki/Testing-and-BDD] to read more about testing in our wiki.

The testsuite offers an option to stop at the first failing test and rescue in a pry console. To activate this use:

  RESCUE=1 rake test

We also have some more tests built in:
* Rails Best Practices (`rails_best_practices`)
* Brakeman (`brakeman`)
* Rubocop  (`rubocop`)

=== Workflow

If you want to help out with programming new features or fixing bugs, please consider the following guidelines:

* If you do not have direct access to our github repository, you can fork it, make changes on your forked repo, and then submit a pull request

* Branch management: "master" is the currently deployed version. New features are developed on the branch "develop" or feature branches that branch from develop. Bugfixes are currently done on "develop". Please send merge requests to the appropriate branch (develop).

* If you have access to our repository, please create a new git branch before making changes when coding a larger feature
    git checkout -b feature-[featurename]

* We use BDD (Behavior Driven Development). Please read our {wiki page on the subject}[https://github.com/fairmondo/fairmondo/wiki/Testing-and-BDD].

* When finished with a task:
    git add [corresponding files OR simply --all for everything]
    git commit -m "[description]"
    git push

* If you created a new branch for a larger feature, you need to merge the changes after you are finished:
    git checkout develop
    git merge [featurename] master
    [you might need to resolve merge conflicts]
    git commit
    git push

Hint: When a vim window opened after you typed "git commit" without a commit message, you can save the default message by simply typing ":wq" and pressing enter.


=== Run Elasticsearch Server

To make the search available in your local environment you have to install Elasticsearch:

    curl -k -L -o elasticsearch.tar.gz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz
    tar -zxvf elasticsearch.tar.gz
    ./elasticsearch-5.4.0/bin/elasticsearch-plugin install http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-plugin-bundle/5.4.0.0/elasticsearch-plugin-bundle-5.4.0.0-plugin.zip
    ./elasticsearch-5.4.0/bin/elasticsearch

Links for Elasticsearch:
http://www.elasticsearch.org

Plugin we use:
https://github.com/jprante/elasticsearch-plugin-bundle

=== Background Processing with sidekiq
To use our Background processing you have to setup a redis instance locally:

  On Ubuntu/Debian:
    sudo apt-get install redis-server

  For other systems try
    http://redis.io/

Aftwerwards start sidekiq with:

    sidekiq -C config/sidekiq.yml

== Contributing

Share the idea, take part at http://www.fairmondo.de/ and make the world a better place!

Regarding the source, there are two ways to contribute.

1. Report a bug?
   * Just use the github issue tracker.
   * Please tag added bugs with the "bugs" tag

2. Want to help out and join feature development?
   * Have a look at our issue list and work on whatever you like. Mainly look at [Milestone] Backlog [Label] free4all
   * Send us an email at {email@fairmondo.de}[mailto:email@fairmondo.de] and work with us to make the world a better place
   * or make a github account and click on the button called "Fork" in the upper right corner of {our repository}[https://github.com/fairmondo/fairmondo]. Then code a few cool features, commit and push your changes, and submit a "Pull Request" so we can implement your work.