Skip to content

Pinakes v0.3.0 | Modern Library Management System with multilingual support, plugin architecture, and comprehensive security features

License

Notifications You must be signed in to change notification settings

fabiodalez-dev/Pinakes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pinakes - Library Management System

Pinakes 📚

Open-Source Integrated Library System License: GPL-3 | Languages: Italian, English

Pinakes is a self-hosted, full-featured ILS for schools, municipalities, and private collections. It focuses on automation, extensibility, and a usable public catalog without requiring a web team.

Version Installer Ready License CodeRabbit

PHP Slim MySQL JavaScript TailwindCSS


What's New in v0.3.0

Completely Redesigned Dewey Classification System

The Dewey Decimal Classification system has been completely rewritten. Data is no longer stored in the database but loaded from JSON files, enabling more flexible and collaborative management.

Key features:

  • Automatic import from SBN: When querying books via the SBN API (Italian National Library Service), if the record contains a Dewey classification it is automatically imported. If the code already exists in the JSON file it is applied to the book; if not, it is permanently added to the JSON with its Italian description.
  • Dewey Editor Plugin: A dedicated plugin for visual classification management — tree view, manual code addition per language (IT/EN), inline name editing, search, and delete functionality.
  • JSON Import/Export: Classification files can be exported and imported, enabling collaborative sharing between Pinakes installations. Merge mode allows adding data from other sources without losing customizations.
  • Multi-language support: Separate JSON files for Italian and English with automatic locale detection.

Built-in Auto-Updater

Starting from this version, Pinakes includes an integrated update system. Administrators can check, download, and install new versions directly from the control panel.

Note: Since this is the first version with the updater, v0.3.0 must be installed manually. Future releases can be updated automatically from the admin interface.

Update process: Requirements check, automatic database backup, secure download from GitHub Releases, application file backup for rollback, file installation respecting protected paths (.env, uploads, storage), orphan file cleanup, automatic database migrations, OpCache reset.

Security: Atomic rollback on error, path traversal protection, CSRF validation, admin-only access.

Database Backup System

New comprehensive backup management:

  • Automatic pre-update backup: Full database dump before every update
  • Manual on-demand backup: Create backups anytime from the admin panel
  • Backup list: View all backups with creation date and size
  • Download: Save backups externally for disaster recovery
  • Delete: Remove old backups to free disk space
  • Location: Backups saved in storage/backups/ in SQL format

Author Normalization

Intelligent system to prevent duplicate authors:

  • Automatic format conversion: "Levi, Primo" and "Primo Levi" are recognized as the same author
  • Source normalization: Names are normalized during SBN import
  • Fuzzy matching: Finds existing authors regardless of name format

Author/Publisher Merge

New feature to unify duplicate records:

  • Bulk selection of authors or publishers to merge
  • Automatic reassignment of all books to the primary record
  • Deletion of duplicate records

IMPORTANT: Breaking Changes for Existing Installations

v0.3.0 is NOT compatible with previous versions without manual migration.

If you are upgrading from v0.2.x or earlier, you MUST run the migration script before updating the application files:

# 1. BACKUP YOUR DATABASE FIRST!
mysqldump -u USER -p DATABASE > backup_before_0.3.0.sql

# 2. Run the migration
mysql -u USER -p DATABASE < installer/database/migrations/migrate_0.3.0.sql

# 3. Then replace the application files

What changes:

  • Database column renamed: classificazione_doweyclassificazione_dewey (typo fix)
  • Table removed: classificazione (Dewey data now loaded from JSON files)
  • Tables added: migrations, update_logs, z39_access_logs, z39_rate_limits
  • Database total: 41 tables (was 38 + classificazione = 39 in v0.2.x)

If you skip the migration, the application will fail with database errors because it expects the new column name.

For new installations: No action needed — the installer handles everything automatically.

Future updates: Starting from v0.3.0, updates can be performed automatically from Admin → Updates. The auto-updater handles migrations, backups, and file updates safely.


⚡ Quick Start (New Installations)

  1. Clone or download this repository and upload all files to the root directory of your server.
  2. Visit your site's root URL in the browser — the guided installer starts automatically.
  3. Provide database credentials (database must be empty).
  4. Select language (Italian or English).
  5. Configure organization name, logo, and email notifications.
  6. Create admin account and start cataloging.

Email configuration: Supports both PHP mail() and SMTP. Required for notifications to work (loan confirmations, due-date reminders, registration approvals, reservation alerts). Can be configured during installation or later from the admin panel.

All frontend assets are precompiled. Works on shared hosting. No Composer or build tools required on production. All configuration values can be changed later from the admin panel.


Story Behind the Name

Pinakes comes from the ancient Greek word πίνακες ("tables" or "catalogues"). Callimachus of Cyrene compiled the Pinakes around 245 BC for the Library of Alexandria: 120 scrolls that indexed more than 120,000 works with authorship, subject and location. This project borrows that same mission—organising and sharing knowledge with modern tools.


What It Does

Pinakes provides cataloging, circulation, a self-service public frontend, and REST APIs out of the box. It ships with precompiled frontend assets and a guided installer so you can deploy quickly on standard LAMP hosting.


Screenshots

Admin Dashboard
Admin Dashboard — Loans overview, calendar, and quick stats

Book Catalog Management
Book Management — ISBN auto-fill, multi-copy support, cover retrieval

Public Catalog
Public Catalog (OPAC) — Search, filters, and patron self-service


Core Features

Automatic Metadata Import

  • ISBN/EAN scraping from Google Books, Open Library, and pluggable sources
  • Automatic cover retrieval when available
  • Every field editable manually — automation never locks you in

Cataloging

  • Multi-copy support with independent barcodes and statuses for each physical copy
  • Unified records for physical books, eBooks, and audiobooks
  • Dewey Decimal Classification with 1,200+ preset categories (IT/EN), hierarchical browsing, manual entry for custom codes, and auto-population from SBN scraping
  • CSV bulk import with field mapping, validation, automatic ISBN enrichment, and Dewey classification from scraping
  • Automatic duplicate detection by ID, ISBN13, or EAN (updates existing records without modifying physical copies)
  • Author and publisher management with dedicated profiles and bibliography views
  • Genre/category system with custom taxonomies and multi-category assignment
  • Series and collections tracking with sequential numbering
  • Barcode generation for physical inventory (Code 128, EAN-13, custom formats)
  • Cover image management with automatic download, manual upload, and URL import
  • Rich metadata fields including edition, publication date, language, format, dimensions, weight, page count
  • Keywords and tags for enhanced searchability and subject indexing
  • Custom notes and annotations for internal cataloging remarks

Circulation

  • Full loan workflow: request, approval, checkout, renewal, return
  • Automatic due-date calculation with configurable loan periods
  • Configurable renewal rules (manual or automatic approval)
  • FIFO reservation queues with availability alerts when items become free
  • Detailed per-user and per-item history for audit trails

Catalogue Mode

  • Browse-only option for libraries that don't need circulation features
  • Configurable during installation or via Admin → Settings → Advanced
  • Hides all loan-related UI: request buttons, reservation forms, wishlist
  • Admin sidebar simplified without loan management menus
  • Perfect for: digital archives, reference-only collections, museum libraries

Reservation Pickup Confirmation

  • Two-step loan workflow: reservations create loans in "pending" state until physical pickup
  • Admin confirmation: "Conferma Ritiro" button activates the loan when patron collects book
  • Origin tracking: system tracks whether loans originated from reservations or manual creation

Calendar & ICS Integration

  • Interactive dashboard calendar (FullCalendar) showing all loans and reservations
  • Color-coded events: active loans (green), scheduled (blue), overdue (red), pending requests (amber), reservations (purple)
  • Start/end markers for easy visualization of loan periods
  • Click to view details: user, book title, dates, and status in modal popup
  • ICS calendar export for syncing with external calendar apps (Google Calendar, Apple Calendar, Outlook)
  • Automatic ICS generation via maintenance service or cron job
  • Subscribable calendar URL that stays updated with latest loans and reservations

Email Notifications

Automatic emails for:

  • New user registration
  • Registration approval
  • Loan confirmation
  • Approaching due dates (configurable days before)
  • Overdue reminders
  • Item-available notifications for reservations

WYSIWYG email template editor with dynamic tags for record, user, and loan data.

Public Catalog (OPAC)

  • Responsive, multilingual frontend (Italian + English)
  • AJAX search with instant results and relevance ranking
  • AJAX filters: genre, publisher, availability, publication year, format
  • Patrons can leave reviews and ratings (configurable)
  • Built-in SEO tooling: sitemap, clean URLs, Schema.org metadata tags
  • Cookie-consent banner and privacy tools (GDPR-compliant)

Dewey Decimal Classification

  • 1,200+ preset categories in Italian and English loaded from JSON files
  • Hierarchical browsing — Navigate from main classes (000-999) to subdivisions (e.g., 599.9 Mammals)
  • Manual entry — Accept any valid Dewey code, not limited to preset list
  • Format validation — Real-time validation of code format (XXX.XXXX)
  • Automatic population from SBN — Dewey codes extracted during ISBN scraping are auto-added to the database
  • Multi-language — Separate JSON files for IT/EN with full translations
  • Dewey Editor plugin — Visual tree editor for managing classifications with import/export
  • No database table — Data loaded from data/dewey/ JSON files at runtime

Auto-Updater

  • Built-in update system — Check, download, and install updates from Admin → Updates
  • Automatic database backup — Full MySQL dump before every update
  • Safe file updates — Protected paths (.env, uploads, storage) are never overwritten
  • Database migrations — Automatic execution of SQL migrations for version jumps
  • Atomic rollback — Automatic restore on error with pre-update backup
  • Orphan cleanup — Files removed in new versions are deleted from installation
  • OpCache reset — Automatic cache invalidation after file updates
  • Security — CSRF validation, admin-only access, path traversal protection

Physical Inventory

  • Hierarchical location model: shelf, aisle, position
  • Automatic position assignment for new copies
  • Barcode generation in standard formats
  • Printable PDF labels in multiple sizes (customizable templates)

Digital Content

  • eBook distribution (PDF, ePub) with download tracking
  • Audiobook streaming (MP3, M4A, OGG) with integrated player
  • Drag-and-drop upload or external URL linking

Plugin System

Extend without modifying core files. Plugins can implement:

  • New metadata scrapers (custom APIs, proprietary databases)
  • Additional business logic (custom loan rules, notifications)
  • Digital-content modules (eBooks, audiobooks, streaming)
  • Import/export routines (MARC21, UNIMARC, custom formats)

Plugins support encrypted secrets and isolated configuration. Install via ZIP upload in admin panel.

Pre-installed plugins (6 included):

  • Open Library — Metadata scraping from Open Library + Google Books API
  • Z39 Server — SRU 1.2 API + SBN client for Italian library metadata with Dewey extraction
  • API Book Scraper — External ISBN enrichment via custom APIs
  • Digital Library — eBook (PDF, ePub) and audiobook (MP3, M4A, OGG) management with streaming player
  • Dewey Editor — Visual editor for Dewey classification data with import/export and validation
  • Scraping Pro — Advanced metadata scraping with configurable sources and priority ordering

CMS and Customization

  • Homepage editor with drag-and-drop blocks (hero banner, featured shelves, events, testimonials)
  • Custom pages (About, Regulations, Events) with WYSIWYG editing
  • 10 color themes with instant switching (Sky Blue, Forest Green, Royal Purple, Sunset Orange, Cherry Red, Ocean Teal, Lavender Dreams, Midnight, Coral Sunset, Golden Hour)
  • Custom theme editor with live preview for primary, secondary, and CTA colors
  • Logo customization and branding
  • Centralized media manager for images and documents
  • Event management with dates, descriptions, and homepage display

APIs

  • REST API for search, availability, cataloging, and statistics
  • SRU 1.2 protocol at /api/sru — standard library interoperability (MARCXML, Dublin Core, MODS export)
  • Z39.50 client for copy cataloging from external catalogs (Library of Congress, OCLC, national libraries)
  • CSV and Excel export for reports and backups
  • PDF generation for labels, receipts, and reports

User Management

  • Manual approval of new registrations (optional)
  • Automatic card number assignment with customizable prefixes
  • Complete per-user history of loans and reservations
  • Self-service patron portal with loan renewal, reservation management, and wishlists

Why It Might Be Useful

  • Fast ISBN-driven cataloging cuts manual entry to seconds per book
  • Usable public catalog without needing a web developer or custom theme work
  • Extensible via plugins if you want custom scrapers, integrations, or business logic
  • Self-hosted and GPL-3 licensed — full control, no vendor lock-in, no recurring fees
  • Works on shared hosting — no root access, Docker, or build tools required on production

Installation

  1. Clone the repository

    git clone https://github.com/fabiodalez-dev/pinakes.git
    cd pinakes
  2. (Optional) Refresh dependencies locally

    composer install --no-dev --optimize-autoloader
    cd frontend && npm install && npm run build && cd ..
  3. Fix writable directories — Git cannot store 0777 permissions:

    ./bin/setup-permissions.sh
    # or set 777 manually on uploads/, storage/, backups/, public/uploads/
  4. Start a local server (or configure your vhost):

    php -S 0.0.0.0:8000 router.php
  5. Run the web installer — visit your domain. The installer walks through:

    • Requirement checks (PHP extensions, directory permissions)
    • Database credentials & connection test
    • Schema + sample data import (Dewey, genres, email templates)
    • Admin account creation
    • App + email configuration

    It writes .env and .installed automatically — no manual file editing needed.

  6. Post-install

    • Remove/lock the installer/ directory (button provided on final step)
    • Configure SMTP, registration policy, and CMS blocks from Admin → Settings
    • Schedule php cron/automatic-notifications.php (daily) for automatic email reminders

Plugins (Pre-installed)

All plugins are located in storage/plugins/ and can be managed from Admin → Plugins.

1. Open Library (open-library-v1.0.0.zip)

  • Metadata scraping from Open Library API
  • Fallback to Google Books when Open Library lacks data
  • Automatic cover download with validation
  • Subject mapping and language normalization
  • Configurable priority and caching options

2. Z39 Server (z39-server-v1.0.0.zip)

Implements the SRU (Search/Retrieve via URL) protocol, the HTTP-based successor to Z39.50, enabling catalog interoperability with library systems worldwide.

Server Mode (expose your catalog):

  • SRU 1.2 API at /api/sru with explain, searchRetrieve, scan operations
  • Export formats: MARCXML, Dublin Core, MODS, OAI_DC
  • CQL query parser supporting indexes: dc.title, dc.creator, dc.subject, bath.isbn, dc.publisher, dc.date
  • Rate limiting (100 req/hour per IP) and comprehensive access logging
  • Optional API key authentication via X-API-Key header
  • Trusted proxy support for deployments behind load balancers (CIDR notation)

Client Mode (import from external catalogs):

  • Copy cataloging from Z39.50/SRU servers (Library of Congress, OCLC, K10plus, SUDOC, national libraries)
  • SBN Italia client — Automatic metadata retrieval from Italian national library catalog
  • Dewey classification extraction:
    • SBN: Parses Dewey codes from classificazioneDewey field (format: 335.4092 (19.) SISTEMI MARXIANI)
    • SRU/MARCXML: Extracts from MARC field 082 (Dewey Decimal Classification Number)
    • Dublin Core: Parses from dc:subject (DDC scheme) and dc:coverage fields
  • Federated search across multiple configured servers
  • Automatic retry with exponential backoff (100ms, 200ms, 400ms)
  • TLS certificate validation for secure connections
  • MARCXML and Dublin Core parsing with author extraction (MARC 100/700 fields)

Example queries:

# Server info
curl "http://yoursite.com/api/sru?operation=explain"

# Search by author
curl "http://yoursite.com/api/sru?operation=searchRetrieve&query=dc.creator=marx&maximumRecords=10"

# Search by ISBN (Dublin Core format)
curl "http://yoursite.com/api/sru?operation=searchRetrieve&query=bath.isbn=9788842058946&recordSchema=dc"

Use cases: Union catalogs, interlibrary loan systems, OPAC federation, copy cataloging workflows, automatic Dewey classification.

3. API Book Scraper (api-book-scraper-v1.0.0.zip)

  • External API integration for ISBN enrichment
  • Custom endpoint configuration (URL, headers, auth)
  • Response mapping to Pinakes schema
  • Retry logic with exponential backoff
  • Error logging and debugging tools

4. Digital Library (digital-library-v1.0.0.zip)

  • eBook support (PDF, ePub) with download tracking
  • Audiobook streaming (MP3, M4A, OGG) with HTML5 player
  • Per-item digital asset management (unlimited files per book)
  • Access control (public, logged-in users only, specific roles)
  • Usage statistics and download history

5. Dewey Editor (dewey-editor-v1.0.0.zip)

Complete Dewey Decimal Classification management system with multilingual support, automatic population, and data exchange capabilities.

Core Features:

  • Tree-based visual editor — Navigate and edit the complete Dewey hierarchy (1,200+ preset entries)
  • Multi-language support — Separate JSON files for Italian (dewey_completo_it.json) and English (dewey_completo_en.json) with full translations
  • Inline editing — Add, modify, or delete categories with instant validation
  • Validation engine — Checks code format (XXX.XXXX), hierarchy consistency, and duplicate detection

Data Exchange:

  • JSON import/export — Backup and restore classification data for manual editing or exchange with other Pinakes installations
  • Cross-installation sharing — Export your customized Dewey database and import it into another Pinakes instance
  • Merge capability — Import external classifications while preserving existing entries

Automatic Dewey Scraping:

  • SBN integration — When scraping book metadata from SBN (Italian National Library), Dewey codes are automatically extracted from the classificazioneDewey field
  • SRU/Z39.50 servers — Dewey codes extracted from MARC field 082 when querying external catalogs (K10plus, SUDOC, Library of Congress, etc.)
  • Auto-population — New Dewey codes discovered during scraping are automatically added to your JSON database (language-aware: only updates when source language matches app locale)
  • CSV import enrichment — Books imported via CSV are automatically enriched with Dewey classification through ISBN scraping

Dewey Code Format:

  • Main classes: 000-999 (3 digits)
  • Subdivisions: 000.1 to 999.9999 (up to 4 decimal places)
  • Examples: 599.9 (Mammiferi/Mammals), 004.6782 (Cloud computing), 641.5945 (Cucina italiana/Italian cuisine)

Book Form Integration:

  • Chip-based selection — Selected Dewey code displays as removable chip with code + name
  • Manual entry — Accept any valid Dewey code (not limited to predefined list)
  • Hierarchical navigation — Optional collapsible "Browse categories" for discovering codes
  • Breadcrumb display — Shows full classification path (e.g., "500 → 590 → 599 → 599.9")
  • Frontend validation — Real-time format validation before submission

6. Scraping Pro (scraping-pro-v1.0.0.zip)

Advanced metadata scraping plugin with configurable sources and intelligent enrichment.

  • Multi-source scraping — Configure multiple metadata sources with priority ordering
  • Custom field mapping — Map external API fields to Pinakes schema
  • Bulk enrichment — Enrich existing catalog entries in batch mode
  • Priority ordering — Define source priority for fallback behavior
  • Cache management — Reduce API calls with intelligent caching
  • Error handling — Detailed logging and retry logic for failed requests

Tech Stack

Backend: Slim 4.13, PHP-DI, Slim PSR-7 + CSRF, Monolog 3, PHPMailer 6.10, TCPDF 6.10, Google reCAPTCHA, thepixeldeveloper/sitemap, emleons/sim-rating, vlucas/phpdotenv.

Frontend: Webpack 5, Tailwind CSS 3.4.18, Bootstrap 5.3.8, jQuery 3.7.1, DataTables 2.3.x, Chart.js 4.5, SweetAlert2 11, Flatpickr 4.6, Sortable.js 1.15, Choices.js 11, TinyMCE 8, Uppy 4, jsPDF, JSZip, Font Awesome, Inter font (self-hosted).


Deployment

Apache (Shared Hosting)

Works out of the box. Two .htaccess files handle routing:

  • Root .htaccess: Redirects to /public/ or /installer/
  • public/.htaccess: Front controller routing, security headers, CORS

Nginx (VPS/Dedicated)

Copy .nginx.conf.example to your Nginx sites directory:

sudo cp .nginx.conf.example /etc/nginx/sites-available/pinakes
sudo nano /etc/nginx/sites-available/pinakes  # Edit server_name, root, PHP-FPM
sudo ln -s /etc/nginx/sites-available/pinakes /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Support & Contact

📧 Email: [email protected] 🐛 Issues: GitHub Issues 💬 Discussions: GitHub Discussions


Contributing & License

Contributions, issues, and feature requests are welcome via GitHub pull requests. Pinakes is released under the GNU General Public License v3.0 (see LICENSE).

If Pinakes helps your library, please ⭐ the repository!


Handy Paths for Developers

  • app/Views/libri/partials/book_form.php – Catalog form logic, ISBN ingestion
  • app/Controllers/PrestitiController.php – Core lending workflows
  • app/Controllers/ReservationsController.php – Queue handling
  • app/Controllers/UserWishlistController.php – Wishlist UX
  • app/Views/frontend/catalog.php – Public catalog filters
  • app/Controllers/SeoController.php – Sitemap + robots.txt
  • storage/plugins/ – Plugin directory (all pre-installed plugins)