Noureddine RAMDI / BookLore: rule-based self-hosted digital library management with network storage safety

Created Sat, 23 May 2026 20:41:14 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

adityachandelgit/BookLore

BookLore tackles the challenge of managing a digital library across devices without relying on third-party services. It offers a self-hosted, comprehensive platform that organizes, reads, annotates, and syncs book collections with a focus on data safety and automation.

What BookLore does and how it is built

At its core, BookLore is a digital library management system designed for self-hosting. The backend is built with Java Spring Boot, providing REST APIs and business logic, while the frontend uses Angular for a responsive, browser-based user interface. The stack includes MariaDB for storage and is packaged as a single Docker Compose setup exposing the service on port 6060.

Key features include multi-user support with local or OpenID Connect authentication, metadata enrichment from multiple sources (Google Books, Open Library, Amazon), and syncing to popular e-reader devices like Kobo and KOReader. It supports common book formats including EPUB, PDF, and comics, which can be read directly in the built-in browser reader.

A distinctive architectural choice is the handling of network-attached storage (NAS) or shared network drives. By setting the environment variable DISK_TYPE=NETWORK, BookLore disables all file write operations on the book storage path. This prevents silent file corruption that can occur with concurrent or improper writes on networked filesystems.

The platform also provides advanced organizational features like Magic Shelves—rule-based dynamic collections that automatically organize books based on metadata queries. This helps keep large libraries tidy without manual curation.

Additional conveniences include an OPDS-compatible catalog for integration with other reading apps, and a BookDrop folder that automatically imports new books placed in a watched directory.

What makes BookLore technically interesting

BookLore’s combination of rule-based Magic Shelves and network storage safety mode stands out among self-hosted media servers. Magic Shelves use dynamic, user-defined rules to populate virtual shelves automatically. Instead of static collections, this approach adapts as the library grows or metadata changes. The rules are expressed as queries against book metadata, allowing complex filtering by author, genre, tags, or other enriched data.

This design reduces manual overhead and keeps the library organized in a flexible way. It also reflects a tradeoff: while powerful, users need to learn and maintain query syntax, which may have a learning curve compared to simpler tagging or folder-based systems.

The network storage safety mode addresses a subtle but critical problem in self-hosted setups. Many users store large media libraries on NAS or shared drives, which can behave unpredictably with concurrent file writes or locking. BookLore’s mode disables writes entirely when books reside on such storage, relegating the system to read-only access for files and preventing data loss or corruption. This is a pragmatic choice acknowledging the limitations of network filesystems rather than trying to force write consistency.

Under the hood, the backend is a well-structured Spring Boot application, likely organized around REST controllers, service layers, and a MariaDB database schema for users, books, metadata, and shelves. The frontend Angular app communicates via API, providing a modern SPA experience.

The entire stack ships as a Docker Compose file, which includes the BookLore service and a MariaDB container. This setup simplifies deployment and ensures consistent environment configuration.

Quick start with Docker Compose

BookLore provides a straightforward Docker Compose setup for quick deployment. The user configures environment variables in a .env file and then launches the stack with the provided docker-compose.yml.

services:
  booklore:
    image: ghcr.io/booklore-app/booklore:latest
    container_name: booklore
    environment:
      - USER_ID=${APP_USER_ID}
      - GROUP_ID=${APP_GROUP_ID}
      - TZ=${TZ}
      - DATABASE_URL=${DATABASE_URL}
      - DATABASE_USERNAME=${DB_USER}
      - DATABASE_PASSWORD=${DB_PASSWORD}
      - DISK_TYPE=${DISK_TYPE}
    depends_on:
      mariadb:
        condition: service_healthy
    ports:
      - "6060:6060"
    volumes:
      - ./data:/app/data
      - ./books:/books
      - ./bookdrop:/bookdrop
    healthcheck:
      test: wget -q -O - http://localhost:6060/api/v1/healthcheck
      interval: 60s
      retries: 5
      start_period: 60s
      timeout: 10s
    restart: unless-stopped

  mariadb:
    image: lscr.io/linuxserver/mariadb:11.4.5
    container_name: mariadb
    environment:
      - PUID=${DB_USER_ID}
      - PGID=${DB_GROUP_ID}
      - TZ=${TZ}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
    volumes:
      - ./mariadb/config:/config
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ]
      interval: 5s
      timeout: 5s
      retries: 10

This setup expects you to define environment variables such as user IDs, database credentials, timezone, and the DISK_TYPE. Once running, the BookLore UI is accessible on port 6060.

This Docker Compose approach ensures a clean separation of concerns: the database persists data, the BookLore app handles logic and UI, and volumes provide persistent storage for books and user data.

Verdict

BookLore is a pragmatic and thoughtfully built self-hosted digital library manager catering to users who want local control over their book collections without depending on cloud services. Its rule-based Magic Shelves offer a powerful way to automate library organization, though they require some familiarity with query syntax.

The network storage safety mode is a rare but crucial feature that recognizes the realities of NAS usage and prevents silent data corruption — a problem often overlooked in media servers.

The stack’s reliance on Java Spring Boot and Angular is standard but solid, and shipping as a Docker Compose bundle simplifies deployment.

If you maintain a large digital library on shared storage and want a robust, automated system with multi-user support and device sync, BookLore is worth a look. It balances feature richness with practical safeguards. The tradeoff is complexity in setup and rule management, which may deter casual users.

Overall, BookLore is a solid choice for technically inclined users and self-hosting enthusiasts who value control, automation, and data integrity in their digital book collections.


→ GitHub Repo: adityachandelgit/BookLore ⭐ 344 · Java