jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

Support for multiple users in one web of cards #277

Open jkomoros opened 4 years ago

jkomoros commented 4 years ago

Currently the app assumes that there's one collection of cards, and there's one primary author of them.

But in the future it would be nice for multiple people to be able to collaborate on a web together, and have their own views of the web that highlight their authorship of it.

Way down the road it would be nice if multiple web instances could link to cards in other webs. You'd need some kind of machinery to bridge across them in non-obvious ways.

jkomoros commented 4 years ago

It seems like most webs would be either a single user's primarily (like compendium) or one that multiple people collaborate on together.

Conceptually you can imagine that every user has a single 'section' of their cards. It's akin to their reading list, except it contains the ordered list of all of the cards they authored that they haven't chosen to orphan.

card ID space is tied to a given firestore instance, so given a card ID it can always figure out which one it is. Ideally slugs are tied to a given user space. Or maybe the first user to use a slug gets the unadorned one, and the other ones get a URL that canoicalizes to need to include their username.

The 'all' collection then kind of goes away, and when viewing the app you view it in terms of a given user and their collection. In some cases you might join multiple collections.

Each user gets to choose a display name for their cards.

You can imagine multiple instances of the web app configured differently for different users, but using the same backing store of cards. (Although there's only one firestore.rules, deployed by an admin, and you'd need some way to allow people to change permissions for people for their cards only)

Is the collection of tags shared, or separated by users? users should be able to put other users' cards in their collections. But maybe users own their own tags list. And then if you're viewing a card, it might have username/tag-name tags, that are filtered out or viewed in a different section, e.g. tags_other_authors.

Tag names, section names, and slug names are all notionally tied to the author

jkomoros commented 4 years ago

Is subdomain per owner a way to do it (with the primary instance owner getting the default, non-existent, subdomain)? Do cookies/caching get all weird that way?

jkomoros commented 4 years ago

All of this will make permissions way harder, and downloading cards to the client way harder, because you can't just download all of them.

jkomoros commented 4 years ago

See issue #331 where a lot of work on this theme was done