Okay somethings that could be used…upon signup you could have a custom field setup with options ie cities for example
Depending on the City chosen from s list you could use sn automation to add them automatically to a group
Then with category settings use permissions so that only a “City A” group can see/create/reply
Removing category security Everyone See/create/reply
Removing this permission completely only members of that group can view and participate. Only logged in users of that group “city A” can see and participate.
If you want ppl and anonymous visitors to see. Keep Everyone with only See security.
Yes there is a built in invite system. The link can be for anyone to use or even target a specific email address for sign up. Invites are trackable and their is a badge as well for invites. The Invite can add them to a group, bring them to a specific topic and a few other things.
These are built in and of course there are also add on extensions with Customization > Theme Customization > Theme component & Customization > Plugin