A simple serverless poll management system built with Bun.
Polls are managed using a hash generated by compressing a UUIDv7 and choices with lz-string:
LZString.compressToEncodedURIComponent(Bun.randomUUIDv7() + "|choice1|choice2|choice3")The hash contains a UUIDv7 (unique poll identifier) and the poll choices separated by | (pipe).
Generate a poll URL by creating a hash with the format:
https://yourdomain.com/vote#<LZString-compressed-hash>
For example, to create a poll with choices "Yes", "No", "Maybe":
const hash = LZString.compressToEncodedURIComponent(
Bun.randomUUIDv7() + "|Yes|No|Maybe"
);
// Result: e.g., "XkxjKx..." (compressed string)
// URL: https://yourdomain.com/#XkxjKx..."Visit the poll URL. Each choice appears as a button. Click to vote. Votes are stored in the server's SQLite database.
Visit the result page at:
https://yourdomain.com/result#<same-hash>
Results show vote counts and percentages, refreshing automatically every second.
docker run -it -d -v "./data":"/usr/src/app/data" -p 1337:3000 gouz/pollux bun install
bun run src/index.tsThen visit http://localhost:3000/vote#<hash> to create and test polls.