Skip to content

bookshelves-project/bookshelves

Repository files navigation

Bookshelves

banner

php laravel filament node license tests

Bookshelves is a web application to handle eBooks, comics/mangas and audiobooks. Powered by Laravel.

Features

  • All your books in one place, parsed by kiwilan/php-ebook
    • Audiobooks: .mp3, .m4b
    • Comics/Mangas: .cb7, .cba, .cbr, .cbt, .cbz
    • eBooks: .epub, .pdf
  • Search engine with Meilisearch
  • OPDS feed powered by kiwilan/php-opds
  • Read eBooks, comics/mangas and listen audiobooks
  • Admin panel made by filament
    • Libraries management
    • Users management
  • SSR option powered by inertia

Roadmap

  • Add Docker installation option
  • Add Plex-like solution
  • Add tests
  • find duplicate authors
  • find duplicates series like A comme Association (multiple authors)
  • Read ebook in browser
  • Read comic in browser
  • Read audiobook in browser
  • Authentication

Setup

Download dependencies

composer i
pnpm i

Create .env file

cp .env.example .env

Generate application key

php artisan key:generate

Create symbolic link for storage

php artisan storage:link

Migrate database with seeders

php artisan migrate:fresh --seed

Build assets

pnpm build

Now you can serve application

php artisan serve

Bookshelves is now available at http://localhost:8000 and you can access to the admin panel at http://localhost:8000/admin.

Environment values

  • APP_URL: Application URL
  • VITE_SSR_PORT: Port for SSR, default is 13714 (only used in production, if you use SSR)
  • SCOUT_DRIVER: Search engine driver, default is collection depends of Laravel Scout. Bookshelves use meilisearch driver.
  • CLOCKWORK_ENABLE: Enable or disable Clockwork, default is false (debug tool)
  • BOOKSHELVES_SUPER_ADMIN_EMAIL: Super admin email, used to create the first user
  • BOOKSHELVES_SUPER_ADMIN_PASSWORD: Super admin password, used to create the first user
  • BOOKSHELVES_ANALYZER_ENGINE: Analyzer engine, default is native (native or scout)
  • BOOKSHELVES_ANALYZER_DEBUG: Analyzer debug mode, default is false (print a JSON file for each book analyzed)
  • BOOKSHELVES_IMAGE_CONVERSION: Image conversion engine, default is false (convert covers to different sizes)
  • BOOKSHELVES_API_WIKIPEDIA: use Wikipedia API to get author information and photos, default is true

Add librairies

You have two solutions to create libraries: create a JSON file or use the admin panel (you can add libraries even if you use JSON file).

Admin panel

Connect to the admin panel at http://localhost:8000/admin with the default credentials defined in .env file (BOOKSHELVES_SUPER_ADMIN_EMAIL and BOOKSHELVES_SUPER_ADMIN_PASSWORD).

Go to the admin panel at http://localhost:8000/admin, find the Libraries entry in the sidebar and click on New library.

  • Name is a label for your library
  • Type is a select with audiobook, book and comic_manga values.
  • Path is absolute path to your library
  • Slug is defined automatically from the name field
  • Enabled is a checkbox to enable or disable the library
  • Path is valid is a read-only field to check if the path is valid (automatically checked when you save the library)

JSON file

Create a libraries.json file from libraries-template.json.

cp libraries-template.json libraries.json

And add your books libraries in libraries.json.

  • name: Library name, you can use any label
  • type: LibraryTypeEnum (audiobook, book, comic_manga)
  • path: Absolute path to your library
  • is_enabled: Optional, to enable or disable the library
[
    {
        "name": "My audiobooks",
        "type": "audiobook", // LibraryTypeEnum: audiobook, book, `comic_manga`
        "path": "/absolute/path/to",
        "is_enabled": true // optional, to enable or disable the library
    }
    // ...
]

And when you execute the analyze command with --fresh option, Bookshelves will create database entries for each library and will scan books.

Usage

Analyze

Execute analyze command to analyze books and create database entries.

  • -f|--fresh option for fresh mode (delete all books before analyze)
  • -l|--limit option for limit mode (limit the number of books to analyze)
php artisan bookshelves:analyze -f

To get full documentation, you can read Bookshelves documentation.

Preview

Execute scan command to get a preview of scannable books (libraries have to be created).

  • -v option for verbose mode
php artisan bookshelves:scan

Tests

Create a .env.testing file

cp .env.testing.example .env.testing

Create key for testing

php artisan key:generate --env=testing

Run tests

composer test

Credits

License

The Bookshelves is open-sourced software licensed under the BSD 2-Clause License.