learnhubmk / link-me

3 stars 1 forks source link

Add basic community model and relations with users #13 #14

Closed ddimkovikj closed 5 months ago

RevanchistX commented 6 months ago

Hey @emorevival I checked the implementation - everything looks great, except few things that don't make sense to me:

  1. Community name should have minimum character length of 2, since otherwise people would be able to create communities with empty or 1 letter names.
  2. Community UID - I guess this is more question for @ddimkovikj, but who will be adding the communities to the system? If it's admin/moderator, then fine, but we need to automate this system somehow, since generating manual UIDs via the form seems like it would lead to inconsistencies and errors.
  3. Same goes for the following fields: approved_by, approved_at, members and submitted_by. I found this example that can help us automate these values, but it should be discussed in more detail. https://forum.strapi.io/t/how-can-i-set-the-default-value-for-a-date-to-be-today/15326/5
  4. I assume there will be also an alternative way to add communities/users from the svelte app vie an endpoint. Do we need a special role for doing this? Do we need additional roles for any of the interactions that will be happening between the applications? (e.g. approving members, communities ... etc)
ddimkovikj commented 6 months ago
  1. We can go with the default id fields that Strapi offers when creating the models. These are autogenerated by design, I believe, and can not be avoided nor changed.
  2. Yes, that's good approach, at least for the default values.
  3. Yes, users can propose new communities (create in our case), while moderators approve/publish them(edit in this case). https://strapi.io/blog/strapi-internals-customizing-the-backend-part-1-models-controllers-and-routes

Then, we'll need to protect the create community API with user role, and protect the edit community route with moderator role. https://strapi.io/blog/strapi-internals-customizing-the-backend-part-2-policies-webhooks

@RevanchistX