Kowl is a Rails (v6.*) based opinionated application generator used to get started quickly
Kowl is a Rails (v6.*) based opinionated application generator used to get started quick. It's purpose is so you can focus on building your application rather spending days setting up the basic gems every time.
· Report Bug
· Request Feature
Kowl is tool to easily generate a Rails (~> 6) application with a number of configurations, templates, and generators applied.
That way your’re not spending days running through gems and documentation to get an application setup.
(This can include setting up bootstrap, devise, sidekiq, linters, dockerizing your application, and various other steps)
To get a local copy up and running follow these simple steps.
Requires a minimum of:
Ruby >= 2.5
Rails >= 2.6
# If using RVM
rvm install 2.6.5
rvm use 2.6.5 --default
1. Install the required dependencies
Depending on the options you want to use when generating an application your dependencies will vary.
autogen autoconf cmake libtool make v8
- For nokogiri, sassc, and various C based ruby gems.docker
- If you want to build a docker image using the application specific generated Dockerfile.git
- Is generally required for installing rubygems anyways.graphviz
- For generating an applications ERD (unless you skip generating an ERD for your application --skip_erd
)jemalloc
- Optional, but helps with improving rubies memory allocation. (If using RVM you can install a ruby version to utilize jemalloc using: rvm install 2.6.5 -C --with-jemalloc
)imagemagick
- If you plan on using ActionText/Trix you’ll want imagemagick
or vips
for processing image uploadslibsodium
- If you wish to encrypt particular PII user attributes (using the lockbox gem by generating an application with the encrypt flag --encrypt
)node && yarn
- Generally any new rails app requires node and yarn for installing and transpiling JS dependencies.Dependant on the database your application will be using, you’ll also need to install their required C adapters
PostgreSQL - postgresql
Oracle - instantclient-basic && instantclient-sdk
brew update
brew tap InstantClientTap/instantclient
brew install instantclient-basic instantclient-sdk
SQLserver - freetds
2. Install ruby gem
gem install kowl
Usage:
kowl AppName
Options:
-d [--database=DATABASE] # If you want to use a specific database for the application (builds with sqlite3 until you are ready)
# Default: sqlite3
[--docker_distro=DISTRO] # Specify what docker distro to use for the application (alpine, debian)
# Default: alpine (If you specify to use Oracle your distro will default to Debian)
[--encrypt] # If you want encrypt various user data (using lockbox)? (For GDPR compliance)
# Default: false (This requires you to install libsodium in order to encrypt the user data)
[--framework=CSSFRAMEWORK] # If you want to generate views using a specific CSS framework (bootstrap, semantic, none)
# Default: bootstrap
[--git_repo=REPO_NAME] # If you've already created a gitlab repo, specify the repo and and it will be added.
# ie: https://github/username/REPO_NAME.git
# Default: nil
[--mailer=MAILER] # Which transactional mailer you want to use in production (postmark or sparkpost)?
# Default: sparkpost (unless you specify to --skip_mailer, than neither will be used)
[--noauth] # If you would like to skip adding devise and pundit to the application
# Default: false
[--simpleform] # Do you want your application to use simpleform to generate forms
# Default: false
[--skip_docker] # If you want your application to skip generating any docker files (Dockerfile, docker-compose.yml, and .dockerignore)
# Default: false
[--skip_erd] # If you want to skip generating an ERD for your application (requires graphviz to be installed)
# Default: false
-G [--skip_git] # Do you want the generator to skip creating initializing and commit files to git
# Default: false
[--skip_javascript] # Skip adding javascript (webpacker) to the application
# Default: false
[--skip_mailer] # Do you want to skip setting up a transactional mailer (see --mailer option above)?
# Default: false
[--skip_pagination] # Do you want to skip using pagination with your application?
# Default: false
[--skip_pry] # Do you want to skip using pry with your applications rails console?
# Default: false
[--skip_sidekiq] # Do you want to skip setting up sidekiq (for background jobs, mailers, etc.)
# Default: false
[--skip_spring] # If you hate spring and want to skip using it with your application.
# Default: false
-T [--skip_tests] # Do you want your application to skip building with tests
# Default: false
[--skip_turbolinks] # If you want to skip adding turbolinks to your applications assets
# Default: false
[--template_engine=ENGINE] # Assign a template_engine to use for the applications views (erb, slim, haml)
# Default: erb
[--test_engine=TEST_ENGINE] # If you want to generate the application using a specific test suite (minitest, RSpec, none)
# Default: rspec
[--uuid] # Enable setting as database primary keys as UUIDs (Only while using PostgreSQL)
# Default: false (NOTE: This feature is still under development)
-W [--webpack=JSFRAMEWORK] # If you want initialize to webpacker with a specific JS framework (react vue angular elm stimulus)
# Default: nil
Examples:
kowl AppName
Generate an application using sqlite3, with a name of “AppName”, requiring authentication, using RSpec, and using bootstrap.
kowl AppName --database=oracle --simpleform --noauth
This will generate an application using the Oracle database, using simple_form, and not requiring any sort of authentication (anyone can hit this app.)
kowl AppName --simpleform --template_engine=slim
This will generate an application defaulting to sqlite3, using simple_form, the Slim template engine, with pagination, and requiring authentication to load the application.
kowl AppName --simpleform --template_engine=slim --skip_tests
Generate an application using sqlite3, using bootstrap CSS framework, using the slim template engine, and build without any tests.
kowl AppName --git_repo=https://github/username/REPO_NAME.git
Will generate an app with the remote repo set as https://github/username/REPO_NAME.git
kowl foobar --template_engine=haml --simpleform --framework=semantic;
This will generating an app with the HAML template engine, using simpleform, and using the Semantic UI CSS Framework
The gems included in the applications Gemfile are dependant on options passed when generating an application.
These gems are in addition to your applications required database adapters
User gems that will be included unless the --noauth
flag is specified when generating an application.
db/maxmind
.--template_engine
specified when generating an application.
present?
to prevent unnecessary SQL queries.String#blank?
..env
files.These gems will be included to setup sidekiq unless the --skip_sidekiq
flag is used when generating an application.
--noauth
)--skip_sidekiq
)If using ruby >= 2.7
it also includes e2mmap
and thwait
to prevent ruby dependency errors.
--encrypt
flag is used to enforce GDPR and CCPA compliance to encrypt PII for users. (GDPR Article 34, Section 3 (a)) By encrypting user identifiable information; this ensurers PII isn’t plain text readable by hackers in case there is a data breach with the application. When encrypting user data it will use the lockbox with the xsalsa20 algorithm which requires libsodium.See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Brandon Hicks (@tarellel)
Project Link: https://github.com/tarellel/kowl