Getting Started with Rails Blueprint

Overview

Rails Blueprint is a comprehensive Rails application template that provides a production-ready foundation for your next project.

Pro Tip: Rails Blueprint comes in three editions: Basic, Plus, and Pro. Each edition builds upon the previous one with additional features.

Whether you're building a SaaS application, an e-commerce platform, or a content management system, Rails Blueprint provides the essential building blocks you need to get started quickly.

Fast Setup

Get up and running in minutes with our streamlined installation process.

Production Ready

Built with best practices and security in mind from day one.

Modular Design

Choose the features you need and customize to your requirements.

Quick Start

Get your Rails Blueprint application running in just a few minutes.

Prerequisites

Before you begin, ensure you have the following installed:

  • Ruby 3.3.0 or higher
  • Rails 7.2.2 or higher
  • PostgreSQL 14+
  • Redis 6+
  • Node.js 18+ and Yarn

Installation Steps

1
Clone the Repository
$ git clone https://github.com/railsblueprint/basic.git myapp
$ cd myapp
2
Install Dependencies
$ bundle install
$ yarn install
3
Configure Application

Generates config/database.yml, config/app.yml, config/deploy.rb and the other configuration files from their templates. Run it before touching the database.

$ rails blueprint:init
4
Setup Database
$ rails db:create
$ rails db:migrate:with_data
$ rails db:seed

Verification

Once installation is complete, start the development server:

$ bin/dev

Visit http://localhost:3000 in your browser. You should see the Rails Blueprint welcome page!

After Forking

Once the code lives in your own repository, your default branch is no longer the Rails Blueprint one. Three things follow from that:

  • Set your default branch. CI in .github/workflows/rails.yml triggers on it, and rake rubocop:changed diffs against rubocop_dev_branch in lib/tasks/rubocop.rake. Running rails blueprint:init[my_app,main] points both at the branch you name, or at the branch you are on when you leave it out. On a project that is already initialised, set rubocop_dev_branch in lib/tasks/rubocop.rake by hand so rubocop:changed works locally.
  • CI runs on GitHub-hosted runners unless you set a CI_RUNNER repository variable holding a JSON runs-on value, for example ["self-hosted","ci"].
  • The blueprint-init job in the workflow is the template's own self-test of the initialisation process. It is switched on by the BLUEPRINT_TEMPLATE variable on the Rails Blueprint repositories and stays off in your project.

Project Structure

Rails Blueprint follows Rails conventions with some additional organization:

Key Directories

  • app/
    • commands/ - Command objects
    • components/ - View components
    • policies/ - Authorization policies
  • config/
    • app.yml - Application configuration
    • routes/ - Modular routing
  • spec/
    • Full RSpec test suite

Configuration Files

FilePurpose
.env.developmentLocal environment variables
config/app.ymlApplication settings
Procfile.devDevelopment server configuration
package.jsonJavaScript dependencies

Next Steps

Now that you have Rails Blueprint running, explore these resources:

Start creating your next app now