Skip to content
bad-microservicesPublic

About

an anonymous voting web app for intranets

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RS-Polls - Anonymous Polls

A simple, self-hosted polling application for creating and sharing anonymous polls intended for use on your intranet.

The project consists of a Rust backend powered by Actix Web and a SvelteKit frontend.

Polls can be created without user accounts, shared through a link, and managed using an optional management key.

The frontend is embedded into the built Rust application, so you only need the binary and the asset folder for the application to run properly.

Features

  • Create anonymous polls
  • Share polls through a unique URL
  • German and English translations
  • Optional management key for editing and deleting polls
  • Optional one-vote-per-IP restriction
  • Optional voting deadline
  • Option to hide polls from the public overview
  • Dark and light themes based on the operating system theme

The frontend is responsible for the user interface and communicates with the backend through the API.

The backend handles poll creation, management, voting, validation, and persistence.

Management

Poll creators can optionally provide a management key when creating a poll.

The management key can later be used to:

  • Edit the poll
  • Modify poll options
  • Add new options
  • Remove options
  • Delete the poll

The management key is separate from the public poll URL.

If no management key is provided, the poll cannot be managed through the management interface.

Important: If you remove a poll option, all votes for that option will be removed as well!

Voting Restrictions

Polls can optionally restrict voting to one vote per IP address.

When enabled:

unique_vote_per_ip = true

the backend prevents multiple votes from the same IP address according to the application's configured voting logic.

IP-based restrictions should not be considered a perfect identity system. Multiple users can share an IP address, while a single user can potentially use different IP addresses.

Poll Expiration

Polls can optionally have a voting deadline.

For example:

2026-12-31T23:59:59

Once the deadline has passed, the poll is considered expired and additional votes are rejected.

The frontend displays the poll as closed and prevents further voting.

Note

The backend uses chrono::NaiveDateTime, so things can get a little wonky if you have users in multiple time zones!

Hidden Polls

A poll can optionally be hidden from the public poll overview.

A hidden poll can still be accessed using its direct URL.

This allows users to create polls that are intended to be shared privately without appearing in the public list.

Configuration

The backend uses a TOML file for configuration. The repository contains an example config.toml file which you can modify according to your environment.

You can specify the configuration file by using the --config CLI option.

Example:

listening_ip = "localhost"
port = 8081
behind_proxy = false

[db_config]
proto = "mysql"
server = "localhost"
port = 3306
username = "tester"
password = "tester"
db = "testdb"

Internationalization

The frontend currently supports:

  • German (de)
  • English (en)

Translation files are located at:

frontend/src/lib/i18n/

New languages can be added by creating another translation file and adding the locale to the application's supported translations.

For example:

fr.json

The corresponding URLs would then use:

/ui/fr/...

The new language key also needs to be added to the entries function in the following files:

/frontend/[lang]/+page.js
/frontend/[lang]/create/+page.js

This is required for prerendering to work correctly.

Todo

  • Input Validation
    • currently only the frontend prohibits you from creating a poll with an empty name...

Screenshots

Poll Overview

Poll overview

Poll overview

Create a Poll

Create poll

Poll

Poll

Poll

Poll

Attributions

About

an anonymous voting web app for intranets

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages