Core voting functionality: participants can add options to a poll and cast votes. Supports both anonymous and non-anonymous modes as configured at poll creation. Votes are sent to the poll owner via PeerJS.
Design
Adding Options
Participants and above can add options while the poll is open
Options have text only (keep it simple)
Owner validates the sender has permission before accepting
Casting Votes
V1: single-choice (one vote per participant). Data model uses optionId: string which can later be extended to optionIds: string[] for multi-choice or a ranked array for ranked-choice.
Vote is signed with voter's private key for authenticity
In anonymous mode: owner records the vote but strips voterId before storing
In non-anonymous mode: voterId is stored alongside the vote
Vote changes: a participant can change their vote while the poll is open (replaces previous)
Results
Results are visible to all roles (viewers included)