# Chatwoot Development Guidelines ## Build / Test / Lint - **Setup**: `bundle install && pnpm install` - **Run Dev**: `pnpm dev` or `overmind start -f ./Procfile.dev` - **Lint JS/Vue**: `pnpm eslint` / `pnpm eslint:fix` - **Lint Ruby**: `bundle exec rubocop -a` - **Test JS**: `pnpm test` or `pnpm test:watch` - **Test Ruby**: `bundle exec rspec spec/path/to/file_spec.rb` - **Single Test**: `bundle exec rspec spec/path/to/file_spec.rb:LINE_NUMBER` - **Run Project**: `overmind start -f Procfile.dev` - **Ruby Version**: Manage Ruby via `rbenv` and install the version listed in `.ruby-version` (e.g., `rbenv install $(cat .ruby-version)`) - **rbenv setup**: Before running any `bundle` or `rspec` commands, init rbenv in your shell (`eval "$(rbenv init -)"`) so the correct Ruby/Bundler versions are used - Always prefer `bundle exec` for Ruby CLI tasks (rspec, rake, rubocop, etc.) ## Code Style - **Ruby**: Follow RuboCop rules (150 character max line length) - **Vue/JS**: Use ESLint (Airbnb base + Vue 3 recommended) - **Vue Components**: Use PascalCase - **Events**: Use camelCase - **I18n**: No bare strings in templates; use i18n - **Error Handling**: Use custom exceptions (`lib/custom_exceptions/`) - **Models**: Validate presence/uniqueness, add proper indexes - **Type Safety**: Use PropTypes in Vue, strong params in Rails - **Naming**: Use clear, descriptive names with consistent casing - **Vue API**: Always use Composition API with `