Initially we're providing an API but the idea of open sourcing it is very much on the table, which of course would allow users to install it on their own hardware.
Building a sports site and only friends of team members or the team members themselves can message each other? Build it in your authorization model. The UI will only see appropriate recipients and only be able to send messages to them. In other words, a lot of your architecture could become UI-DB direct and only a portion going through a business layer.