👍🎉 Greetings, contributor! From the #pivorak Ruby usergroup we want to say thank you for joining us on this path to community development. We appreaciate your effort, every change counts! 🎉👍
The following is a set of guidelines for contributing to PivorakWebApp. We've tried our best to ease this process for you, so please read it carefully.
- Code of conduct
- How to setup project
- What should I know before I get started?
- How to report a bug
- How to contribute
- How to contribute during Hacktoberfest
$ git clone https://github.com/pivorakmeetup/pivorak-web-app.git
- Install ruby 2.6.5
$ cd pivorak-web-app
$ rvm install ruby-2.6.5
- Install gems
$ rvm use ruby-2.6.5@pivorak --create
$ bundle
-
Setup database Notice: Before database setup you should install Redis. Look install instructions here:
- for Ubuntu: https://goo.gl/PbG00W
- for MacOS: https://goo.gl/W8xQMJ
Notice: You should have PostgreSQL >= 9.4 To check your version
$ psql --version
$ cp config/database.yml.example config/database.yml
$ rails db:setup
$ rails s
Notice: If during the execution rails db:setup
you get an error messages:
'require': cannot load such file -- bundler (LoadError)
run gem pristine --all
and repeat rails db:setup
.
Step 1: Install Docker and Docker Compose
$ git clone https://github.com/pivorakmeetup/pivorak-web-app.git
$ cd pivorak-web-app
$ cp config/database.yml.example config/database.yml
$ docker-compose build
$ docker-compose run runner bundle install
Notice: How to deal with docker?
Test environment: To run tests, first setup test database
$ docker-compose run -e RAILS_ENV=test runner bundle exec rails db:setup
and then run test suite
$ docker-compose run runner bundle exec rspec
Development environment: To run the app in development, first prepare development database
$ docker-compose run runner bundle exec rails db:setup
and then execute
$ docker-compose up rails
The main and the most up-to-date branch of the project is development
branch.
Please checkout your new branch from development
branch.
And use development
branch for deployment to production.
- We use Ruby on Rails as a framework but with some additional application design layers.
- Model
- View
- Controller
- Service
- Finder
- Policy
Model should containe only data-logic.
- Processing -> to service/interactor.
- Complex queries -> to finders
- Predicates -> to policy.
View should be clean as much as possible. Please, use helpers to avoid call methods with some params at template.
Skinny controller. Only REST. Only 7 allowed actions (index, show, new, create, edit, update, destroy). If you need additional action - extract to new sub-controller
Single responsibility resource action that represents business logic.
Only one public method allowed .call
. Everething else - to private
QueryObject.
Domain predicates store. Knows answers for all questions.
- Go to issue tracker
- Add descriptive title
- Add steps to reproduce with screenshots
- Add label bug
- What happens and what you expected to happen
- Browser if it is UI related issue
-
Detect which issue you want to resolve. Write comment about this and how you supposed to do this.
-
Fork project (if you don't have permissions to push).
-
Prepare your solution step by step:
-
Checkout new branch:
"#{issue_id}-#{add or fix or improve}-#{job-done-description}"
For example:
77-add-payments-feature
-
Write tests
-
Write code
-
Compose descriptive commit message
"##{issue-id} commit message text"
For example:
#77 Add payments feature :tada:
-> you may use emoji -
Push your branch to origin.
-
-
Create merge request into development branch, add reviewers.
-
Thank you!
-
Detect which hacktoberfest issue you want to resolve. Write comment about this and how you supposed to do this.
-
Fork project.
-
Prepare your solution step by step:
-
Checkout new branch:
"#{issue_id}-#{add or fix or improve}-#{job-done-description}"
For example:
77-add-payments-feature
-
Write tests
-
Write code
-
Compose descriptive commit message
"##{issue-id} commit message text"
For example:
#77 Add payments feature :tada:
-> you may use emoji -
Push your branch to origin.
-
-
Create merge request into development branch, add reviewers.
-
Thank you for joining us during the Hacktoberfest! 🎉 🎉 🎉