Files
README.md

Bücherlotse #

Search the audiobooks and e-books of the eBücherhalle Hamburg (elibraryhh.overdrive.com) by type, language, availability and category. For a given reader's age, Mistral suggests a minimum age per title on the current page; the app compares it with the age. Ratings are cached per book for six months; cover images are cached server-side for 30 days (the CDN URLs are stable per book).

Layout (ports & adapters, enforced by tests/test_architecture.py with pytest-archon):

  • buecherlotse/domain – model and ports (Catalog, AgeRater), no outside imports
  • buecherlotse/application – BookSearch use case, depends only on the domain
  • buecherlotse/adapters
    • overdrive – catalog search and allowlisted cover fetching
    • mistral – minimum-age rating, one isolated request per book
    • cache – SQLite caches in front of the AgeRater (ratings) and the Catalog (cover images)
    • web – Flask UI, cover proxy, Impressum and Datenschutz pages (templates/)
  • buecherlotse/main.py – composition root (configured via MISTRAL_API_KEY, MISTRAL_MODEL, CACHE_PATH, IMPRINT_NAME, IMPRINT_ADDRESS, IMPRINT_EMAIL)

Develop #

nix develop -c pytest
MISTRAL_API_KEY=... nix run .        # http://127.0.0.1:8080, override with BIND=host:port

Deploy (NixOS) #

{
  inputs.buecherlotse.url = "git+https://.../buecherlotse";
  # in your nixosSystem modules:
  imports = [ inputs.buecherlotse.nixosModules.default ];
  services.buecherlotse = {
    enable = true;
    bind = "127.0.0.1:8080";
    environmentFile = "/run/secrets/buecherlotse.env"; # MISTRAL_API_KEY=...
    imprint = { name = "Erika Musterfrau"; address = "Musterstraße 1, 20095 Hamburg"; email = "kontakt@example.org"; };
  };
}