This simple application includes Ruby/Rails technology which we use at Flatstack for new REST API projects. Application currently based on Rails 5 stable branch and Ruby 2.5.1
- active_model_serializers - resource serializers
- decent_exposure for DRY controllers
- health_check - health check endpoint
- interactor – encapsulates business logic
- kaminari for pagination
- knock – seamless JWT authentication
- puma as Rails web server
- rack-cors for CORS
- responders - DRY controllers
- rollbar for exception notification
- brakeman - static analysis security vulnerability scanner
- bullet - kill n+1 queries and unused eager loading
- bundler-audit - patch-level verification for gems
- dotenv - load environment variables from
.env
- letter_opener - preview E-Mails in the browser instead of sending
- rails-erd - generate a diagram based on application's AR models
- seedbank - seeds on steroids
- factory bot - create test data
- faker - generate fake data
- rspec api documentation - generate pretty API docs
- rspec - awesome, readable isolation testing
- shoulda matchers - frequently needed Rails and RSpec matchers
active_model_serializer.rb
- setup serializers for REST APIbullet.rb
- setup Bullet to catch up N+1cors.rb
- setup whitelist of domains to allow cross-origin resource sharinghealth_check.rb
- setup Health Check endpointrollbar.rb
- setup Rollbar
bin/setup
- build Docker image and prepare DBbin/server
- to run server locallybin/ci
- runs RSpec tests and quality toolsbin/doc
- generates API documentation
Clone application as new project with original repository named "rails-base-api"
git clone git://github.com/fs/rails-base-api.git --origin rails-base-api [MY-NEW-PROJECT]
Create your new repo on GitHub and push master into it. Make sure master branch is tracking origin repo.
git remote add origin [email protected]:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
git push -u origin master
Run setup script
bin/setup
Make sure all test are green
bin/ci
Do not forget to update this file!
mv doc/README_TEMPLATE.md README.md
# update README.md
git commit -am "Update README.md"