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
BarcodeDetectorwith 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
| Variable | Description | Default |
|---|---|---|
ADMIN_PASSWORD | Password for admin login | changeme |
LIBRARY_DB_PATH | SQLite database file path | library.sqlite |
GOOGLE_BOOKS_API_KEY | Google Books API key for search | |
BASE_URL | Public base URL | http://localhost:3000 |
HOST | Server bind address | 127.0.0.1 |
PORT | Server port | 3000 |
COOKIE_SECURE | Enable HTTPS-only cookies | false |
LIBRARY_DISPLAY_MODE | Public 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.
Docker
From the repo root:
cp apps/library/.env.example apps/library/.env
# Edit .env with your admin password
docker compose up -d libraryThis 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.
| Page | Description |
|---|---|
/admin | Admin 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
| Endpoint | Description |
|---|---|
GET /api/books | List all books. Filter with ?status=read|reading|want |
GET /api/books/{id} | Fetch a single book by ID |