Implementing a News Feed / Activity Feed on Several Models - Recommendations?

前端 未结 2 1888
遇见更好的自我
遇见更好的自我 2021-02-03 15:42

I\'m interested in learning how to implement a News Feed / Activity Feed on a web app for multiple models like Books, Authors, Comments, etc...

Any recommendations from

相关标签:
2条回答
  • 2021-02-03 16:32

    First and foremost, I’d like to be open and say that I am an employee of Stream, an API for building scalable news and activity feeds – much like you would see on Facebook, Instagram, and other social media applications.

    From my extensive experience as a developer and consultant and continued research and self-education, Stream’s technology stack is extremely effective or competitive. You can get a news or activity feed up and running in a fraction of the time than it would take you to build out your own infrastructure (Cassandra clusters, queuing mechanisms, etc.).

    That being said, I highly recommend checking out Stream. What it really comes down to is buy vs build. You can spend months building out a custom solution, or rely on a proven and scalable platform such as Stream that will offer you everything you need to get up and going, in a fraction of the time.

    If you're skeptical, check out the 5 minute tutorial at https://getstream.io/get_started/.

    Best of luck!

    0 讨论(0)
  • 2021-02-03 16:35

    You don't need any Gem.

    1. Create a new model, e.g. Activity, to store activity details. The module should store at least the activity timestamp, the event (e.g. created, destroyed, published, ...) and the id of the related record (you can even use a polymorphic association if you want)
    2. Create a method which gets in input a record with additional metadata and creates a new activity record
    3. In you controllers, call the method each time you want to keep track of an action, passing the modified record as parameter

    Then you'll have a list of Activity records you can easily fetch to display the latest events.

    0 讨论(0)
提交回复
热议问题