Last active
January 16, 2021 23:31
-
-
Save mmahalwy/4f6192ae212d2ba7049a190e4d2b170d to your computer and use it in GitHub Desktop.
rails template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "rack-cors" | |
gem "pundit" | |
gem "graphql" | |
gem "friendly_id", "~> 5.2.4" | |
gem "awesome_print" | |
gem "strong_migrations" | |
gem "httparty" | |
gem "name_of_person" | |
gem "metka" | |
gem "parallel" | |
gem "kaminari" | |
gem "sidekiq" | |
gem "sentry-raven" | |
gem "active_type" | |
gem "amazing_print" | |
# gem "dotenv-rails" | |
gem "fast_jsonapi" | |
gem "jwt" | |
gem "montrose" | |
gem "jsonb_accessor" | |
# https://github.com/jrochkind/attr_json | |
# https://github.com/DmitryTsepelev/store_model | |
# gem "ahoy_matey" | |
# gem "has_friendship" | |
# gem "newrelic_rpm" | |
# gem "pg_search" | |
gem "sendgrid-ruby" | |
if yes?("Add algolia?") | |
gem "algoliasearch" | |
gem "algoliasearch-rails" | |
end | |
if yes?("Add slack?") | |
gem "slack-ruby-client" | |
initializer 'slack.rb', <<-CODE | |
Slack.configure do |config| | |
config.token = Rails.application.credentials.slack_api_token | |
end | |
CODE | |
end | |
if yes?("Encrypt attrs?") | |
gem "lockbox" | |
puts "Go to https://github.com/ankane/lockbox" | |
end | |
if yes?("Using phone numbers?") | |
gem "twilio-ruby" | |
gem "phonelib" | |
gem "phony_rails" | |
gem "active_model_otp" | |
end | |
if yes?("Redis?") | |
gem "redis" | |
gem "redis-namespace" | |
gem "redis-rails" | |
end | |
if yes?("Audited?") | |
# gem "paper_trail" | |
gem "audited", "~> 4.9" | |
after_bundle do | |
rails_command("g audited:install") | |
end | |
end | |
if yes?("Devise?") | |
gem "devise" | |
gem "devise-jwt", "~> 0.6.0" | |
after_bundle do | |
rails_command("g devise:install") | |
end | |
# route <<-CODE | |
# devise_for :users, | |
# path: "", | |
# path_names: { | |
# sign_in: "login", | |
# sign_out: "logout", | |
# registration: "signup" | |
# }, | |
# controllers: { | |
# sessions: "sessions", | |
# registrations: "registrations", | |
# omniauth_callbacks: "omniauth_callbacks" | |
# } | |
# CODE | |
end | |
gem_group :development, :test do | |
gem "factory_bot_rails" | |
gem "faker" | |
gem "guard-rspec", require: false | |
gem "guard-rubocop", require: false | |
gem "parallel_tests" | |
gem "pry-byebug" | |
gem "pry-rails" | |
gem "rspec-rails" # http://betterspecs.org/ | |
gem "rubocop" | |
gem "rubocop-rails" | |
gem "rubocop-rspec" | |
gem "bullet" | |
end | |
gem_group :development do | |
gem "annotate" | |
gem "solargraph" | |
end | |
file "./.rubocop.yml", <<-CODE | |
require: rubocop-rails | |
CODE | |
if yes?("UUID for primary key?") | |
initializer 'generators.rb', <<-CODE | |
Rails.application.config.generators do |g| | |
g.orm :active_record, primary_key_type: :uuid | |
end | |
CODE | |
file "db/migrate/#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_enable_uuid.rb", <<-CODE | |
class EnableUuid < ActiveRecord::Migration[6.0] | |
def change | |
enable_extension 'pgcrypto' | |
end | |
end | |
CODE | |
end | |
after_bundle do | |
rails_command("g annotate:install") | |
rails_command("g annotate:install") | |
rails_command("g rspec:install") | |
rails_command("g rubocop_rails_config:install") | |
rails_command("g bullet:install") | |
rails_command("g pundit:install") | |
rails_command("g graphql:install") | |
rails_command("db:create db:migrate") | |
end | |
# run_bundle | |
# run_after_bundle_callbacks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment