Skip to content

darren987469/membership-system

Repository files navigation

Membership System

Build Status Maintainability Coverage Status

Use cases and system design information is at system spec

API document

Install

bundle                # install gems
rails db:setup        # create db and seed
rails s               # start server in http://localhost:300

# postgres db
brew install postgresql
brew services start postgresql

Use Docker to build environment

docker-compose build
docker-compose up

docker-compose run web rake db:setup

docker-compose down

# after change Gemfile or Compose file, rebuild it
docker-compose up --build
docker-compose run web bundle install # sync changes to Gemfile.lock

# shell of containers
docker-compose run web sh

Reference: https://docs.docker.com/compose/rails

Development

Install git hook

To ensure code style and quality, we use rubocop to check style and rspec to test. Install overcommit to install git hook for you.

overcommit --install  # add git hook tool
overcommit --sign     # apply git hook. execute it after changing .overcommit.yml

Before committing, git hook run rubocop. Before pushing, git hook run rspec. Setting file is at .overcommit.yml

Ignore git hook: SKIP=RuboCop git commit

Development flow

Basically follow git flow.

  1. Create a new branch to solve an issue in issues page.
  2. Open a Pull Request. Make sure CI test pass.
  3. After reviewing and approving, merge the Pull Request.

Testing

bundle exec rake

Deploy

heroku login

git remote add heroku https://git.heroku.com/membership-system.git
git push heroku master

heroku open

Reference: https://devcenter.heroku.com/articles/getting-started-with-rails5