Getting Started with Rails Blueprint
Overview
Rails Blueprint is a comprehensive Rails application template that provides a production-ready foundation for your next project.
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
Clone the Repository
$ git clone https://github.com/railsblueprint/basic.git myapp
$ cd myappInstall Dependencies
$ bundle install
$ yarn installConfigure 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:initSetup Database
$ rails db:create
$ rails db:migrate:with_data
$ rails db:seedVerification
Once installation is complete, start the development server:
$ bin/devVisit 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.ymltriggers on it, andrake rubocop:changeddiffs againstrubocop_dev_branchinlib/tasks/rubocop.rake. Runningrails 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, setrubocop_dev_branchinlib/tasks/rubocop.rakeby hand sorubocop:changedworks locally. - CI runs on GitHub-hosted runners unless you set a
CI_RUNNERrepository variable holding a JSONruns-onvalue, for example["self-hosted","ci"]. - The
blueprint-initjob in the workflow is the template's own self-test of the initialisation process. It is switched on by theBLUEPRINT_TEMPLATEvariable 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
| File | Purpose |
|---|---|
.env.development | Local environment variables |
config/app.yml | Application settings |
Procfile.dev | Development server configuration |
package.json | JavaScript dependencies |
Next Steps
Now that you have Rails Blueprint running, explore these resources: