2 self-hostable options with public code.
End-to-end encrypted collaborative documents
Online document editors you can host