Just another Rails app template
hmu-rails
aims to provide a general starting point for rails applications building off the Rails principle of convention over configuration.
- Installs sidekiq for running background jobs with ActiveJob.
- Installs sidekiq-scheduler for scheduling background jobs
- Creates a
docs
directory to store project documentation - Creates a
docs/index.md
file with a minimal template for documentation - Creates a
docs/adr
directory to log technical decisions using the Architectural Decision Record format with a README and template. - Creates up a sample
README.md
file and links back to your docs
Backend
- Installs rubocop and creates a standard rubocop file.
Frontend
- Installs eslint and creates an eslint file for rails projects.
Backend
- Installs rspec-rails as the core test framework
- Installs rspec-mocks to support mocks and stubs in tests
- Installs simplecov to report test coverage
- Installs factory_bot_rails for fixtures / test data
- Installs webmock for mocking HTTP calls in tests for example to APIs
- Installs climate_control for modifying environment variables in tests
- Merges the
spec_helper.rb
andrails_helper.rb
files intospec_helper.rb
to avoid having two configuration files.
Frontend
- Installs Jest for frontend testing
- Creates stub tests
- Installs [dotenv] to support use of environment variables in development.
- Adds the
.env
file to.gitignore
so it isn't accidentally checked into version control. - Creates a
example.env
file to support sharing of example environment variables between developers. - Deviation - Explore use of encrypted
config/credentials.yml.enc
file for storing secrets.
- Configures webpack to build frontend assets.
You will need the following dependencies installed on your machine.
git clone https://github.com/mathewtrivett/hmu-rails.git
the repository to where you store your code.cd
to where you want to create your Rails project.- Run
rails new APP_NAME -d postgresql -m path/to/hmu-rails/template.rb