Rails App Template Sustainable

screenshot of Rails App Template Sustainable

A Rails App Template that creates a new Rails app according to the sustainable rails book

Overview

The Rails Application Template "rails-app-template-sustainable" sets up a Rails app based on the principles outlined in "Sustainable Web Development with Ruby on Rails". It is designed specifically for Rails 6.1 and provides a number of features to enhance development, testing, security, and production behavior.

Features

  • Gem management: Removes problematic gems like Turbolinks and Spring, and includes gems for better testing (Factory Bot, Faker, minitest-reporters), development (dotenv-rails, foreman), security (Brakeman, bundler-audit), and production behavior (lograge, sidekiq).
  • Database management: Uses SQL-based schema management and assumes the usage of Postgres. All datetime fields in migrations use the proper type of timestamp with time zone.
  • Code organization: Removes unnecessary stylesheets and helpers generated by generators. Encourages the use of a base ApplicationService and provides a service class generator. Includes methods like confidence_check for validating assumptions in tests and not_implemented! for skipping unimplemented tests. Also includes a lint test for all factories.
  • Workflow automation: Provides convenient command line scripts like bin/setup for more involved setup, bin/ci to run all quality checks, bin/run to run the app locally, bin/sql to access a SQL prompt for the local database, bin/db-{migrate,rollback} to migrate and rollback both development and test databases in one command, and bin/release for running migrations in the Heroku release phase.

Summary

The "rails-app-template-sustainable" Rails Application Template provides a set of features and configurations to promote sustainable web development practices. It includes gem management, database management, code organization improvements, and workflow automation. By following the installation guide, developers can quickly set up a Rails app with optimized development, testing, security, and production behavior.