PHPackages                             decent-newsroom/bookshelf-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. decent-newsroom/bookshelf-bundle

ActiveSymfony-bundle

decent-newsroom/bookshelf-bundle
================================

Reusable Symfony bundle for a Nostr-based bookshelf and e-reader backed by Mercury

04↑2900%PHP

Since Aug 24Pushed todayCompare

[ Source](https://github.com/decent-newsroom/bookshelf-bundle)[ Packagist](https://packagist.org/packages/decent-newsroom/bookshelf-bundle)[ RSS](/packages/decent-newsroom-bookshelf-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

BookshelfBundle
===============

[](#bookshelfbundle)

`decent-newsroom/bookshelf-bundle` is a reusable Symfony bundle providing a Nostr-based bookshelf and e-reader backed by the [Mercury](https://mercury-relay.imwald.eu)REST API.

It parses NKBIP-01 publication indexes (kind `30040`) and their ordered publication content events (kind `30041`), exposes a public search and reader UI, and lets authenticated users maintain a personal NKBIP-04 "My Books" directory (kind `30045`).

Features
--------

[](#features)

- Public `/bookshelf` search over the Mercury catalogue.
- `/bookshelf/{id}` continuous book reader with AsciiDoc chapter rendering.
- Authenticated `/bookshelf/my-books` personal directory and `POST /api/bookshelf/directory` publish endpoint.
- Keeps local persistence and relay publishing behind contracts so each host can provide its own implementation.

Documentation
-------------

[](#documentation)

- [Mercury Bookshelf](docs/mercury-bookshelf.md)
- [My Books Directory](docs/bookshelf-my-books-directory.md)

Requirements
------------

[](#requirements)

- PHP 8.3 or newer.
- Symfony 7.4 or newer.
- `innis/nostr-core` `^0.3.17`.
- `swentel/nostr-php` `^1.9` (event signature verification).
- `decent-newsroom/asciidoc-html` `^0.1.0` (chapter rendering).

The package uses the `DecentNewsroom\BookshelfBundle` namespace. Its Composer mapping is package-local and does not require the consuming application's `App\` classes.

Installation
------------

[](#installation)

Install the package from its Composer repository:

```
composer require decent-newsroom/bookshelf-bundle
```

During local development, a Symfony host can consume the package through a path repository:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/bookshelf-bundle",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
        "decent-newsroom/bookshelf-bundle": "@dev"
    }
}
```

Register the bundle if Symfony Flex has not done so:

```
use DecentNewsroom\BookshelfBundle\BookshelfBundle;

return [
    BookshelfBundle::class => ['all' => true],
];
```

Import its routes:

```
# config/routes/bookshelf.yaml
bookshelf_bundle:
    resource: '@BookshelfBundle/Resources/config/routes.yaml'
```

Configuration
-------------

[](#configuration)

```
# config/packages/bookshelf.yaml (optional)
bookshelf:
    mercury_api_base_url: 'https://mercury-relay.imwald.eu'
```

`MERCURY_API_BASE_URL` may also be set as an environment variable; both are optional and default to the public Mercury relay.

Host integration
----------------

[](#host-integration)

The bundle is deliberately storage-agnostic. A consuming application must alias two contracts:

ContractResponsibility`Contract\DirectoryEventStoreInterface`Look up a user's own stored directory events (kind `30045`) by pubkey and kind.`Contract\DirectoryEventPublisherInterface`Persist a signature-verified directory event locally and publish it to the user's write relays.```
services:
    DecentNewsroom\BookshelfBundle\Contract\DirectoryEventStoreInterface:
        alias: App\Bookshelf\BookshelfEventStore

    DecentNewsroom\BookshelfBundle\Contract\DirectoryEventPublisherInterface:
        alias: App\Bookshelf\BookshelfEventPublisher
```

Events returned by `DirectoryEventStoreInterface` must implement `Contract\DirectoryEventInterface` (`getDTag()`, `getSlug()`, `getTags()`).

Testing
-------

[](#testing)

Install the package dependencies and run its package-owned test suite:

```
composer install
vendor/bin/phpunit -c phpunit.xml.dist
```

The package tests exercise `MercuryApiClient` and `MercuryBookService`directly against a mocked HTTP client, so they do not require a Doctrine entity or a newsroom database.

Scope and limitations
---------------------

[](#scope-and-limitations)

This package does not provide:

- a database implementation;
- relay selection, publishing, or NIP-42 authentication;
- application authentication or user management;
- the host application shell (`app-shell.html.twig`) or its sidebar/menu components, which templates extend and reference by convention.

Those concerns belong to the consuming Symfony host and are connected through the package contracts and service configuration.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance65

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18485210?v=4)[Nusa](/maintainers/nusapuksic)[@nusapuksic](https://github.com/nusapuksic)

---

Top Contributors

[![nusapuksic](https://avatars.githubusercontent.com/u/18485210?v=4)](https://github.com/nusapuksic "nusapuksic (1 commits)")

### Embed Badge

![Health badge](/badges/decent-newsroom-bookshelf-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/decent-newsroom-bookshelf-bundle/health.svg)](https://phpackages.com/packages/decent-newsroom-bookshelf-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
