Project Web Polling — Architecture and Implementation
> Project Web Polling > Architecture and Implementation
Implementation
- Sever built with Python/Flask.
- Client built with HTML/JavaScript/Svelte.
Messages / Events
-
[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}[] }
-
[Server] --> (Poll) --> [Client]
- SSE Stream
- Type: NewPollEvent
- Payload: same as in ‘Poll’ from Client-to-Server above
-
[Client] --> (Vote) --> [Server]
- Basic Post request (has a RemoteAddr)
- Payload: FormData
-
[Server] --> (VotingResult) --> [Client]
- SSE Stream
- Type: VotingResult
- Payload: JSON
{option_id:string|NULL, votes:number}[]
option_id
isNULL
when interim result is maskedvotes
number of votes