<One sentence: what this Rails app does.>
Stack
- Ruby <3.x>, Rails <8.x>, PostgreSQL
-
Frontend: <Hotwire (Turbo + Stimulus) React via jsbundling> -
Jobs: <Solid Queue Sidekiq>; tests: <RSpec Minitest>
Commands
- Setup:
bin/setup - Run:
bin/dev - Tests:
bin/rails test<orbundle exec rspec> (one:bin/rails test test/models/order_test.rb:42) - Lint:
bin/rubocop -a - Security scan:
bin/brakeman - Migrations:
bin/rails g migration <Name>thenbin/rails db:migrate
Rules
- Follow Rails conventions: RESTful controllers, fat models are fine but extract service/query objects when a model grows past one responsibility.
-
Strong parameters for every create/update; authorization in every controller action (<Pundit Action Policy explicit checks>). - Avoid N+1:
includes/preload;warnings are bugs. - Migrations: reversible (
changewith reversible operations, orup/down); add indexes withalgorithm: :concurrently(anddisable_ddl_transaction!) on large tables. - Background jobs must be idempotent and take IDs, not whole records.
- Credentials via
bin/rails credentials:editor environment variables; never in the repo.
Definition of done
- Tests, rubocop and brakeman pass;
db/schema.rbupdated with the migration.