When having a page, like a Facebook page, should such page be a team or a database document? Same example with discord. Channels should be teams or documents?
If I'm not wrong, you can't see or join yourself the team, so it's going to be impossible to save the team (so then you are not able to save the pages/channels)
Hey π Ill take example of Discord server as I am familiar with that.
First, I would make a servers
collections, and a document for each server. This allow features such as Server Discovery, and allows you to store info about server such as Name, Invite URL, description, Image ID, default channel, rules, ...
Notice how we used Database purely to store and display data.
Next I would start using Teams and introduce a team for each server. When user joins a server (and accepts rules), only then I would add him to the server's team. Then, for every message in this server, I would give read permissions to server's team. That way, you cannot see those messages until you join server and accept rules. Notice how I used Teams for permissions (security) reasons.
Ok, I understand. I suppose it could be even more efficient enabling read permission by default and teams for other permission, being needed to join the team to manage the server
Could be π You can also use rules of a team for this. for example: member - can read trusted - can also write mods - can also manage server owner - can also invite mods
Ok, thanks. And to retrieve the saved servers, that's made through teams? Or another separate collection
I think using Teams would be a smart way to do it. An user can list all teams they are part of. If you keep Team ID and Server Document ID exactly the same, you can list your memberships (teams you are part of) and know server IDs
Tho if you need IDs to be different, there is nothing wrong having a separate collection to know which server you are part of. This would also allow you to change and save order of servers in the left panel
Ok, I think I will choose the second option, since you can't join yourself a team, and then reserve teams for admin chanel/mod/owner
Recommended threads
- Seed db
hello there... is this correct way to seed appwrite
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...