All Projects → mattbrictson → Rails Template

mattbrictson / Rails Template

Licence: mit
Application template for Rails 6 projects; preloaded with best practices for TDD, security, deployment, and developer productivity.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Rails Template

Qaror
Questions & Answers platform on Rails - stackoverflow clone
Stars: ✭ 107 (-85.98%)
Mutual labels:  heroku, rails
Icare
Open Source Carpooling Platform
Stars: ✭ 196 (-74.31%)
Mutual labels:  heroku, rails
Fraternate
Fraternate is a standalone copy of the GitHub organization and user interaction framework. Built with Mongo dB | Node.js® | Express.js | Handlebars.js | Bootstrap.
Stars: ✭ 130 (-82.96%)
Mutual labels:  heroku, boilerplate
Chatwoot
Open-source customer engagement suite, an alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
Stars: ✭ 11,554 (+1414.29%)
Mutual labels:  heroku, rails
Envied
Ensures presence and type of your app's ENV-variables (mirror)
Stars: ✭ 327 (-57.14%)
Mutual labels:  heroku, rails
Letsencrypt heroku
Automated letsencrypt setup for heroku
Stars: ✭ 58 (-92.4%)
Mutual labels:  heroku, rails
Ruby2 Rails4 Bootstrap Heroku
A starter application based on Ruby 2.4, Rails 4.2 and Bootstrap for Sass 3, deployable on Heroku
Stars: ✭ 181 (-76.28%)
Mutual labels:  heroku, rails
Capistrano Rails Console
Capistrano plugin which adds a remote rails console and dbconsole
Stars: ✭ 166 (-78.24%)
Mutual labels:  rails, capistrano
Siwapp
Online Invoice Management in Ruby On Rails.
Stars: ✭ 296 (-61.21%)
Mutual labels:  heroku, rails
Flask Boilerplate
Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
Stars: ✭ 251 (-67.1%)
Mutual labels:  heroku, boilerplate
Typescript Boilerplate
Start writing stuff in TypeScript without bothered by configurations
Stars: ✭ 35 (-95.41%)
Mutual labels:  heroku, boilerplate
Property web builder
The ultimate Ruby on Rails engine for creating real estate websites ⛺
Stars: ✭ 414 (-45.74%)
Mutual labels:  heroku, rails
Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (-68.81%)
Mutual labels:  rails, boilerplate
Ruby Getting Started
Getting Started with Ruby on Heroku
Stars: ✭ 103 (-86.5%)
Mutual labels:  heroku, rails
Limestone
Boilerplate Rails 6 SaaS application with Webpack, Stimulus and Docker integration.
Stars: ✭ 191 (-74.97%)
Mutual labels:  rails, boilerplate
Rails new
A thoughtfully designed template for building modern Rails apps. Get started in minutes instead of hours 🔥🚀
Stars: ✭ 151 (-80.21%)
Mutual labels:  heroku, rails
Capistrano Mb
[unmaintained] Capistrano tasks for deploying Rails from scratch to Ubuntu 16.04 and 18.04
Stars: ✭ 117 (-84.67%)
Mutual labels:  rails, capistrano
Wheel
Don't reinvent the wheel for every new Rails project. Use sane Defaults.
Stars: ✭ 163 (-78.64%)
Mutual labels:  rails, boilerplate
Vuejs Rails Starterkit
Vue.js + Rails Starting Kit GitHub Template to develop Hybrid Mobile Application: https://vuejs-rails-starterkit.herokuapp.com
Stars: ✭ 205 (-73.13%)
Mutual labels:  heroku, rails
Socify
🚀 Socify is an open source social networking platform written in Ruby on Rails
Stars: ✭ 363 (-52.42%)
Mutual labels:  heroku, rails

mattbrictson/rails-template

Circle

Description

This is the application template that I use for my Rails 6 projects. As a freelance Rails developer, I need to be able to start new projects quickly and with a good set of defaults. I've assembled this template over the years to include best-practices, tweaks, documentation, and personal preferences, while still generally adhering to the "Rails way".

For older versions of Rails, use these branches:

Requirements

This template currently works with:

  • Rails 6.1.x
  • Bundler 2.x
  • PostgreSQL
  • chromedriver

If you need help setting up a Ruby development environment, check out my Rails OS X Setup Guide.

Installation

Optional.

To make this the default Rails application template on your system, create a ~/.railsrc file with these contents:

-d postgresql
-m https://raw.githubusercontent.com/mattbrictson/rails-template/main/template.rb

Usage

This template assumes you will store your project in a remote git repository (e.g. Bitbucket or GitHub) and that you will deploy to a production environment. It will prompt you for this information in order to pre-configure your app, so be ready to provide:

  1. The git URL of your (freshly created and empty) Bitbucket/GitHub repository
  2. The hostname of your production server

To generate a Rails application using this template, pass the -m option to rails new, like this:

rails new blog \
  -d postgresql \
  -m https://raw.githubusercontent.com/mattbrictson/rails-template/main/template.rb

Remember that options must go after the name of the application. The only database supported by this template is postgresql.

If you’ve installed this template as your default (using ~/.railsrc as described above), then all you have to do is run:

rails new blog

What does it do?

The template will perform the following steps:

  1. Generate your application files and directories
  2. Ensure bundler is installed
  3. Create the development and test databases
  4. Commit everything to git
  5. Push the project to the remote git repository you specified

What is included?

These gems are added to the standard Rails stack

  • Core
    • active_type – for building simple and effective form/service objects
    • sidekiq – Redis-based job queue implementation for Active Job
  • Configuration
    • dotenv – for local configuration
  • Utilities
    • annotate – auto-generates schema documentation
    • autoprefixer-rails – automates cross-browser CSS compatibility
    • amazing_print – try ap instead of puts
    • guard – runs tests as you develop; mandatory for effective TDD
    • rubocop – enforces Ruby code style
  • Security
  • Testing
    • shoulda – shortcuts for common ActiveRecord tests

Postmark

I like to use Postmark for transactional email, and so I've included the postmark-rails gem and configured it in environments/production.rb. Make sure to sign up for a Postmark account to get an API key, or switch to your own preferred email provider before deploying your app.

Other tweaks that patch over some Rails shortcomings

  • A much-improved bin/setup script
  • Log rotation so that development and test Rails logs don’t grow out of control

How does it work?

This project works by hooking into the standard Rails application templates system, with some caveats. The entry point is the template.rb file in the root of this repository.

Normally, Rails only allows a single file to be specified as an application template (i.e. using the -m <URL> option). To work around this limitation, the first step this template performs is a git clone of the mattbrictson/rails-template repository to a local temporary directory.

This temporary directory is then added to the source_paths of the Rails generator system, allowing all of its ERb templates and files to be referenced when the application template script is evaluated.

Rails generators are very lightly documented; what you’ll find is that most of the heavy lifting is done by Thor. The most common methods used by this template are Thor’s copy_file, template, and gsub_file. You can dig into the well-organized and well-documented Thor source code to learn more.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].