Lato
Lato is a Rails Engine for developing web applications.
This gem includes:
- User management with full authentication (signin, signup, recover password);
- Web panel UI (Navbar, Sidebar, Body) with Bootstrap;
- Some UI components ready to use integrated with Rails.
Installation
Add required dependencies to your application's Gemfile:
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails" # NOTE: Probably already installed in default rails 7 project
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails" # NOTE: Probably already installed in default rails 7 project
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails" # NOTE: Probably already installed in default rails 7 project
# Use Sass to process CSS
gem "sassc-rails"
# Use lato as application panel
gem "lato"
Install gem and run required tasks:
$ bundle
$ rails active_storage:install
$ rails lato:install:application
$ rails lato:install:migrations
$ rails db:migrate
Mount lato routes on the config/routes.rb file:
Rails.application.routes.draw do
mount Lato::Engine => "/lato"
# ....
end
Import Lato Scss on app/assets/stylesheets/application.scss file:
@import 'lato/application';
// ....
Import Lato Js on app/javascript/application.js file:
import "lato/application";
// ....
Setup I18n on the config/application.rb file:
module MyApplication
class Application < Rails::Application
config.i18n.available_locales = [:it, :en]
config.i18n.default_locale = :it
# ...
end
end
Extra tasks
Lato integrates by default a basic PWAs manifest and service worker. To re-generate them with all required assets follow these steps:
- Complete the configuration of lato on a custom initializer (see configuration options for more details)
- Add an icon.png file on public/icon.png with minimum size of 512x512px
- Run the following commands:
$ rails lato:generate:favicon
$ rails lato:generate:pwa
Development
Clone repository, install dependencies, run migrations and start:
$ git clone https://github.com/Lato-GAM/lato
$ cd lato
$ bundle
$ rails db:migrate
$ rails db:seed
$ foreman start -f Procfile.dev
Publish
$ ruby ./bin/publish.rb
License
The gem is available as open source under the terms of the MIT License.