Use case · Developers
A translation pipeline you can actually read.
Book Fork is MIT-licensed and built to be understood: clean layers, one adapter per provider protocol, business configuration as data, and a worker you can run alongside anything.
Composed, not tangled.
The HTTP layer validates, authorizes and renders; services orchestrate; repositories own PocketBase REST; provider adapters know nothing about PocketBase; the worker never imports a template. Raw PocketBase calls live in exactly one module, and everything is composed once at startup rather than through module-level globals.
If you hate if language == "fa", this is the codebase for you. There is a hardcoding audit in the repository that lists every pattern searched for and why each hit is not behaviour.
The parts you will touch.
Add a provider protocol
One adapter behind the provider interface. Anthropic, Gemini, Azure or anything else — the translation engine is untouched.
Add a document format
Implement the parser/exporter protocol and register it. Translation, review and export work on the canonical model, not on your format's internals.
Change a default
Seeds and system settings, not code. Languages, prices, limits, prompts and retention are records.
Boring infrastructure, on purpose.
No Redis, no message broker, no SPA framework. PocketBase is the single data authority and the job store; the worker claims jobs with leases. Storage is local or S3-compatible behind one protocol. The UI is server-rendered Jinja2 plus HTMX, so there is very little client-side state to reason about.
- Python 3.14, FastAPI, Pydantic v2
- PocketBase for data, identity and the job store
- Local or S3-compatible storage
- Docker Compose and systemd units included
uv sync && npm install
cp .env.example .env
uv run python scripts/generate_secrets.py
npm run build
uv run fastapi dev app/main.py # web + API
uv run python -m worker.main # worker, separate terminal
Tests are hermetic and never require a live PocketBase. The check command runs lint, strict mypy and the suite.
What is not there
Book Fork is a server-rendered application, not a public REST API. The JSON surface is GET /api/me, the health endpoints, /metrics and interactive OpenAPI docs outside production. If you need a documented public API to build a product on, this is not that yet.
Clone it and read it.
The architecture, the hardcoding audit and the ADRs are all in the repository.