Stream has an API you can use for the scalability side of this and an easy getting started tutorial [1] . We also have lots of SDK's and example code to help you along your way in many major languages and frameworks. [2]
Generally speaking, you'll need to track users, topics, follows, likes/dislikes, etc., and then you'd set up follow relationships on flat feeds at Stream, and use aggregated feeds for roll-ups like "15 users posted a topic in the past hour" and notification feeds for "22 people up-voted your answer to ..."
[1] https://getstream.io/get_started/#intro [2] https://github.com/GetStream/