Komposable allows you to quickly build a modular back-office for your Rails app. It offers standard features and allows you to implement you own specific needs easily.
It's based on the following existing gems:
- sorcery for authentication
- pundit for authorization
- acts_as_list for sorting records manually
- kaminari for pagination
- & our very own komponent for organizing front-end code as components
This gem has been inspired by fae. It is developed by Ouvrages and Etamin Studio.
# Gemfile
gem "komposable"
# For now, we have to add it manually
# TODO: include it in the gemspec dependencies
gem 'meta-tags', github: 'etaminstudio/meta-tags', branch: 'rename-title-helper'
Copy and run the migrations from the engine:
bin/rails komposable:install:migrations
bin/rails db:migrate
Add at the beginning of the routes:
# config/routes.rb
namespace :admin do
root "pages#index"
resources :pages
end
mount Komposable::Engine => "/admin"
Add at the end of the file:
# config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( admin.js admin.css )
Add the engine path to resolved paths for webpacker and postcss:
# config/webpacker.yml
resolved_paths:
- frontend
- vendor/komposable/frontend
# .postcssrc.yml
postcss-import: {
path: [
'frontend',
'vendor/komposable/frontend'
]
}
Create a new javascript pack:
// frontend/packs/admin.js
import "komposable/frontend/packs/admin";
To define your own navigation in the admin, you can override the admin/header
component.
$ mkdir frontend/components/admin
$ cp -r vendor/komposable/frontend/components/admin/header frontend/components/admin