Household budget tracker: sections for incomes, bills, debt, essentials, subscriptions. FastAPI + HTMX + SQLite.
Find a file
archeious a492294dd7 feat(ops): add backup-db.sh for safe sqlite snapshots
Uses sqlite3.Connection.backup for an online, WAL-safe copy. Resolves
the DB path from QUARTERMASTER_DB_URL or ./quartermaster.db, places
the snapshot in <db-dir>/backups (override with QUARTERMASTER_BACKUP_DIR),
timestamps the filename, and tags it with an optional reason slug.
Absent DB file is a soft exit so the script is safe to call from hooks.

Refs #5

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 11:51:46 -06:00
alembic feat(db): add Entry and DebtTarget models with initial migration 2026-04-17 11:04:06 -06:00
scripts feat(ops): add backup-db.sh for safe sqlite snapshots 2026-04-17 11:51:46 -06:00
src/quartermaster feat(ui): stacked tabular layout, drop card look 2026-04-17 11:21:48 -06:00
tests test: cover CRUD, debt target selection, and ON DELETE SET NULL 2026-04-17 11:04:18 -06:00
.gitignore feat(ops): add backup-db.sh for safe sqlite snapshots 2026-04-17 11:51:46 -06:00
.python-version chore: init uv project with FastAPI, SQLAlchemy, Alembic 2026-04-17 11:03:59 -06:00
alembic.ini feat(db): add Entry and DebtTarget models with initial migration 2026-04-17 11:04:06 -06:00
LICENSE Initial commit 2026-04-17 10:57:47 -06:00
pyproject.toml chore: init uv project with FastAPI, SQLAlchemy, Alembic 2026-04-17 11:03:59 -06:00
README.md docs: expand README with setup, run, tests, and layout 2026-04-17 11:04:21 -06:00
uv.lock chore: init uv project with FastAPI, SQLAlchemy, Alembic 2026-04-17 11:03:59 -06:00

quartermaster

Household budget tracker. FastAPI + HTMX frontend, SQLite backend.

Sections

The budget page shows one card per section. Every section accepts a name and amount per entry and displays a running total, except Primary Debt Target, which is a pointer to one of the Debt Minimums rows.

  • Incomes
  • Fixed Amount Bills
  • Debt Minimums
  • Primary Debt Target (pointer)
  • Food and Essentials
  • Subscriptions
  • Other

Requirements

  • Python 3.12+
  • uv for dependency management

Setup

uv sync
uv run alembic upgrade head

The SQLite file lives at ./quartermaster.db by default. Override with the QUARTERMASTER_DB_URL environment variable (any SQLAlchemy URL).

Run

uv run uvicorn quartermaster.main:app --reload

Open http://127.0.0.1:8000.

Tests

uv run pytest

Tests run against an in-memory SQLite database; no migration step needed.

Project Layout

src/quartermaster/
  main.py         FastAPI app factory
  routes.py       HTTP handlers, HTMX partials
  service.py      Queries, totals, target logic
  models.py       SQLAlchemy models and Section enum
  db.py           Engine, session, PRAGMA foreign_keys=ON
  config.py       DB URL resolution
  templates/      Jinja2 templates (base, index, partials)
  static/         CSS
alembic/          Migrations
tests/            pytest suite

Scope

Single-month budget. Multi-month support is planned for a later milestone and is intentionally not modelled yet.