Jumpstart Pro - Add claude.md

Public
Jumpstart Pro - Add claude.md
Used 2 times
Created by
A Andy Waite

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/Xg8sKr"
Template Source

Review the code before running this template on your machine.

file "CLAUDE.md", <<~EOS
  # CLAUDE.md
  
  This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
  
  ## Overview
  
  Jumpstart Pro Rails is a commercial multi-tenant SaaS starter application built with Rails 8.0. It provides subscription billing, team management, authentication, and modern Rails patterns for building subscription-based web applications.
  
  ## Development Commands
  
  ```bash
  # Initial setup
  bin/setup                    # Install dependencies and setup database
  
  # Development server
  bin/dev                      # Start development server with Overmind (includes Rails server, asset watching)
  bin/rails server            # Standard Rails server only
  
  # Database
  bin/rails db:prepare         # Setup database (creates, migrates, seeds)
  bin/rails db:migrate         # Run migrations
  bin/rails db:seed           # Seed database
  
  # Testing
  bin/rails test              # Run test suite (Minitest)
  bin/rails test:system       # Run system tests (Capybara + Selenium)
  
  # Code quality
  bin/rubocop                 # Run RuboCop linter (configured in .rubocop.yml)
  bin/rubocop -a              # Auto-fix RuboCop issues
  
  # Background jobs
  bin/jobs                    # Start SolidQueue worker (if using SolidQueue)
  bundle exec sidekiq         # Start Sidekiq worker (if using Sidekiq)
  ```
  
  ## Architecture
  
  ### Multi-tenancy System
  - **Account-based tenancy**: Users belong to Accounts (personal or team)
  - **AccountUser model**: Join table managing user-account relationships with roles
  - **Current account switching**: Users can switch between accounts via `switch_account(account)`
  - **Authorization**: Pundit policies scope data by current account
  
  ### Modular Models
  Models use Ruby modules for organization:
  ```ruby
  # app/models/user.rb
  class User < ApplicationRecord
    include Accounts, Agreements, Authenticatable, Mentions, Notifiable, Searchable, Theme
  end
  
  # app/models/account.rb  
  class Account < ApplicationRecord
    include Billing, Domains, Transfer, Types
  end
  ```
  
  ### Jumpstart Configuration System
  - **Dynamic configuration**: `config/jumpstart.yml` controls enabled features
  - **Runtime gem loading**: `Gemfile.jumpstart` loads gems based on configuration
  - **Feature toggles**: Payment processors, integrations, background jobs, etc.
  - Access via `Jumpstart.config.payment_processors`, `Jumpstart.config.stripe?`, etc.
  
  ### Payment Architecture
  - **Pay gem (~11.0)**: Unified interface for multiple payment processors
  - **Processor-agnostic**: Stripe, Paddle, Braintree, PayPal, Lemon Squeezy support
  - **Per-seat billing**: Team accounts with usage-based pricing
  - **Subscription management**: In `app/models/account/billing.rb`
  
  ## Technology Stack
  
  - **Rails 8.0** with Hotwire (Turbo + Stimulus)
  - **PostgreSQL** (primary), **SolidQueue** (jobs), **SolidCache** (cache)
  - **Import Maps** for JavaScript (no Node.js dependency)
  - **TailwindCSS v4** via tailwindcss-rails gem
  - **Devise** for authentication with custom extensions
  - **Pundit** for authorization
  - **Minitest** for testing with parallel execution
  
  ## Testing
  
  - **Minitest** with fixtures in `test/fixtures/`
  - **System tests** use Capybara with Selenium WebDriver
  - **Test parallelization** enabled via `parallelize(workers: :number_of_processors)`
  - **WebMock** configured to disable external HTTP requests
  - **Test database** reset between runs
  
  ## Routes Organization
  
  Routes are modularized in `config/routes/`:
  - `accounts.rb` - Account management, switching, invitations
  - `billing.rb` - Subscription, payment, receipt routes
  - `users.rb` - User profile, settings, authentication
  - `api.rb` - API v1 endpoints with JWT authentication
  
  ## Key Directories
  
  - `app/controllers/accounts/` - Account-scoped controllers
  - `app/models/concerns/` - Shared model modules
  - `app/policies/` - Pundit authorization policies
  - `lib/jumpstart/` - Core Jumpstart engine and configuration
  - `config/routes/` - Modular route definitions
  - `app/components/` - View components for reusable UI
  
  ## Development Notes
  
  - **Current account** available via `current_account` helper in controllers/views
  - **Account switching** via `switch_account(account)` in tests
  - **Billing features** conditionally loaded based on `Jumpstart.config.payments_enabled?`
  - **Background jobs** configurable between SolidQueue and Sidekiq
  - **Multi-database** setup with separate databases for cache, jobs, and cable
EOS

if File.directory?(".cursor")
  if yes?("Do you want to delete the contents of the .cursor/ directory? (y/n)")
    # Delete all contents of the .cursor/ directory recursively
    FileUtils.rm_rf(Dir.glob(".cursor/*"))
    say "Deleted contents of .cursor/ directory."
  else
    say "Skipped deleting contents of .cursor/ directory."
  end
end
Comments

Sign up or Login to leave a comment.