Skip to content

Installer ​

sh
rails g trek:install
# or (soon)
trek install

Trek provides an install generator, that will:

  • install all dependencies
  • create the User model and include Trek's concerns
  • create the Page, PagePath and PageVersion models and include Trek's concerns
  • create the Fragment model 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.

AreaWhat gets set up
Authenticationbcrypt 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
AuthorizationActionPolicy and the base policies
ModelsUser, Page, PagePath, PageVersion, Fragment, MenuNode, ExternalLink, Current — with migrations
AttachmentsShrine configuration and the uploaders
EmailsPostmark and the user mailer
I18nrails-i18n, Mobility, i18n-tasks and the locale files
Admin panelsPages, fragments, users, sessions, password resets, routes, dashboard
PaginationKaminari
Toolingesbuild, PostCSS, EditorConfig, Procfiles, Makefile, health check endpoint
LintingStandard, ESLint, Stylelint, Prettier, Slim Lint, Lefthook git hooks
SecurityBrakeman, bundler-audit, ruby_audit
MonitoringAppSignal 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
SpecsRSpec, 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 detectionProsopite (development/test), scanning every request — see Controllers › N+1 detection
CIGitLab CI configuration
DeploymentScalingo 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 delivery
  • APPSIGNAL_PUSH_API_KEY — injected into the Rails credentials for error tracking and performance monitoring
  • DEEPL_AUTH_KEY — enables automatic locale translation in the scaffold generator

Released under the MIT License.