Skip to content

Plus17/rails-app-template

Repository files navigation

application_name

This app does: ????

Content

This boilerplate comes with batteries included, you’ll find:

  • Gems:
    • Removes Gems that cause problems:
      • Turbolinks makes your app feel slow and broken
      • Spring creates an unstable development environment
    • Gems for better testing:
      • Factory Bot to manage test data
      • Faker to provide fake values for that data
      • minitest-reporters to get more useful test run output
    • Gems for development:
      • dotenv-rails to allow management of local UNIX environments
      • foreman to run multiple processes locally
      • standard for no-brainer style guide
    • Gems for managing security issues:
      • Brakeman
      • bundler-audit
    • Gems for better production behavior:
      • lograge for single-line logging
      • sidekiq for background jobs
      • Postgres
    • Gems for asset pipeline:
      • propshaft
      • jsbundling-rails
      • cssbundling-rails
  • Dev Workflow
    • bin/setup that does a more involved setup
    • bin/ci runs all quality checks (tests, brakeman, bundle audit, yarn audit)
    • bin/run runs the app locally
    • bin/sql get a SQL prompt to your local database
    • bin/db-{migrate,rollback} - migrate and rollback both dev and test in one command
    • bin/release - Release phase script for Heroku to run migrations
  • Other Things
    • Removes config/database.yml and config/secrets.yml because your app will get all configuration from ENV
    • SQL-based schema management so you can use any feature of Postgres you like
    • No stylesheets or helpers generated by generators since they provide a false sense of modularity that is of zero benefit.
    • All datetime fields in migrations uses timestamp with time zone which is the proper type in Postgres.
    • A test to lint all your factories
    • Tailwind for frontend

Setup

  1. Pull down the app from version control
  2. Make sure you have Postgres and Redis running
  3. bin/setup

Running The App

  1. bin/run

Tests and CI

  1. bin/ci contains all the tests and checks for the app
  2. tmp/test.log will use the production logging format not the development one.

Production

  • All runtime configuration should be supplied in the UNIX environment
  • Rails logging uses lograge. bin/setup help can tell you how to see this locally

Rename your project

  1. Open the script rename.sh
  2. Change NEW_NAME & NEW_CAMEL_NAME variables with your app name
  3. Execute the script sh rename.sh
  4. Remove the file rename.sh

based on: https://github.com/davetron5000/rails-app-template-sustainable

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published