New third service alongside app/docling - a deliberate, revisited
decision from the documented "no DB" architecture, not an oversight.
pocketbase/Dockerfile - official minimal pattern (no official image
exists), pinned binary, migrations+hooks copied in and run on startup.
pb_migrations/1_create_collections.js - schema as code: users (auth,
self-registration open), projects (owner-scoped), documents (owner-
AND project-scoped - project is REQUIRED, not optional, since a
planned future per-project category-mapping feature needs every
document scoped from day one), with a sourceFile field for the
original PDF/image (stored in R2 once configured).
pb_hooks/ensure_default_project.pb.js - auto-creates each new user's
"General" project (isDefault:true) the moment their account exists -
covers password and Google signup uniformly, guarantees the required
documents.project relation always has somewhere to point.
configure-secrets.sh - the only place R2/Google secrets are handled,
reading from a gitignored .env and PATCHing PocketBase's own REST API.
Never in a migration (those are committed to git).
Frontend: pocketbaseRepository.js (the one SDK instance),
authService.js (login/signup/Google/logout), authStore.js (Pinia,
synced to the SDK's own authStore), LoginView.vue, and App.vue's new
auth gate - talks to PocketBase directly, not proxied through Flask.
Verified via real REST API calls against the running container (not
just read): migrations create the expected collections/rules; a fresh
signup gets exactly one auto-created "General" project; a second
user's token can't see the first user's data; a document created with
no project correctly fails validation (confirming the frontend must
resolve one itself); authService's actual functions exercised via a
live Node script against the real container (signup, hook-created
project visible, logout, re-login). npm run build passes. measure.py
unaffected (no backend code touched).
Not yet verified - needs real R2/Google credentials this session
doesn't have: configure-secrets.sh itself, and the Google OAuth popup
flow (needs a real browser + real Google Cloud OAuth client, both
outside this repo's control - documented as setup prerequisites in
README.md).
This is Stage B.1 of 3 (schema + auth gate). B.2 (document persistence
moves from localStorage to PocketBase) and B.3 (the project sidebar
UI) are not started yet.