What this app does: Expense tracking with ML-powered categorization, email sync, admin panel, and iPhone Shortcuts API
Stack: Rails 8.1.2, PostgreSQL (pg_trgm, unaccent), Hotwire (Turbo + Stimulus), Tailwind CSS, Solid Queue/Cache/Cable (no Redis), Propshaft, Import Maps
Common commands:
bin/rails server— Start dev serverbin/rails console— Rails consolebundle exec rspec— Run RSpec testsbin/rails db:migrate— Run migrationsbin/rails db:setup— Create DB, load schema, seedbin/rails db:reset— Drop and recreate DBtailwindcss:build/tailwindcss:watch— Build/watch Tailwind CSSbundle exec rubocop
Test command: bundle exec rspec --tag unit
Lint command: bundle exec rubocop
Security scan: bundle exec brakeman
Notes:
- NEVER push directly to main. ALL code changes go through a PR — no exceptions, not even 1-line hotfixes. Create a branch, commit, push, open PR, review, then merge.
- NEVER use
--no-verifyto bypass pre-commit hook. Hook failure = commit did NOT happen — fix, re-stage, new commit (do NOT amend). - Design system: Financial Confidence palette —
teal-*(primary),amber-*(warning),rose-*(error),emerald-*(success),slate-*(neutrals). NEVER useblue-*,gray-*,red-*,yellow-*, orgreen-*. Full palette:.claude/context/frontend/design-system.md
A pre-commit hook is available to automatically run code quality checks and security scanning before allowing commits. This ensures code quality and security standards are maintained.
Setup: Run ./bin/setup-git-hooks after cloning the repository to install the hooks.
The hook runs:
- RuboCop - Ensures code style compliance
- Brakeman - Security vulnerability scanner
- RSpec unit tests - Runs only tests tagged with
:unit(usesbundle exec rspec --tag unit)
When multiple sessions run tests concurrently, deadlock errors (PG::TRDeadlockDetected) occur.
Solution: Use git worktrees with a separate test database per worktree.
git worktree add .worktrees/<branch-name> -b <branch-name> main- Change test DB name in
config/database.yml:expense_tracker_test_worktree<%= ENV['TEST_ENV_NUMBER'] %> RAILS_ENV=test bin/rails db:create && RAILS_ENV=test bin/rails db:schema:load
.worktrees/is gitignored. Do NOT commit thedatabase.ymlchange.
Detailed conventions, patterns, and architectural decisions: .claude/context/ (5 domains: backend, frontend, database, security, project).