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.
- 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.
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: falsemeans participants can choose one option.multipleChoice: truemeans participants can choose more than one option.durationSecondsis optional. The default is 30 seconds.validis optional on each option. Usevalid: truefor correct answers andvalid: falsefor incorrect answers.- If at least one option has
valid: true, every option withoutvalidis 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.
Build the runnable JAR:
mvn -q packageRun the server:
java -jar target/voterra-server-1.0.jar --admin-password "secret" --questions-json-file sample-questions.jsonOpen:
- Participant page:
http://localhost:8080/ - Admin console:
http://localhost:8080/admin
Optional arguments:
--port 9090changes the HTTP port. The default is8080.--results-json-file /path/to/results.jsonchanges the results file path. The default isresults.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.
Run the test suite:
mvn -q testRun 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.jsonDuring local testing, use:
- Participant page:
http://localhost:8080/ - Admin console:
http://localhost:8080/admin - Admin password:
secret
Stop the server with Ctrl+C.