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
AuthenticationSorcery, the UserSession form model, 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
CIGitLab CI configuration

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
  • DEEPL_AUTH_KEY — enables automatic locale translation in the scaffold generator

Released under the MIT License.