Groups Flows
Groups provide a shared space for members to deliberate on constitutions and proposals.
Pages
/groups— Lists groups and opens the Create Group dialog./groups/[id]— Group details, invite code, member list, and proposal activity.
Create Group Flow
- Open
/groupsand click Create Group. - Enter a required
nameand optional description. - The client sends
POST /api/groupswith{ name, description? }. - On success, the creator is inserted as
ADMINand the UI routes to/groups/[id].
Group Detail Flow
- The page loads
GET /api/groups/[id]. - Response data includes members, constitutions, clauses, proposals, proposal votes, and comments.
- The invite code is shown and can be copied from the UI.
Membership Flow
Joining is API-driven using POST /api/groups/[id]/joinwith { inviteCode }.
- New members are created with role
VOTER. - If the user is already in the group, the endpoint returns
{ message: "Already a member" }.
Proposal Deliberation Flow
Proposal cards in /groups/[id] call these endpoints:
POST /api/proposals/[id]/votewith{ choice, reason? }.POST /api/proposals/[id]/commentwith{ content, parentId? }.PATCH /api/proposals/[id]with{ action: "move-to-voting" }or{ action: "ratify" }.
Current Implementation Notes
GET /api/groupsandGET /api/groups/[id]do not currently enforce authentication.- The Create Group Constitution action calls
POST /api/constitutionswith title/description only; it does not currently sendgroupId.