This is a barebone Rails 6.0 app to show some basic configurations.
I'm used to maintain a barebone app that helps me build new project quickly, and this is extract from my side project initially for sharing my ideas to friends, but if this valuable to you, use it freely.
I hope this could be a template for new app, it should be production-ready, so I'll keeping polish the codebase, follow best practice, keep dependencies update
I don't wanna add too more features especially business-specific, but I'd like to perfection User system (based on Devise) because most of apps need this, and keep improving UI/UX relates works.
I list some help wanted, see below.
Personally, I'm not skilled at front-end and I still prefer to classic Rails server-side rendering, and partially introduce React or Vue for complex pages.
A good example is Gitlab, I also cheat some useful helpers to this app.
Webpacker 4 without Sprockets
Webpacker can do all the jobs that Sprockets, and has full support of front-end community, So I remove Sprockets and tune Webpacker allows Assets Pipeline experience.
I do these:
- Remove gems relates to Sprockets
- Search and remove
CoreUI with Bootstrap, FontAwesome
A hack about Rails Credentials
Rails Credentials is a useful feature to store security-sensitive configs.
But we can't bundle
credentials.yml.enc isn't readable,
So it's difficult to redistribution the app,
I gave a PR to Rails but no respond,
I consist thinking it's useful so I integrate it as a hack, see
So you can copy
edit it, then run
rails credentials:encrypt that will generate
config/master.key for you.
A hack about ActionMailer configuration
database.yml, ActionMailer's config separates in many files,
I do a hack that you can config ActionMailer in one place.
Implemented a full-feature layouts & views
I don't have art skill but ... at least it works!
Overrides Form Helpers to enhance them support Bootstrap form validation style
In addition, see
config/application.rb how to require overrides.
Don't render ActionView's default error field wrapper
That's will break many CSS frameworks.
Run the app
- Clone it
cp config/database.yml.sqlite.example config/database.yml
cp config/credentials.yml.example config/credentials.yml&
cp config/mailer.yml.example config/mailer.yml
Receive Devise confirmation mail
In development, I use
mailcatcher to receive mails,
gem install mailcatcher to installed
Open a new terminal, run
mailcatcher, then followed the instructions
Set user as admin
cp config/settings.yml config/settings.local.yml
- Put your email into
- In user menu (right-top of pages), you should see
- UI/UX design & SCSS & HTML improvement
- Layout for mails
- Coding style & structural improvement
- Try support uploading user avatar using ActiveStorage
- Find bugs
- Docker for deployment, including stages to compiling assets & copy
ymls, easy to migrate to k8s