Making an app with a shared feature access

Im trying to make an app with some sort of shared access function. In the app i want to start a “club” or team or something, and send a code or invite to someone and they can join the “club”. This way, stuff I do in the app will be visible for the others that have joined and vice versa.
Does anyone know a sort of solution to this?

You’ll need to communicate to a database in some way

You can’t only do this in the iOS app