This is a really cool idea and is something we've wanted for a while. However, fair warning, this won't be easy .
To get you started, IPFS is actually built on top of something called IPLD (interplanetary linked data). That's likely what you'd want to use. IPLD is a content addressable JSON-like object system where objects can link to other objects by hash (just like IPFS).
IPFS also has an experimental feature called pubsub. You can use it to listen for events on a "topic". Warning: pubsub is experimental, subject to change, and known to be extremely inefficient.
If you want to build something that works like existing forums, chats, etc., the tricky part of will likely be agreeing on the current state of the system, especially when untrusted parties come into play. One can use some form of blockchain to agree on the state but that can get expensive and doesn't actually fix the problem of untrusted parties. However, you may not need to actually agree on the state as long as all parties get all (or most) of the state and you have some trust mechanism (or are obscure enough to not attract spammers/trolls).
You may find the following resources useful:
js-ipfs IPLD interface:
A nice library for using pubsub from js-ipfs:
Library for building distributed data structures in IPLD (specifically, CRDTs):
I recommend you also look at the other apps in the shipyard for inspiration: