A boilerplate for quickly setting up a Ruby On Rails RESTful API:
- Ruby 3.3.0
- Rails 7.1.2
- PostgreSQL Database
Installation
- Use ruby
3.3.0
rbenv install 3.3.0
rbenv local 3.3.0
ruby -v
- Install packages:
gem install bundler
bundle install
- Add
config/database.yml
- referconfig/database.yml.sample
- Add
.env
- refer.env.sample
- Generate new rails master key
rm -f config/credentials.yml.enc && rm -f config/master.key && EDITOR=vim bin/rails credentials:edit
- Database setup:
bin/rails db:setup
- Start server:
bin/rails s
bundle exec sidekiq
Specs
bundle exec rspec
Check the coverage at coverage/index.html
API document
bin/rake rswag
Check the generated document at http://localhost:3000/docs
Security vulnerability scanner
bundle exec brakeman
Linter with rubocop
bundle exec rubocop
Licensed under the MIT license, see the separate LICENSE.md file.