pdf-quiz-generator/docs
Daniel 4ca7f6b1f2 feat: Cap replaces hCaptcha, self-hosted beside the app
Proof-of-work rather than a puzzle, and — the reason for it — nothing
about the person signing up is described to a third party in order to let
them in. Turnstile and then hCaptcha were both here; both told Cloudflare
who was at the door.

The `cap` service runs on the compose network with its own Redis
database, kept apart from the app's so a flush of one cannot clear the
other's challenges. The widget talks to /cap/ on this origin, proxied by
the frontend's nginx, so the browser reaches nobody else either. Caddy
passes the whole host through to that container, so it needed no change.

Two things that had to be found rather than read:

Cap's key API is undocumented. The routes are `/auth/login` and
`/server/keys`, and the Bearer value is base64 JSON of `{token, hash}` —
not the session token itself, which is why the obvious call returns
"Malformed session token". The site key and secret were created that way
rather than by hand in a dashboard.

And an nginx proxy_pass whose target is a variable passes the URI through
untouched: the trailing slash that strips a location prefix on a literal
target does nothing. Cap was being asked for /cap/<key>/challenge and
answering NOT_FOUND until the prefix was stripped by an explicit rewrite.

Verified end to end against the running service: a challenge is issued
through the public path, and a token that was never issued is refused
rather than waved through.

Also here: the register modal's Name and Email were bare labels that
neither wrapped their input nor named it, so a screen reader met two
boxes with no names and clicking the word did nothing.

And the knowledge profile paginates ten to a page and expands each row to
its two bars beside the next step. "Correct using hints" is missing from
that bar because /study-tools/recommendations does not carry it per
topic — inferring it from the lifetime figure would be a different set of
answers, so the bar is honestly two-tone until the backend offers it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-12 06:14:14 +02:00
..
quiz-revamp feat: authorize tutor context and protect uploaded media 2026-09-07 15:04:00 +02:00
adaptive-sessions.md feat: adaptive weighs the paper as well as the learner, and Session 2026-09-12 05:54:09 +02:00
api-reference.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
architecture.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
deployment.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
frontend.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
migrations.md fix: gateway-agnostic URL handling for TTS and embeddings, docs cleanup 2026-04-19 02:17:35 +02:00
quiz-revamp-plan.md docs: sync backlog with what shipped today 2026-09-09 20:11:20 +02:00
quiz-revamp-progress.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
README.md feat: a solid highlight, a five-minute warning, and the adaptive algorithm 2026-09-12 05:47:30 +02:00
services.md Improve quiz TTS and Android release build 2026-05-12 01:01:01 +02:00
study-recommendations.md fix: leaving and resuming take one press; session actions sit with the result 2026-09-11 23:03:09 +02:00
tied-conditions.md chore: merge the 99 duplicated conditions that had a clear home 2026-09-11 13:37:35 +02:00
TODO.md feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00

PedsHub Documentation

Deep technical documentation for the PedsHub pediatric learning platform.

Pages

Document Description
Architecture System overview, database schema, multi-worker setup, vector search, auth, rate limiting, concurrent quiz protection
API Reference Every endpoint: method, path, auth, request/response, notes
Services Backend service layer: AI extraction, embedding, vector search, PDF processing, email, reminders
Frontend React app structure, pages, components, state patterns, runtime config
Deployment Docker setup, environment variables, HTTPS, rebuilding, monitoring, troubleshooting, scaling
Adaptive sessions What the Adaptive toggle selects, where the code is, and what it deliberately ignores
Study recommendations How focus areas are ranked and what readiness means