A Rails template for generating a clean, new Rails (API) project with Docker, docker-compose, rspec and some nice defaults.
- This is very opinionated.
- Rails >= 5.0.0
- Ruby 2.5.0
--api
only
rails new my_unicorn \
-d postgresql \
--api \
-m https://raw.githubusercontent.com/rmcfadzean/rails-docker-template/master/template.rb
docker-compose run web rails db:create
docker-compose run web rspec
TODO
- Testing is done with Rspec & Rack::Test
- Controller tests are out
- Integration/request/API tests are in
- Docker & Docker compose are used for a containerised application
- Core
- rails 5.1.5
- ruby 2.5.0
- postgres
- puma
- rack-cors - Cross-origin resource sharing
- health_check - Creates a
_health
canary endpoint. - jbuilder
- Testing
- rspec-rails
- webmock - Stop hitting real endpoints! You're testing your application, not theirs.
- factory_girl_rails - Boo fixtures. Yay factories!
- timecop - Allows you to timetravel during your tests
- simplecov - Test coverage checker
- faker - Generating fake data
- Debugging
- awesome_print -
ap @object
will print out things in a nice way to help with puts debugging - pry-rails -
binding.pry
will save your life - bullet - Helps with finding N+1 queries
- sentry - catch and log your errors.
- awesome_print -
- Security & Style
- rubocop - A style checker with an autofixer. Keep your code clean and readable!
- brakeman - Static analysis for security vulns & bad practice.
- bundler-audit - Checks your gemfile for known vulnerabilities
- Utils
- annotate - Annotates your models, routes and factories with schema comments. Helpful for at-a-glance checks.
MIT