Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPIC: groups: how to collaborate with one or more people #220

Open
17 tasks
nelsonic opened this issue Oct 4, 2022 · 10 comments
Open
17 tasks

EPIC: groups: how to collaborate with one or more people #220

nelsonic opened this issue Oct 4, 2022 · 10 comments
Assignees
Labels
discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-1 Highest priority issue. This is costing us money every minute that passes. T1d Time Estimate 1 Day technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Oct 4, 2022

Story

As a person wanting to collaborate with others,
I want a way to create a group
that I can add people to
and then share a list of items with
So that I can keep track of who sees, can edit and work on what items.

Note: the initial "MVP" version of this feature is just a basic group that has 1 or more people.
No permissions, complex RBAC, LDAP or other "Enterprise" features, yet!
We can iterate from our simple version and add more advanced/complex features later.
For now we just need something we can start using internally and collect feedback from ourselves.

Todo

  • When a person first tries to share an item or list (of items) in the App,
    • Automatically and transparently create a new group for them with their name as the group.name
    • Inviting someone to collaborate on an item will automatically add them to the group
    • Once the initial share has occurred, we can inform the person:
      🤖 "By the way I created this group for you and you can add more people to it by visiting: /groups/:id"
  • Create endpoint to manage groups.
  • Create an interface to allow people to manually create a new group

Proposed Schema (please comment/discuss!)

group

  • name: Fields.Encrypted - the name of the group.
  • description: Fields.Encrypted - the description
  • kind: String - e.g. family, friends, personal, sports, work, etc. - we will have default kinds that can help the person to categorise their group; we could consider making this a free-text field in the future or adding more kinds via Pull Request (so they are hard-coded) because, let's be fair, there are't that many kinds of group we will need.

group_members

The lookup table that lists the people who are members of a group

  • group_id Int fk: the id of the group
  • person_id Int: the person.id of the person in the group
  • inserted_at DateTime: default Phoenix field for the insertion of a record.
  • admin Bool: if the person can administer (add/remove others from) the group
  • added_by Int: the person.id of the person who added the member to the group
  • removed DateTime: default:null the date when a person is removed from a group (it happens ...)
  • removed_by Int: default:null the person.id that removed this person from the group

Features

  • Build mini SPA for creating/managing groups using LivView:

@SimonLab thoughts? Am I missing anything? Am I over-complicating it? or is this "just enough" to get started? Thanks! 🙏

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! discuss Share your constructive thoughts on how to make progress with this issue priority-1 Highest priority issue. This is costing us money every minute that passes. technical A technical issue that requires understanding of the code, infrastructure or dependencies T1d Time Estimate 1 Day labels Oct 4, 2022
@SimonLab
Copy link
Member

SimonLab commented Oct 4, 2022

When a person first tries to share an item or list (of items) in the App,

Here is how I view the relations between items, lists and groups

  • An item must belongs to a list. Depending on the UI, the user can create manually the default list or we can create it automatically when the first item is created. We might want to review what we want to display on the main page now that we will have groups, lists and items
  • There is a many_to_many relationship between list and group (a list can belongs to many groups, and a group has many lists) (or do we only want to have a list belonging to only one group?)
  • A group as many person, and a person has many groups.

So from the issue above, I would add the list and person table/schema.
The person table as for primary key the id already returned by the auth app, however we need to add a name unique field to allow

Inviting someone to collaborate on an item will automatically add them to the group

@nelsonic
Copy link
Member Author

nelsonic commented Oct 5, 2022

@SimonLab agreed. These should all be many-to-many relationships. ✅
for now an item is "owned" by a single person 🥇
but when that item gets added to a list (or more than one list) and shared with a group, 👥
it can be edited by anyone in the group. 📝

We only need a people schema/table in the sense that it's a Foreign Key of these other tables. 🔑
but otherwise we could continue not having the people table. 💭

I think in terms of building an MVP, the buildit.md log
makes it clear that we didn't need the people schema/table until now,
but as the App evolves, we are beginning to need it. 💭

@SimonLab
Copy link
Member

SimonLab commented Oct 5, 2022

I've created the following PR dwyl/mvp#162 which created the people table and person schema.
This table contains the name field which will be used to search and share items with other people.

The next step is to create the list and group structure, as we mentioned this morning on our call an item belongs to many list and a list can belongs to many groups (ie many_to_many relations between items-list and list-group)

@nelsonic
Copy link
Member Author

@SimonLab on further reflection, groups is the domain of auth application. 👤
Yes, it will be used in the App/MVP, 👌
but it relates to people which are the domain of the auth App. 🫂
Duplicating the people table in the App/MVP is "mixing concerns" ...

Instead we need to:

  1. Create groups and group_members in the auth App. 🆕
  2. Create an excellent UI/UX for adding people to a group. ➕
  3. Add a new field gids ("group ids") to the JWT returned when someone signs in with auth
  4. Use the gids in the MVP. 📱
  5. Create a GET /groups REST API endpoint in auth that accepts a JWT as Auth Token
    and returns an Array [using JS parlance as the response will be JSON] of groups that person is a member of:
  • Group IDs
  • Group Names
  • Array of Members with their:
    • id: int
    • admin: boolean
    • name: string

Sample data response:

[
{
  "gid": 1,
  "name": "DwylTeam",
  "members": [
    { 
      "pid": 1,
      "name": "Alex",
      "admin" true
    },
    { 
      "pid": 2,
      "name": "Jane",
      "admin" false
    },
  ],
},
{
  "gid": 2,
  "name": "FootballSquad",
  "members": [
    { 
      "pid": 1,
      "name": "Alex",
      "admin" false
    },
    { 
      "pid": 2,
      "name": "Jo",
      "admin" true
    },
  ],
}
]

This way the App/MVP does not store any personally identifiable information
and is focussed on one thing: getting things done.
Whereas auth which already handles personal data will manage groups and group_members.

@nelsonic nelsonic changed the title groups: how to collaborate on items with one or more people EPIC: groups: how to collaborate on items with one or more people Oct 10, 2022
@nelsonic nelsonic changed the title EPIC: groups: how to collaborate on items with one or more people EPIC: groups: how to collaborate with one or more people Oct 10, 2022
@nelsonic nelsonic transferred this issue from dwyl/app Oct 10, 2022
This was referenced Oct 10, 2022
@nelsonic nelsonic self-assigned this Oct 14, 2022
@nelsonic
Copy link
Member Author

Making an attempt to write this up in the BUILDIT.md dev log ... ✍️

@nelsonic
Copy link
Member Author

Minor side-track: #229

@nelsonic
Copy link
Member Author

Next side-quest: #230

@nelsonic
Copy link
Member Author

@nelsonic
Copy link
Member Author

Rather than import all of font awesome ... 🤷‍♂️
Just going to in-line the SVG for the icons we need from https://heroicons.com e.g:
heroicons-group

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
  <path fill-rule="evenodd" d="M8.25 6.75a3.75 3.75 0 117.5 0 3.75 3.75 0 01-7.5 0zM15.75 9.75a3 3 0 116 
0 3 3 0 01-6 0zM2.25 9.75a3 3 0 116 0 3 3 0 01-6 0zM6.31 15.117A6.745 6.745 0 0112 12a6.745 6.745 0 
016.709 7.498.75.75 0 01-.372.568A12.696 12.696 0 0112 21.75c-2.305 0-4.47-.612-6.337-1.684a.75.75 
0 01-.372-.568  6.787 6.787 0 011.019-4.38z" clip-rule="evenodd" />
  <path d="M5.082 14.254a8.287 8.287 0 00-1.308 5.135 9.687 9.687 0 01-1.764-.44l-.115-.04a.563.563 
  0 01-.373-.487l-.01-.121a3.75 3.75 0 013.57-4.047zM20.226 19.389a8.287 8.287 0 00-1.308-5.135 
  3.75 3.75 0 013.57 4.047l-.01.121a.563.563 0 01-.373.486l-.115.04c-.567.2-1.156.349-1.764.441z" />
</svg>

group-icon-png

@nelsonic
Copy link
Member Author

Reeeeeeeally want to get back to this ... ⏳ 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-1 Highest priority issue. This is costing us money every minute that passes. T1d Time Estimate 1 Day technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants