Add pedigree lookup and ancestry tree page

New 🌳 Pedigree view: enter a dog's ISO chip or SKK registration number
and see its ancestry rendered as a tree. SKK has no public API, so the
server drives SKK Hunddata like a browser: it resolves the input to an
internal hundid via the Hund_sok.aspx/HundData page-method, renders 7
generations per pedigree page, parses the rowspan grid into ahnentafel
positions, and follows each generation's leaves deeper by reading their
hundid out of the __doPostBack response viewstate.

A lookup returns the first 7 generations immediately and crawls deeper in
the background; the client polls and fills the tree in as ancestors
arrive. Finished trees are cached per dog in a new pedigree_cache table
(pedigrees don't change), so a dog is crawled once and repeats are instant.
The endpoints sit behind auth like the rest of /api/*, and the crawl is
kept polite (warmed session, delay between requests, one coalesced job per
dog, hard caps).
This commit is contained in:
Alexander Heldt
2026-07-26 09:22:14 +00:00
parent 374e630d8f
commit 26ebe3bd86
11 changed files with 1458 additions and 1 deletions
+16
View File
@@ -94,6 +94,22 @@ events, profile and photos.
when you pass `-secure-cookies` (enable it behind a TLS proxy), so passwords
aren't sent in the clear.
## Pedigree lookup
The 🌳 page looks up a dog in **SKK Hunddata** by ISO chip number or
registration number and renders its ancestry as a tree.
- SKK has no public API, so the server drives the interactive site the way a
browser would: it resolves the input to SKK's internal dog id, fetches the
pedigree page (7 generations per request), and follows each generation's leaves
deeper. A lookup returns the first generations immediately and keeps crawling in
the background; the client polls and fills the tree in as ancestors arrive.
- Because a deep crawl is dozens of sequential upstream requests, finished trees
are cached per dog in the `pedigree_cache` table (pedigrees don't change), so a
dog is only ever crawled once and repeat lookups are instant.
- The lookup is behind auth like the rest of `/api/*`, and is **online-only**
it needs to reach SKK.
## Use it on NixOS
In your system flake: