Rails application template
Create Rails app prepared for confortable coding in a second.
This configuration is full of opinions.
It doesn't define what database to use, that's the responsibility of your ~/.railsrc
file.
Usage
Run rails new
command with -m
option and point to location of the template file, like this:
rails new project_name -m https://raw.githubusercontent.com/kolomeetz/rails_template/master/template.rb
But even a better idea could be configuring Rails defaults with ~/.railsrc
file with something like that:
--database=postgresql
--webpack
--skip-coffee
--skip-turbolinks
--template=https://raw.githubusercontent.com/kolomeetz/rails_template/master/template.rb
With this file rails new
command becomes nice and slick:
rails new project_name
Added gems
Development and testing gems added:
- annotate to add model annotations as comments in the beginning of model files
- bullet for detecting N+1 queries errors
- factory_bot to create objects for testing
- faker to generate fake data in tests
- guard to run tests automatically
- rspec for writing unit tests
- rubocop to check code style
- simplecov to check code coverage
Gems for production:
- lograge to make requests logging nice and tidy
Differences from Rails defaults
In development:
config.active_record.verbose_query_logs
is set tofalse
to hide noisy logs
Plans
- add
Makefile
with basic dev env commands - add factory_bot for fixtures
- add
--skip-test
to railsrc - add Circle CI configuration
- add Dockerfile with production-like configuration
- add docker-compose for development