Rust/Axum + Askama web server for Nazarene Bible quizzing question pools with tiered access control.
- Rust 2021
- Axum 0.7
- Askama templates
- SQLx + PostgreSQL
- Vanilla HTML/CSS/JS frontend
- Session login with Argon2 password verification
- CSRF token checks on mutating API endpoints
- Login attempt throttling
- Tier-based pool visibility with inherited lower-tier access
- Admin endpoints and UI for pool upload, tier creation, and user creation
- Audit logging for login/logout, generation, pool upload, tier creation, user creation
- Seeded generation mode for deterministic output
standard: 20-question set rules:- 1 Situation or 1 In-What-Book-and-Chapter
- 1 Quote, 1 Reference, 1 Verse, 1 Context
- 4 According-To
- Remaining as General
- Chapter usage cap and replacement rounds with final reshuffle
allor specific type name: random sample mode
Copy .env.example to .env, then optionally add an environment-specific override file:
APP_ENV(development,testing, or any custom profile name)DATABASE_URLBIND_ADDRADMIN_USERNAMEADMIN_PASSWORDCOOKIE_SECURE
Runtime loading order:
.env.env.<APP_ENV>(overrides.envvalues)
Shell environment variables always win over file values. This means you can compile once on a dev machine and run the same binary on prod with different database credentials by changing env vars or profile files.
Examples:
.env.development.example.env.testing.example
Copy these to .env.development and .env.testing as needed.
PostgreSQL tools required:
- Arch Linux:
sudo pacman -S --needed postgresql - Ubuntu/Debian:
sudo apt-get install postgresql postgresql-client - macOS (Homebrew):
brew install postgresql
Bootstrap helper:
./scripts/setup_dev_test_databases.shSQL equivalent:
psql -U postgres -d postgres -f scripts/create_dev_test_databases.sqlcargo runServer starts at http://127.0.0.1:3000 by default.
APP_ENV=testing cargo testor:
cargo testParity tests are in tests/generator_parity.rs.