A Telegram bot to practice for the US citizenship civics quiz
Find a file
2023-04-24 21:00:53 -06:00
.idea Persist data in PostgreSQL database 2023-01-25 21:49:24 -07:00
gradle/wrapper Bump Gradle wrapper version 2023-04-18 17:53:18 -06:00
src Add a couple of logging statements 2023-04-24 21:00:53 -06:00
.gitignore Initial commit 2023-01-23 21:48:52 -07:00
build.gradle.kts Add scheduled reminders 2023-01-26 21:26:59 -07:00
docker-compose.yml Add Dockerfile and sample docker-compose.yml 2023-01-25 22:00:58 -07:00
Dockerfile Add Dockerfile and sample docker-compose.yml 2023-01-25 22:00:58 -07:00
gradlew Initial commit 2023-01-23 21:48:52 -07:00
gradlew.bat Initial commit 2023-01-23 21:48:52 -07:00
LICENSE Create LICENSE 2023-01-29 09:57:34 -07:00
README.md Add README 2023-01-29 09:58:00 -07:00
settings.gradle.kts Initial commit 2023-01-23 21:48:52 -07:00

Civics Quiz Bot

This is a small project I put together to help my wife study for her US Civics Exam. It's essentially a flashcards app, with the following features:

  • automatic question updates
  • spaced repetition
  • scheduled reminders

Usage

Prerequisites

Building

Gradle

The project uses gradle. You can build a JAR file with the following command:

./gradlew shadowJar

You can then run it with the following command:

java -jar build/libs/civics-quiz-bot.jar

Docker

There is also a Dockerfile included. If you'd like to use that instead, you can run the following command:

docker build -t civics-quiz-bot .

You can then run it with the following command:

docker run civics-quiz-bot

Configuration

Regardless of how you build the JAR, there are a few configuration options that need to be set via environment variables.

Environment Variable Default Value Description
TELEGRAM_TOKEN Telegram bot token
CIVICS_DB_HOST localhost Hostname for PostgreSQL server
CIVICS_DB_PORT 5432 Port for PostgreSQL server
CIVICS_DB_USER postgres Username for PostgreSQL server
CIVICS_DB_PASSWORD postgres Password for PostgreSQL server