Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Library

demo of library

A simple, self-hosted book tracker built in Go.

  • Single binary with embedded assets
  • Password authentication with session cookies
  • Track books across Reading, Read, and Want to Read (labels customizable from admin)
  • Google Books search to add titles with cover art and ISBN
  • Barcode scanning for ISBN entry (native BarcodeDetector with ZXing fallback)
  • Library search from the admin page (title / author / ISBN)
  • Toggle between inline category sections and a filter-nav layout via LIBRARY_DISPLAY_MODE
  • Per-book notes
  • JSON API for listing and fetching books
  • Dark themed UI with Commit Mono font
  • SQLite for persistent storage

Configure

Environment Variables

VariableDescriptionDefault
ADMIN_PASSWORDPassword for admin loginchangeme
LIBRARY_DB_PATHSQLite database file pathlibrary.sqlite
GOOGLE_BOOKS_API_KEYGoogle Books API key for search
BASE_URLPublic base URLhttp://localhost:3000
HOSTServer bind address127.0.0.1
PORTServer port3000
COOKIE_SECUREEnable HTTPS-only cookiesfalse
LIBRARY_DISPLAY_MODEPublic index layout: inline (stacked sections) or nav (filter buttons in header)inline

The GOOGLE_BOOKS_API_KEY is optional — searches work without it but are rate-limited.

Deploy

Railway

The easiest way to deploy Library is with the one-click Railway template. See the Deploying with Railway guide for a walkthrough of the process. Library requires ADMIN_PASSWORD during the configure step, and optionally GOOGLE_BOOKS_API_KEY for book search.

Deploy on Railway

Docker

From the repo root:

cp apps/library/.env.example apps/library/.env
# Edit .env with your admin password
docker compose up -d library

This will start Library on port 4646 with a persistent volume for the SQLite database.

Binary

Build from source:

cd apps/library && go build .

The resulting binary at ./library is self-contained with all assets embedded. Copy it to your server with a configured .env file and run it directly.

Use

Your library is publicly viewable at /. Layout depends on LIBRARY_DISPLAY_MODE:

  • inline — all non-empty categories rendered as stacked sections on one page.
  • nav — header filter buttons switch between categories via ?category=reading|read|want.

Admin

Log in at /admin/login with your configured password to access the admin pages.

PageDescription
/adminAdmin dashboard listing every book. Supports library search via ?q=... (title / author / ISBN).
/admin/search?q=...Search Google Books to add a title. ISBN field supports barcode scanning.

From the admin dashboard you can change a book's status, save notes, rename category labels, or remove a book.

API

EndpointDescription
GET /api/booksList all books. Filter with ?status=read|reading|want
GET /api/books/{id}Fetch a single book by ID