Underlay
Underlay is used by DVELP to fire up new rails applications.
Installation
First install the underlay gem:
gem install underlay
Then run:
underlay projectname
This will create a Rails API app in projectname
using the latest version of Rails.
Associated services
Packaged Gems
To see the latest and greatest gems, look at Underlay'
Gemfile, which will be appended to the default
generated projectname/Gemfile.
It includes application gems like:
And development gems like:
- Figaro for loading environment variables
- Pry Rails for interactively exploring
objects
- ByeBug for interactively
debugging behavior
- Bullet for help to kill N+1 queries and
unused eager loading
- Bundler Audit for scanning the
Gemfile for insecure dependencies based on published CVEs
- Spring for fast Rails actions via
pre-loading
- Web Console for better debugging via
in-browser IRB consoles.
And testing gems like:
More Awesomeness
Underlay also comes with:
- The
./bin/setup
convention for new developer setup - The
./bin/deploy
convention for deploying to Heroku - Rails' flashes set up and in application layout
- A few nice time formats set up for localization
Rack::Deflater
to compress responses with Gzip- A low database connection pool limit
- Safe binstubs
t()
and l()
in specs without prefixing with I18n
- An automatically-created
SECRET_KEY_BASE
environment variable in all
environments - Configuration for CircleCI Continuous Integration (tests)
- Configuration for Sentry error tracking
- The analytics adapter Google Tag Manager
Heroku
You can optionally create Heroku staging and production apps:
underlay app --heroku true
This:
- Creates a staging and production Heroku app
- Sets them as
staging
and production
Git remotes - Creates a Heroku Pipeline for review apps
- Schedules automated backups for 10AM UTC for both
staging
and production
You can optionally specify alternate Heroku flags:
underlay app \
--heroku true \
--heroku-flags "--region eu --addons sendgrid,ssl"
See all possible Heroku flags:
heroku help create
Git
This will initialize a new git repository for your Rails app. You can
bypass this with the --skip-git
option:
underlay app --skip-git true
GitHub
You can optionally create a GitHub repository for Rails app. It
requires that you have Hub on your system:
curl http://hub.github.com/standalone -sLo ~/bin/hub && chmod +x ~/bin/hub
underlay app --github organization/project
This has the same effect as running:
hub create organization/project -p
Spring
Underlay uses spring by default.
It makes Rails applications load faster, but it might introduce confusing issues
around stale code not being refreshed.
If you think your application is running old code, run spring stop
.
And if you'd rather not use spring, add DISABLE_SPRING=1
to your login file.
Application mode
You can set Application mode:
underlay app --application_mode true
This creates full Rails application including assets and action cable.
Dependencies
Underlay requires the latest version of Ruby.
PostgreSQL needs to be installed and running for the db:create
rake task.
TODO
Kudos
This app was built on the foundations set out in
Suspenders by
Thoughtbot.
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/rake
to run the automated test suite.
To install this gem onto your local machine, run bundle exec rake install
.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/DVELP/underlay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Seoable was created and is maintained by DVELP Ltd.
If you like what you see and would like to hire us or join us, get in touch!