I know it's a little early and it will be in Ruby on Rails. However, I'm working on open sourcing a clone of Stripe's Home [1] as part of a series of open source B2B applications & they should check all those boxes (besides the Java/Node)
I'm also happy to walk you (or others in the thread if time permits) though the source code of a closed source app I have over a video call if you need to grok the mechanics/db structure. (email in profile.)
It's got:
- multi-tenancy
- roles with-in each tenant
- sub-tenants (think engineering team vs accounting team vs hr team)
- accounts can be members of multiple tenants
- billing for each tenant (even sub tenants or inherit from root tenant)
- Super Admin & "Staff" roles
- Auditing
If anyone's interested in the open source app, follow here - https://twitter.com/tools_hub