Project Web Polling — Architecture and Implementation

> Project Web Polling > Architecture and Implementation

Implementation

Messages / Events

  1. [Operator] --> (Poll) --> [Server]

    • HTTP Post request
    • Sent when the operator starts a new poll
    • Will result in a NewPollEvent being sent to the clients
    • Payload: JSON {title:string, description:string, options: {option_id:string, label:string}[] }
  2. [Server] --> (Poll) --> [Client]

    • SSE Stream
    • Type: NewPollEvent
    • Payload: same as in ‘Poll’ from Client-to-Server above
  3. [Client] --> (Vote) --> [Server]

    • Basic Post request (has a RemoteAddr)
    • Payload: FormData
  4. [Server] --> (VotingResult) --> [Client]

    • SSE Stream
    • Type: VotingResult
    • Payload: JSON {option_id:string|NULL, votes:number}[]
      • option_id is NULL when interim result is masked
      • votes number of votes