User-to-user chats
If your product needs messaging (DMs, group chats, marketplace conversations), don't build it: RailsFast pairs with our chats gem (opt-in), which gives you Instagram-class user-to-user messaging: direct messages, group chats, image attachments, emoji reactions, read receipts, unread badges, and typing indicators, all real-time, all server-rendered.
It's Hotwire-native, which makes it a perfect fit for RailsFast: messages stream over Turbo Streams + Action Cable (the template's Solid Cable, no Redis), the inbox refreshes itself with Turbo 8 morphing, and it degrades gracefully to plain request/response when WebSockets are down. It also works inside the RailsFast Native shells out of the box, since it's just server-rendered Hotwire. It already runs in production inside RailsFast Native apps.
Turning it on
-
Add
gem "chats"to theGemfile(there's a commented entry under PROJECT-BASED GEMS) andbundle install. -
Run the installer and migrate:
rails generate chats:install rails db:migrate -
Make your users conversational:
# app/models/user.rb acts_as_messager -
Mount the inbox in
config/routes.rb(the generator prints this line; it does not add it):mount Chats::Engine => "/messages"/messagesis now a working inbox, and you're chatting:alice.message!(bob, "hola!") # DM in one line alice.chat_with(bob, carol, title: "Trip") # groups alice.unread_chats_count # for your nav badge
Conversations can be about records in your domain (acts_as_chat_subject + about: ride). That's how you get marketplace-style threading: one conversation per pair, per subject.
The chats README is the source of truth for the full API, the ejected views, and the moderation hooks, which pair naturally with the moderate gem's report/block Trust & Safety layer (see Abuse protection).