app/: Rails application code (controllers, models, views, policies).app/javascript/: Stimulus controllers and JS entrypoints; compiled intoapp/assets/builds/.app/assets/: Tailwind entry CSS and built assets.config/: Rails configuration (routes, initializers, environments).db/: migrations, schema, and seeds.spec/: RSpec tests, factories, and support helpers.docs/+swagger/: API documentation and Swagger spec.deploy/: deployment scripts and infrastructure configs.
This repo is Docker-only; do not use system Ruby/Bundler.
- Start/stop:
make up,make down, logs withmake logs. - Prod/dev switch:
STREAMSOURCE_ENV=prod make upusesdocker-compose.prod.ymlplus base compose. - Rails console:
make shellordocker compose exec web bin/rails console. - Migrations:
make migrate. - Tests:
make testordocker compose exec web bin/test [path]. - Lint:
make lint(runs RuboCop + ESLint). - Rebuild:
make rebuild(clean + rebuild containers). - Security:
docker compose exec web bundle exec brakeman -q -w2,docker compose exec web bundle exec bundler-audit check --update. - JS/CSS build:
docker compose exec web yarn buildanddocker compose exec web yarn build:css.
- Indentation: 2 spaces (EditorConfig).
- Ruby: RuboCop (Rails/RSpec), line length 120, prefer double quotes.
- JavaScript: ESLint Standard; single quotes, no semicolons, 2-space indent.
- Naming: specs use
*_spec.rb; factories live inspec/factories/. - Gemfile entries must be alphabetized within each group (Bundler/OrderedGems).
- Framework: RSpec with FactoryBot; avoid fixtures.
- Run a single spec:
docker compose exec web bin/test spec/models/user_spec.rb. - Coverage target is >90% (see
docs/LINTING.md); add edge-case coverage for controllers and services. - CI uses the
RspecJunitFormatter; keeprspec_junit_formatterin the test group.
- Prefer real login helpers over controller stubbing; avoid
allow_any_instance_ofin request specs. sign_in_adminposts top-levelemail/passwordparams (admin sessions controller does not use nested params).
- GitHub Actions versions are bumped in both
.github/workflows/pr-validation.ymland.github/workflows/deploy.yml. - JavaScript linting runs via
yarn lint(alias of ESLint).
- Commit messages are short, imperative, and lowercase (e.g., “simplify makefile”).
- Branch naming:
feature/...,fix/...,docs/.... - Resolve any pre-commit hook failures before committing or pushing (run
make pre-commitif needed). - PRs should include a brief summary, tests run, and doc updates. If API changes, update
docs/API.mdandswagger/v1/swagger.yaml.