The backend service for Librarium, a self-hosted, privacy-focused tracker for your physical book, manga, and comic collection. A self-hosted alternative to Libib and similar cloud catalog services. iOS Lite and Librarium Plus (hosted) are on the roadmap.
Go 1.25 · PostgreSQL 16 · River for background jobs · Swagger-generated OpenAPI docs.
⚠︎ Early beta. Things are changing fast, some edges are rough, and self-hosters should expect to read release notes before upgrading.
Part of the Librarium stack:
| Repo | Role |
|---|---|
librarium |
Marketing site at librarium.press, planning docs |
librarium-api ← you are here |
Backend · Go · Postgres · River jobs |
librarium-web |
Web client · React · TypeScript · Tailwind · Vite |
librarium-ios |
Native iOS client · SwiftUI · iOS 26+ (TestFlight) |
librarium-mcp |
MCP server · Go · chat with your library from Claude / Cursor / etc. |
docker compose up -d --buildThe API listens on :8080. A healthy response:
curl http://localhost:8080/healthAPI documentation is served at http://localhost:8080/swagger/index.html once the container is up.
For self-hosting the full stack (api + web + db) see the Deployment section below.
Set in docker-compose.yml for local dev; in production pass via environment or a secrets manager.
| Variable | Purpose | Example |
|---|---|---|
DATABASE_URL |
Postgres DSN | postgres://librarium:librarium@db:5432/librarium?sslmode=disable |
JWT_SECRET |
HMAC secret for auth tokens | any long random string |
LOG_LEVEL |
debug / info / warn / error |
info |
COVER_STORAGE_PATH |
Where cover images are written | /data/covers |
A .env.example file documents the full set.
# rebuild and restart after any Go/migration/swagger change
docker compose up -d --build api
# follow logs
docker compose logs -f api
# regenerate swagger (after editing handler annotations)
make swaggerMigrations live in internal/db/migrations/ and are applied automatically on startup.
Format: YY.MM.revision (e.g. 26.4.0).
YY— two-digit release year.MM— release month, not zero-padded (26.4, not26.04).revision— feature counter within the month, starting at0. Resets to0when the month rolls over.-devsuffix — local, unshipped builds. Never used for released artifacts.
Release history in CHANGELOG.md.
Two supported paths for self-hosting. Both use the multi-arch images published to GHCR — no local build required.
deploy/docker-compose/ contains a compose file that runs db + api + web together using images from GHCR:
cd deploy/docker-compose
cp .env.example .env
# edit .env — set JWT_SECRET and POSTGRES_PASSWORD
docker compose up -dOpen http://localhost:3000. The API is not published externally — it's reached through the web service's nginx proxy at /api.
Two options live under deploy/:
deploy/helm/librarium-api/— Helm chart built on firelabs-helm-common with a CloudNativePGClusterfor Postgres. Use this if you already run CNPG, or want templated values across environments.deploy/kubernetes/— plain manifests (namespace, StatefulSet postgres, ConfigMap, Secret, Deployment, Service, Ingress). Use these if you want to read every knob before applying, or you don't run CNPG.
For the web UI, apply the matching manifests from librarium-web/deploy/kubernetes/ into the same namespace.
In production, pin the image tag (e.g. ghcr.io/fireball1725/librarium-api:26.4.0) rather than using :latest so upgrades are explicit and rollbacks are possible.
Releases are cut from main via the release GitHub Actions workflow (workflow_dispatch). It:
- Computes the next
YY.MM.revisionfrom the latest tag. - Updates
internal/version/version.go, commitsrelease: <version>, tagsv<version>. - Builds a multi-arch Docker image and pushes it to
ghcr.io/fireball1725/librarium-api:<version>and:latest. - Bumps
version.goto the next-devrevision, commits, pushes. - Creates a GitHub Release with auto-generated notes.
See CONTRIBUTING.md. PRs must sign off on the Developer Certificate of Origin (git commit -s) — a CI check enforces this.
AGPL-3.0-only. See LICENSE for the full text.