Authors, books with real per-title copy counts, borrowers, and transactional checkout/return — a small, layered Go service with real validation, JWT-protected writes, and full test coverage. No ORM, no magic.
Every layer does exactly one job — nothing borrowed from a framework it doesn't need.
handler → service → repository, each with its own tests. No handler ever touches SQL; no service ever touches the network.
Every GET is public — a catalog is meant to be browsed. Every POST/PUT/DELETE requires a bearer token, checked by dedicated middleware.
Books track total and available copies, not a single boolean — a race-safe `UPDATE ... WHERE available_copies > 0` guards every checkout.
Request DTOs are separate from domain models and struct-tag validated — mass assignment into DB models is structurally impossible.
The same binary is a server, a one-shot CLI, and an interactive shell — all three talk to the REST API the same way.
Real in-memory SQLite, not mocks — repository, service, and full HTTP-through-middleware handler tests, race-checked.
No arguments runs the server. A subcommand makes it a CLI or REPL client of that same API.
go run ./cmd/api
go run ./cmd/api books list
go run ./cmd/api repl library> books list