mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-09 08:47:11 -05:00
2.7 KiB
2.7 KiB
Repository Guidelines
Project Structure & Module Organization
app/holds the Rails application: controllers and views under feature-oriented folders,services/for importers and background workflows, andpolicies/for Pundit authorization.app/javascript/contains Stimulus controllers (controllers/), map widgets (maps/), and Tailwind/Turbo setup inapplication.js.lib/stores reusable support code and rake tasks, whileconfig/tracks environment settings, credentials, and initializers.db/carries schema migrations and data migrations;spec/provides RSpec coverage;e2e/hosts Playwright scenarios;docker/bundles deployment compose files.
Build, Test, and Development Commands
bundle exec rails db:prepareinitializes or migrates the PostgreSQL database.bundle exec bin/devstarts the Rails app plus JS bundler via Foreman usingProcfile.dev(setPROMETHEUS_EXPORTER_ENABLED=trueto use the Prometheus profile).bundle exec sidekiqruns background jobs locally alongside the web server.docker compose -f docker/docker-compose.yml upbrings up the containerized stack for end-to-end smoke checks.
Coding Style & Naming Conventions
- Follow default Ruby style with two-space indentation and snake_case filenames; run
bin/rubocopbefore pushing. - JavaScript modules in
app/javascript/use ES modules and Stimulus naming (*_controller.js); keep exports camelCase and limit files to a single controller. - Tailwind classes power the UI; co-locate shared styles under
app/javascript/styles/rather than inline overrides.
Testing Guidelines
- Use
bundle exec rspecfor unit and feature specs; mirror production behavior by tagging jobs or services with factories inspec/support. - End-to-end flows live in
e2e/; executenpx playwright test(setBASE_URLif the server runs on a non-default port). - Commit failing scenarios together with the fix, and prefer descriptive
it "..."strings that capture user intent.
Commit & Pull Request Guidelines
- Write concise, imperative commit titles (e.g.,
Add family sharing policy); group related changes rather than omnibus commits. - Target pull requests at the
devbranch, describe the motivation, reference GitHub issues when applicable, and attach screenshots for UI-facing changes. - Confirm CI, lint, and test status before requesting review; call out migrations or data tasks in the PR checklist.
Environment & Configuration Tips
- Copy
.env.exampleto.envor rely on Docker secrets to supply API keys, map tokens, and mail credentials. - Regenerate credentials with
bin/rails credentials:editwhen altering secrets, and avoid committing any generated.envorcredentials.yml.encchanges.