A Rails 8 SaaS template foundation with modern UI, authentication, and multi-tenancy. Built for rapid development with a clean, modular architecture.
Version: 0.1.0 (Early Development)
This is an actively developed template. See below for what's currently shipped vs. planned.
- π Rails 8.0.4 with PostgreSQL (UUIDs)
- π¨ TailwindCSS with dark/light mode support
- β‘ Hotwire (Turbo + Stimulus) ready
- π― Heroicons via rails_icons gem (1,289+ icons)
- π Authentication via Devise (email/password configured)
- π‘οΈ Authorization via Pundit (base setup complete)
- π’ Multi-tenancy with Account, User, and Membership models
- π Pages - Homepage, Dashboard, Styleguide
- π¨ Icon Helper - Convenient methods for all Heroicons
- π³ Billing - Stripe/Paddle/Polar integration
- π§ Email - Provider abstraction (Resend/Postmark/SendGrid/Mailgun)
- π Security - Rack::Attack, SecureHeaders, and CSP
- π Observability - Honeybadger/Sentry integration
- π€ AI Features - LLM integration, agent workflows
- π CMS - Content management system
- π SEO - Programmatic SEO tools
- πͺ Webhooks - Webhook delivery system
- π Analytics - Basic attribution dashboard
Future goal: Configure different providers in config/cornerstone.yml:
| Module | Planned Default | Planned Alternatives |
|---|---|---|
| Billing | Stripe | Paddle, Polar |
| Resend | Postmark, SendGrid, Mailgun | |
| Storage | AWS S3 | R2, GCS |
| AI | OpenAI | Anthropic, Gemini, Ollama |
| Jobs | Sidekiq | Solid Queue |
Future generators to extend functionality:
rails g cornerstone:cms # Page & Post models with inline editing
rails g cornerstone:seo # Programmatic SEO pipeline
rails g cornerstone:ai # AI stack with LLM support
rails g cornerstone:webhooks # Webhook delivery system
rails g cornerstone:analytics # Basic analytics dashboardNote: These generators are not yet implemented.
Currently, the best way to use Cornerstone is to clone and develop directly:
# Clone the repository
git clone https://github.com/coreyhaines31/cornerstone.git
cd cornerstone
# Install dependencies and setup database
bin/setup
# Start the development server
bin/devThe server will start on http://localhost:3000
After setup, you'll have access to:
- Homepage at http://localhost:3000
- Styleguide at http://localhost:3000/styleguide (component reference)
- Sign up/Login via Devise at /users/sign_up
Basic environment variables (optional for now):
cp .env.example .env
# Edit .env as needed:
# - APP_NAME (defaults to "Cornerstone")
# - APP_HOST (defaults to "localhost:3000")Note: Billing, email, and other integrations are not yet required.
app/
βββ components/ # ViewComponent UI library
βββ controllers/ # Rails controllers
βββ models/ # Active Record models
βββ policies/ # Pundit authorization policies
βββ services/ # Business logic services
βββ views/ # Rails views
lib/
βββ cornerstone/ # Core template modules
βββ core/ # Core functionality
βββ billing/ # Billing adapters
βββ email/ # Email provider adapters
βββ ai/ # AI provider integrations
βββ generators/ # Module generators
config/
βββ cornerstone.yml # Module configuration
βββ ai.yml # AI provider settings
βββ plans.yml # Subscription plans
bin/setup # Initial setup (installs dependencies, prepares database)
bin/dev # Start development servers (Rails + Tailwind CSS watcher)
bin/test # Run test suite
bin/lint # Run lintersThe bin/dev command starts all necessary processes using Foreman:
- Rails server on port 3000 (http://localhost:3000)
- Tailwind CSS watcher for live CSS compilation
The server runs on port 3000 by default. If you need to change the port, you can:
# Temporarily for one session
PORT=4000 bin/dev
# Or edit Procfile.dev to change it permanently
# Change the first line to: web: bin/rails server -p 4000You can also run processes individually if needed:
rails server # Just the Rails server
rails tailwindcss:watch # Just the CSS watcherbundle exec rspec # Run all tests
bundle exec rspec spec/models # Run model tests
bundle exec rspec spec/system # Run system testsbundle exec standard # Ruby style guide
bundle exec erb_lint # ERB linting
bundle exec brakeman # Security analysis
bundle exec bundler-audit # Dependency auditCornerstone includes an upgrade script to help you update to newer versions:
# Upgrade to latest version
ruby upgrade.rb
# Upgrade to specific version
ruby upgrade.rb 1.2.0
# Dry run to see what would change
ruby upgrade.rb --dry-runThe template is configured for deployment to:
- Heroku - One-click deploy ready
- Render - Blueprint included
- Fly.io - fly.toml configuration
- Docker - Dockerfile included
- Any VPS - Capistrano ready
heroku create myapp
heroku addons:create heroku-postgresql:mini
heroku addons:create heroku-redis:mini
git push heroku main
heroku run rails db:migrateRequired environment variables for production:
DATABASE_URL # PostgreSQL connection
REDIS_URL # Redis connection
SECRET_KEY_BASE # Rails secret
STRIPE_SECRET_KEY # Stripe API key
RESEND_API_KEY # Email provider key
HONEYBADGER_API_KEY # Error tracking- Getting Started Guide
- Module Configuration
- Multi-tenancy Guide
- Billing Integration
- AI Features
- Deployment Guide
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Cornerstone is built on the shoulders of giants:
- Rails framework and the Rails community
- All the amazing gem authors whose work powers this template
- The SaaS founders who've shared their learnings
Built with β€οΈ for Rails developers who want to ship faster.