Installer
sh
rails g trek:install
# or (soon)
trek installTrek provides an install generator, that will:
- install all dependencies
- create the
Usermodel and include Trek's concerns - create the
Page,PagePathandPageVersionmodels and include Trek's concerns - create the
Fragmentmodel and include Trek's concerns - create the relevant policies
- generate and run the relevant migrations
Sub-generators
The installer orchestrates dedicated sub-generators, all under the trek:install:* namespace. Each one can also be run individually, e.g. rails g trek:install:healthcheck.
| Area | What gets set up |
|---|---|
| Authentication | bcrypt and has_secure_password on User, the UserSession model (one per signed-in browser, found through a signed session_id cookie), the Trek::Authentication controller concern, login/logout & password reset panels |
| Authorization | ActionPolicy and the base policies |
| Models | User, Page, PagePath, PageVersion, Fragment, MenuNode, ExternalLink, Current — with migrations |
| Attachments | Shrine configuration and the uploaders |
| Emails | Postmark and the user mailer |
| I18n | rails-i18n, Mobility, i18n-tasks and the locale files |
| Admin panels | Pages, fragments, users, sessions, password resets, routes, dashboard |
| Pagination | Kaminari |
| Tooling | esbuild, PostCSS, EditorConfig, Procfiles, Makefile, health check endpoint |
| Linting | Standard, ESLint, Stylelint, Prettier, Slim Lint, Lefthook git hooks |
| Security | Brakeman, bundler-audit, ruby_audit |
| Monitoring | AppSignal error tracking and performance monitoring — config/appsignal.rb, the push API key in the credentials, and the AppsignalContext concern tagging transactions per area and user |
| Specs | RSpec, and specs for the models Trek installs (trek:install:model_specs): spec/models/page_spec.rb and spec/models/user_spec.rb, with their test data as Oaken seed scripts — defaults in db/seeds/setup/, scenarios in db/seeds/test/cases/ loaded with seed "cases/…". They check Trek's behaviour in your app — slugs and paths, user validations and roles — so a customization that breaks it fails your suite; edit or remove the ones you deliberately change. Trek's own suite runs the same files |
| N+1 detection | Prosopite (development/test), scanning every request — see Controllers › N+1 detection |
| CI | GitLab CI configuration |
| Deployment | Scalingo files (trek:install:scalingo, run on demand) — see Deploying to Scalingo |
ENV variables read by the installer
Define these before running the installer to have them injected automatically:
POSTMARK_API_TOKEN— injected into the Rails credentials for email deliveryAPPSIGNAL_PUSH_API_KEY— injected into the Rails credentials for error tracking and performance monitoringDEEPL_AUTH_KEY— enables automatic locale translation in the scaffold generator