Epic Ruby On Rails 7 chatroom app with PostgreSQL, Redis Caching, Bootstrap 5, Font Awesome 5, Devise, Notifications, Announcements, Rollup, Importmap, CSS Bundling, JS Bundling, Administrate, Hotwire, Stimulus JS GLightbox and Action Cable/Cable Ready & Request JS.
- Admin as boolean flag on User model (manual - switch it in console)
- Member and other roles as enum integer (hash) on User model (write methods as required)
Style kept minimal so Bootstrap 5 can be swapped out for other CSS or UI if required, Bootstrap icons via CDN, docs reference at ./vendor/index.html, dummy fonts in root of app (not used)
- Ruby/Rails/Node/Postgres
- Ruby 3.0.0
- Rails 7.0.0 up
- [NodeJS] (https://nodejs.org/es/blog/release/v16.0.0/) 16.0.0
- PostgreSQL 14.00
After first set email & db credentials in .env file (for PostgreSQL, cp .env.example to .env and fill in with your env details)
- $ bundle install && bundle audit
- $ yarn (engine node v 16.0.0)
- $ bin/rails css:install:bootstrap (dont overwrite application.bootstrap)
- Hotwire
-
$ rails hotwire:install (dont overwrite, request js module declared in root .ts file )
-
$ bin/rails db:migrate:reset
-
Is set up to send basic user signup mail with Gmail, alter smtp or other mail credentials (.env, application_mailer, devise.rb & development.rb), then test signup confirmation emails by signing up & confirming user email As above be sure to copy .env.example > .env and enter details, or adapt to suit yours. (2 factor auth Google accs req an App password for the device registered there and being used, not the normal password)
-
$ rails dev:cache (check/toggle, must be cached, if not run again)
- $ rails stimulus_reflex:install (extra config needed see link [https://docs.stimulusreflex.com/])
-
$ rails generate favicon (put your favicon.png in assets/images, along with favicon.json in config folder) (see https://realfavicongenerator.net/) for more info.
-
$ rails g rspec:install (for testing)
(for test db run $ rails db:test:prepare)
- Run Importmap
./bin/importmap ./bin/importmap pin bootstrap (pin bootstrap & popper, ie import & set) ./bin/importmap json (show maps)
$ rails s
(For other cmds see related docs/links)
$ rails action_text:install (already done here)
$ rails generate administrate:install (if use Administrate)
$ $ yarn build:css --watch (separate terminal watch/update changes in styles)
Paul Anthony McGowan - xhostcom@gmail.com
https://www.patreon.com/xhostcom
#################################################