I'm looking for the same. Open source, self hosted, and end-to-end encrypted.
I haven't found anything that really does all of this, but it seems like Cryptpad[0] and Peergos[1] are viable platforms upon which something like this could be built.
Except for the lack of encryption, Atomic Data[2] also seems like a really cool platform to build this on.