Speed up your new Rails 8.0 projects with a preconfigured set of tools !
If you don't have yet the project cloned, fetch it from remote URL:
$ rails new myapp -m https://raw.githubusercontent.com/anthony-robin/hyperloop/master/template.rbIf you already have it cloned:
$ rails new myapp -m hyperloop/template.rbWarning
Some arguments from the rails new command might not be compatible with the template. Here are some flags that work well:
$ rails new myapp -m hyperloop/template.rb --skip-ci --skip-test --skip-system-test --skip-brakeman --skip-active-storage --skip-action-text --skip-action-mailbox --skip-kamal --skip-gitGenerator will ask several questions to refine configuration:
- What port the server should run (default:
3000) - What language the app should handle (default:
en) - Is an authentication needed ?
- If yes, does an admin dashboard is needed ?
Wait for the end of the installer, then start it with:
$ bin/devIn production:
- turbo-rails and stimulus-rails for JavaScript related features
- slim-rails for views templates
- simple_form for handling forms inputs
- pagy for pagination
- meta-tags for SEO friendly
- action_policy as authorization actions verifier (only if authentication is
yes) - dotenv-rails to handle
.envfiles - activestorage and actiontext available by default
- ffaker to generate fake data (seed database)
- mission_control-jobs to manage processed jobs
- rails-i18n if locale is different of English
In development:
- annotaterb to print model database structure (opinionated configuration)
- bullet to track N+1 queries
- chusaku to print routes URL above controller actions
- letter_opener_web to intercept emails and print them in browser
- rubocop and its extensions for coding conventions (very opinionated)
- ribbonit to display Ruby and Rails information
- spark to reload browser page on HTML, CSS, JS modifications
In test (unless --skip-test flag):
- rspec-rails to test requests, models, mailers, ...
- factory_bot to define Ruby objects as test data
- simplecov to get code coverage of the app
- rubocop-rspec to follow rspec related rules and best practices
- PicoCSS as a minimalist prototyping framework.
-
Rails authentication comes with
session,registrationandreset passwordfeatures preconfigured as well as related mailers. -
A minimal admin dashboard is created if requested on generator prompt. This feature includes the pretender gem to sign in as another user to manage it easily.
-
SEO is preconfigured to work in any pages by default and title/description can be specified directly in
seo.{locale}.ymlfile. -
Default browser confirm modal as been replaced with a pretty and friendly one following excellent gorails tutorial
-
Database is seed with default users corresponding to each access level
-
If using
postgresadapter, database can be dockerized using:$ docker-compose up -d
Project is compatible for english and french locales out of the box. When generator ask for locales, answer in two letters ISO 639 language code. For multiple locales, separate them with a comma. For example:
- en
- fr
- en,fr
Note
In case of multiples locales, the default will be the first one specified.
See Github project for coming roadmap.
Hyperloop is inspired by:
- excid3/jumpstart for its starter template
- bdavidxyz/tailstart for its starter instructions
Thank you :)