How textbrowser/biblioteq works
Project Type and Purpose
• BiblioteQ is a full-stack, cross-platform desktop (and Android) library management application written in C++/Qt.
• It provides cataloging, search, borrowing workflows and integrates with PostgreSQL or SQLite databases and external metadata sources (Z39.50/SRU, Open Library, Amazon).
File Structure
• Top-level:
• Source/ and UI/ contain C++ classes and Qt Designer forms – this is your application frontend + core logic.
• SQL/ holds schema scripts for SQLite and PostgreSQL – your database layer.
• Scripts/ and Tools/ are build‐time or maintenance utilities.
• Android/ contains Gradle and resource files – the mobile wrapper target.
• Distributions/ packaging definitions for different OSes and architectures.
• Look for biblioteq.pro and various .pro files → Qt build system driving multi-target compilation.
• Source code is organized by feature (e.g., biblioteq_book.*, biblioteq_dvd.*) indicating a modular domain‐driven design.
README for Additional Insights
• Confirms use of Qt LTS, Poppler (PDF reader), Z39.50, SRU protocols, CSV import/export, multi-database support, and Android build target.
• Mentions free‐standing (network-less) usage and PostgreSQL row-level security features.
a. Main Components
1. UI Layer
2. Application Core / Business Logic
– C++ classes under Source/ (e.g., item classes, query engines, thread managers)
3. Data Access Layer
– Qt SQL abstraction classes interacting with SQLite or PostgreSQL
4. Database Servers
– Local SQLite embedded file
– Remote PostgreSQL server (optional)
5. External Services
– Z39.50/SRU client module for library network queries
– REST API clients for Open Library and Amazon cover retrieval
6. Platform Abstraction
– Android wrapper (Gradle, JNI/CocoaInitializer for macOS, platform .pro files)
7. Build & Distribution
– Qt build system (.pro files), packaging scripts (Distributions/, Scripts/, Tools/)
8. File System & Static Resources
b. Relationships & Interactions
• UI Layer → calls → Application Core
• Application Core → uses → Data Access Layer
• Data Access Layer ↔ queries ↔ Database (SQLite file or PostgreSQL)
• Application Core → invokes → External Services over network (SRU/Z39.50, HTTP REST)
• Platform Abstraction encloses UI/Core for mobile vs. desktop.
• Build & Distribution packages all components per target architecture.
c. Architectural Patterns & Principles
• Layered architecture (Presentation, Business, Data).
• Modular domain classes per item type (Book, DVD, Magazine).
• Plugin-like extensibility via Qt resource files and translation modules.
• Asynchronous operations (threaded retrieval, Qt signals/slots).
• Configuration-driven packaging for multiple OS/architectures.
d. Key Technologies & Frameworks
• Qt (Widgets, Designer, .qrc resources, translations)
• C++17 (business logic, threading)
• SQLite / PostgreSQL (SQL scripts under SQL/ directory)
• Z39.50 / SRU client library
• REST HTTP client (Qt Network)
• Poppler for PDF reading
• Gradle for Android
• Bash scripts & .pro files for packaging
Key Details to Capture
• All database options (SQLite vs. PostgreSQL)
• Multi-platform build outputs (Windows, Linux, macOS, Android)
• Asynchronous communication modules (threads, signals/slots for SRU fetches)
• Packaging scripts and their targets (Distributions/*)