Rails Template

screenshot of Rails Template
rails

Rails Template

Application template for Rails 7 projects; preloaded with best practices for TDD, security, deployment, and developer productivity.

Overview:

The Ackama Rails Template is a set of features and configurations that the Ackama Ruby team uses as the starting point for creating new Rails applications. It is based on their experience of creating and maintaining Rails applications for over 10 years. The template includes various features and configurations aimed at improving the development process, security, error reporting, code style, and testing.

Features:

  • General:
    • Uses puma as the application server.
    • Uses Yarn for managing JavaScript packages.
    • Uses PostgreSQL as the database (only supports PostgreSQL).
    • Includes a much-improved bin/setup script.
    • Includes dotenv for environment variable management.
    • Creates a doc/ directory for documentation.
    • Adds a middleware to implement HTTP Basic Auth using environment variables.
    • Uses okcomputer for health check endpoints.
    • Installs lograge for improved logs in production.
    • Uses app/services as the place to hold plain Ruby objects for business logic.
    • Overrides the default ActiveStorage base controller for authentication decisions.
  • Security:
    • Configures osv-detector to run in CI.
    • Installs and configures brakeman for vulnerability scanning.
    • Adds a well-documented Content Security Policy initializer with secure defaults.
    • Creates .well-known/security.txt for security information.
  • Error Reporting:
    • Sets up Sentry for error reporting.
  • Code Style:
    • Includes EditorConfig config file (.editorconfig).
    • Sets up Prettier for JavaScript/HTML/CSS with an Ackama config.
    • Sets up ESLint for JavaScript using Ackama's rules.
    • Uses stylelint for styles.
    • Includes Rubocop for Ruby with Ackama settings.
    • Installs Overcommit for managing custom Git hooks.
    • Uses erb_lint to lint HTML in ERB and runs Rubocop on Ruby snippets within ERB.
  • Testing:
    • Uses RSpec for tests.
    • Installs webdrivers for automated browser testing.
    • Includes Simplecov for test coverage.
    • Enables debugging system specs using a visible browser (not headless).
    • Sets up automated accessibility testing using axe and lighthouse.
    • Includes Axe Matchers gem for checking accessibility compliance of views.

Installation:

To use the Ackama Rails Template for every Rails app you create:

  1. Clone the template repository to your local machine:
$ git clone <template_repository_url> <app_name>
$ cd <app_name>
  1. Run the following command to install the template:
$ bin/setup
  1. Customize the template based on your requirements.

Summary:

The Ackama Rails Template is a comprehensive set of features and configurations that the Ackama Ruby team uses as a starting point for creating new Rails applications. It includes various improvements for development, security, error reporting, code style, and testing. By using this template, teams can benefit from the experience and best practices of the Ackama Ruby team, ensuring a solid foundation for their Rails applications.

rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.