Rails Starter 7
Dusty Candland |
|
opensource, ruby, rails
A Ruby on Rails starter repo. I've done the same for 5 & 6. It includes the most common gems and patterns that I'm currently using to build with.
A Ruby on Rails starter repo. I've done the same for 5 & 6. It includes the most common gems and patterns that I'm currently using to build with.
- Users
- Accounts
- Admin/users
- Coding standards
- GitHub actions
- Health check
More deailts in the readme: Rails Starter 7
README
Rails app with the defaults I like to build with :)
Overview
- users
- accounts
- admin/users
- code standards
- github actions
- health check
Setup
git clone git@github.com:candland/rails-starter-7.git new_project
Find & Replae
Change database names in database.yml
rg -l 'RailsStarter7' | xargs -n 1 sed -i '' -e 's/RailsStarter7/NewProject/g'
rg -l 'RAILS_STARTER_7' | xargs -n 1 sed -i '' -e 's/RAILS_STARTER_7/NEW_PROJECT/g'
rg -l 'rails_starter_7' | xargs -n 1 sed -i '' -e 's/rails_starter_7/new_project/g'
rg -l 'rails-starter-7' | xargs -n 1 sed -i '' -e 's/rails-starter-7/new-project/g'
rg -l 'Rails Starter 7' | xargs -n 1 sed -i '' -e 's/Rails Starter 7/New Project/g'
rg -i 'rails[- _]*starter[- _]*7'
bundle install
yarn install
bin/rails db:create
bin/rails db:migrate
System dependencies
- Ruby version: 3.1
- postgresql
- redis
- nodejs
- yarn
Configuration
Credential files.
jwt_secret:
secret_key_base:
Database creation
rails db:create
rails db:migrate
How to run the test suite
rails test
Services (job queues, cache servers, search engines, etc.)
Deployment instructions
Setup overcommit
overcommit --sign
overcommit --sign --pre-commit
overcommit --install
Code coverage
Run code converage
COVERAGE=1 rails test
That will output a report to converage/index.html. Use CI=1
to output JSON for continuous itegration.
Gems
Auth
- [X] Devise
- [X] Pundit
- [X] PunditCan
- [X] User Roles
- [X] Pretender
UI / Views
- [x] Subcomponent
- [X] Slim Rails
- [X] Premailer Rails
- [X] Heroicon
- [X] Pagy
- [X] Simple Form
Jobs
- [X] Sidekiq
- [X] Sidekiq Scheduler
API
- [x] API Pie
- [x] JWT
- [x] Versionist
Development
- [X] Exception Notification
- [X] Minitest Spec
- [X] FactoryBot
- [X] OverCommit
- [X] Guard
- [X] Guard Minitest
- [X] Annotate
- [X] Faker
- [X] Letter Opener
- [X] Solargraph
- [X] Ordinare
- [X] Slim Lint
- [X] Standard
- [X] StandardJS
- [X] StyleLint
- [X] VCR
- [X] Webmock
- [X] Simplecov
- [X] Brakeman
Generators
- [x] Services
- [x] Policy
- [x] Worker
- [ ] Scaffold
API
curl -v -H 'content-type: application/json' -d '{"email":"candland+xyz@gmail.com","password":"password"}' 'localhost:3000/api/v1/auth'
{"token":"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYTUyZjgzNDItZWQzZC00NzlkLThkZWEtODYzMTI5OTk5OGM0In0.iZPRhTwCnudSV_dxzNmhe_CuMc5fiFd0RRHcsGkLr0Q"}
curl -v -H 'content-type: application/json' -H 'authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYTUyZjgzNDItZWQzZC00NzlkLThkZWEtODYzMTI5OTk5OGM0In0.ZE0P602LJLKFwTlvOtnMZ6clF-QpqVY0q7P-7KP3-9k' 'localhost:3000/api/v1/me'
Webmentions
These are webmentions via the IndieWeb and webmention.io. Mention this post from your site: