This was a fun little side project I built to play around with some Rails gems and concepts, such as serializers and decorators, which help decouple view-specific data transformation logic from controllers. It is a neat way to keep a clearer separation of concerns.
All in all, it only took a few hours spread across a couple of weekends. I also built an API so the app could be used from a React Native client, but halfway through I got sidetracked and focused more on experimenting with Rails authentication.
One gem I explored was authentication-zero, which is a solid alternative to the well-loved and battle-tested devise. Most Rails developers have used or at least heard of it. Authentication-zero can save weeks of development time by removing a lot of the complex architectural decisions around authentication. It also offers optional features that Devise does not provide out of the box, such as checking if a password has been pwned during signup, managing user sessions, and more. The GitHub repository has plenty of examples of what you can customize.
For presentation logic, I used the draper gem to hide deleted usernames and messages with just a few lines of code. For API serialization, I went with alba.
I also implemented friendly_id, which is simple to set up and gives posts human-readable URLs. This makes shared links more meaningful and easier to understand.