Looking for Architecture Feedback for "Subrooms"

Hey All,

I’m working on an edutech startup, and we’re using YJS to help people run through content together.

The closest analogy I have is like a house with multiple rooms of people. In order for the next “room” to unlock, everyone in the room must accept.

If new people join the “house” while the majority of the group is ahead, then the entire group needs to wait till the new person catches up through the unlocked doors.

The way I was thinking of having this work was to use a YDoc as the “room”. And then create maps that represent each of the rooms.

Each user has an hasUnlocked state on their awareness info that changes back to false every time they enter a new room. If all users mark themselves as unlocked, the next room unlocks and everyone can proceed, or they must wait till everyone marks themselves as ready.

There is a little bit of complexity with all of the moving properties. It seems reasonable, but also looking for feedback to improve and other ways to making this work. Love the library so far