A standard set of gems, libraries and configurations we use for our new projects.
Backend:
- PostgreSQL
- Devise
- Omniauth
- Connect with Google
- Connect with Facebook
- Kaminari
- Pundit
- Active Admin
- activeadmin_addons
- Active Storage
- Sidekiq
- Redis
- Friendly IDs
- raygun4ruby
- sitemap_generator
- strong_migrations
- paper_trail
- strong_password
- acts_as_paranoid
- pretender
- valid_email2
Frontend:
- HAML
- Webpacker
- SASS
- Simple Forms
- High Voltage
- kaminari
- bootstrap4-kaminari-views
- meta-tags
Development tools:
- Better Errors
- Awesome print
- Hirb
- Bullet
- Peek
- Guard live reloads
- Annotate
- Letter opener
Models:
- User
- AdminUser (for internal admin)
Testing:
- RSPEC
- Shoulda matchers
- Factory bot
- Faker
- Capybara
Go to config/database.yml
to change your database names and authentication methods.
rails db:setup
Opens the encrypted file in an editor. We use atom.
EDITOR="atom --wait" rails credentials:edit
- Delete the
master.key
and the encrypted fileconfig/credentials.yml.enc
. - Run the above commands to edit the encrypted files. Which will generate a new
master.key
. - Copy and paste the values from
config/credentials.template.yml
to the encrypted file.
- Create a Heroku App
- Create a
RAILS_MASTER_KEY
ENV variable. Rails will detect it and use it as your master key, e.g. in Heroku:heroku config:set RAILS_MASTER_KEY=<your-master-key-here>
OR set ENV variable in the Heroku UI. - Deploy your code
- Add Heroku Postgres addon.
- Once deploy has completed, run
rails db:migrate
on Heroku.heroku run rails db:migrate -a <your-heroku-app-name>
. - Setup required dynos.
- Worker setup for Sidekiq
- Provision Redis for Sidekiq
- Restart all dynos
On Heroku use Mailgun or setup the following ENV variables:
ENV['SMTP_USERNAME']
ENV['SMTP_PASSWORD']
ENV['SMTP_ADDRESS']
ENV['MAILGUN_SMTP_PORT']