Last active
September 28, 2021 15:41
-
-
Save rx/4802626a4badfc1a470811da4f4f9c27 to your computer and use it in GitHub Desktop.
Rails service - application 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
ruby_version = '3.0.2' | |
file '.ruby-version', "ruby-#{ruby_version}\n" | |
gem 'redis' | |
gem 'sidekiq' | |
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem | |
gem_group :development, :test do | |
gem 'dotenv-rails' | |
gem 'rubocop', require: false | |
gem 'rspec-rails', require: false | |
end | |
environment 'config.active_job.queue_adapter = :sidekiq' | |
environment "config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] }" | |
file '.env', <<~CODE, force: true | |
export REDIS_URL=redis://localhost:6379/0 | |
CODE | |
append_file '.gitignore' do <<~'CODE' | |
.idea | |
.env | |
CODE | |
end | |
gsub_file 'Gemfile', /^ruby\W'\d\.\d\.\d'$/, "ruby '#{ruby_version}'" | |
gsub_file 'config/application.rb', /^#\Wrequire\W\"active_job\/railtie\"$/, "require 'active_job/railtie'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rx, another note - When I was working on this innovation sprint project, I had in the back of my mind to try and create a template for APIs at Maxwell to standarize that work. However, didn't have enough time to work on that - https://github.com/himaxwell/lox-api
But one of the things I wanted to do was decide on a gem or other seralizer so that we can follow the JSON API spec for any APIs we create a Maxwell. I ended up using the
jsonapi-resources
gem which I don't think we all like enough to make that the default for all APIs.Another thing was the need to standardize the way we do API documentation. Even for non-external APIs, having a consistent way we can add documentation would be useful.