Skip to content

Voterra

Voterra is a Java web application for live audience voting during online sessions. An administrator loads a prepared question set, activates one question at a time, and participants vote from their browsers without passwords.

The server provides both the participant page and the admin console. Participants enter their first and last name, wait for an active question, and can change their answer until the countdown ends. After the timeout, the page shows the aggregated result. If a question has marked correct answers, the result view highlights correct options with a green border and incorrect options with a red border. The admin console is available at /admin.

Technology

  • Java 24
  • Maven
  • JDK HttpServer
  • Jackson for JSON
  • SLF4J with Log4j 2 for logging
  • JUnit Jupiter for tests

The application does not use Spring or Quarkus.

Question File

Pass the question file path with --questions-json-file. The file contains an array of questions:

[
  {
    "id": "q1",
    "text": "Which Java version should this project target?",
    "multipleChoice": false,
    "durationSeconds": 30,
    "options": [
      {"id": "java21", "text": "Java 21", "valid": false},
      {"id": "java24", "text": "Java 24", "valid": true},
      {"id": "java25", "text": "Java 25", "valid": false}
    ]
  }
]

Rules:

  • Each question must have 2 to 6 options.
  • multipleChoice: false means participants can choose one option.
  • multipleChoice: true means participants can choose more than one option.
  • durationSeconds is optional. The default is 30 seconds.
  • valid is optional on each option. Use valid: true for correct answers and valid: false for incorrect answers.
  • If at least one option has valid: true, every option without valid is treated as incorrect for that question.
  • If no option has valid: true, the question is treated as a statistics-only question. Participant results do not show green or red validity borders.

The admin console always shows option validity where options are visible:

  • correct options have a green border;
  • incorrect options have a red border;
  • statistics-only options have no validity border.

Participants see validity borders only after the question closes. They do not see correct answers while voting is open.

See sample-questions.json for a working example.

Production Run

Build the runnable JAR:

mvn -q package

Run the server:

java -jar target/voterra-server-1.0.jar --admin-password "secret" --questions-json-file sample-questions.json

Open:

  • Participant page: http://localhost:8080/
  • Admin console: http://localhost:8080/admin

Optional arguments:

  • --port 9090 changes the HTTP port. The default is 8080.
  • --results-json-file /path/to/results.json changes the results file path. The default is results.json.

The application writes logs to the console and to all-logs.log at DEBUG level. Finished voting sessions are appended to the results JSON file with the voting session start timestamp.

Local Development

Run the test suite:

mvn -q test

Run the app locally with the sample questions:

mvn -q package
java -jar target/voterra-server-1.0.jar \
  --admin-password secret \
  --questions-json-file sample-questions.json

During local testing, use:

  • Participant page: http://localhost:8080/
  • Admin console: http://localhost:8080/admin
  • Admin password: secret

Stop the server with Ctrl+C.

About

Web App (Client + Server) to organize real-time voting during online sessions

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages