-
Clone this repo
-
Install PostgreSQL in case you don't have it
-
Install Ruby in case you don't have it
-
Install node and yarn. Expected node version ">=16 || 14 >=14.17".
-
Run
yarn install
andyarn build --watch
. This bundles the JS assets in the administration site using esbuild. -
bundle exec rspec
and make sure all tests pass (non-headless mode) orHEADLESS=true bundle exec rspec
(headless mode) -
rails assets:precompile
to precompile assets -
Run
bin/dev
. -
You can now try your REST services!
This template provides a handful of scripts to make your dev experience better!
- bin/bundle to run any
bundle
commands.bin/bundle install
- bin/rails to run any
rails
commandsbin/rails console
- bin/web to run any
bash
commandsbin/web ls
- bin/rspec to run specs
bin/rspec .
- bin/dev to run both Rails and JS build processes at the same time in a single terminal tab.
bin/dev
You don't have to use these but they are designed to run the same when running with Docker or not.
To illustrate, bin/rails console
will run the console in the docker container when running with docker and locally when not.
- ActiveAdmin for easy administration
- Arctic Admin for responsive active admin
- Annotate for documenting the schema in the classes
- Better Errors for a better error page
- Brakeman for security static analysis
- Byebug for debugging
- DelayedJob for background processing
- Devise for basic authentication
- Devise Token Auth for API authentication
- Dotenv for handling environment variables
- Draper for decorators
- Factory Bot for testing data
- Faker for generating test data
- Flipper for feature flag support
- Jbuilder for JSON views
- JS Bundling for bundling JS assets
- Knapsack for splitting tests evenly based on execution time
- Letter Opener for previewing emails in the browser
- New Relic for monitoring and debugging
- Oj for optimized JSON
- Pagy for pagination
- Parallel Tests for running the tests in multiple cores
- Prosopite to detect N+1 queries
- Pry for enhancing the Ruby shell
- Puma for the web server
- Rack CORS for handling CORS
- Rails Best Practices for Rails linting
- Reek for Ruby linting
- RSpec for testing
- RSpec OpenAPI for generating API documentation
- Rswag for serving the API documentation
- Rubocop for Ruby linting
- Sendgrid for sending emails
- Shoulda Matchers for other testing matchers
- Simplecov for code coverage
- Strong Migrations for catching unsafe migrations in development
- Webmock for stubbing http requests
- YAAF for form objects
With bundle exec rails code:analysis
you can run the code analysis tool, you can omit rules with:
- Rubocop Edit
.rubocop.yml
- Reek Edit
config.reek
- Rails Best Practices Edit
config/rails_best_practices.yml
- Brakeman Run
brakeman -I
to generateconfig/brakeman.ignore
Rails Template for Learning Camp is maintained by Rootstrap