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 | Sorcery, the UserSession form model, 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 |
| CI | GitLab 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 deliveryDEEPL_AUTH_KEY— enables automatic locale translation in the scaffold generator