How ramazaneryigit/libraryhub works
LibraryHub is a multi-tenant library catalogue backend. Staff and administrators use its API to manage bibliographic records, identities, authorities, holdings and tenant settings; catalogues can also be imported from MARC or JSONL and discovered through keyword or semantic search. The graph highlights those workflows and the shared persistence layer. Several domain routes are represented at directory level because their source was not excerpted; their internal call paths are therefore omitted.
Main entry points: search.py Search routes · main.py API application · ingest.py MARC endpoints · marc_ingest.py MARC ingestion
Components 23
API and access
- API application
backend/app/main.py - Auth and tenant context
backend/app/api/deps.py
Catalogue domain
- Catalogue and tenant routes
backend/app/api/v1/routes - Authority workflows
backend/app/services/authority_queue.py
Import and export
- MARC endpoints
backend/app/api/v1/routes/ingest.py - JSONL endpoints
backend/app/api/v1/routes/ingestion.py - MARC ingestion
backend/app/services/marc_ingest.py - MARC parsing and mapping
backend/app/core/marc.py - MARC export
backend/app/services/marc_export.py - Source record ingestion
backend/app/services/ingestion.py
Search and reconciliation
- Search routes
backend/app/api/v1/routes/search.py - Search index
backend/app/services/search_index.py - Semantic search
backend/app/services/semantic_search.py - Work details
backend/app/services/work_detail.py - Entity merging
backend/app/services/entity_merge.py - Reconciliation
backend/app/services/reconciliation.py
Persistence
- UUID generation
backend/app/core/ids.py - Text normalization
backend/app/core/text.py - Database sessions
backend/app/db/session.py - Catalogue and tenant data
backend/app/db/models - Ingestion batches
backend/app/db/models/ingestion.py
Other components
- Library staff
- Platform admin
Connections 22
- API application → Catalogue and tenant routes: registers routes
- API application → Search routes: registers routes
- API application → MARC endpoints: registers routes
- API application → JSONL endpoints: registers routes
- Library staff → Catalogue and tenant routes: manages catalogue
- Platform admin → MARC endpoints: imports catalogue
backend/app/api/v1/routes/ingest.py - MARC endpoints → MARC ingestion: loads records
backend/app/api/v1/routes/ingest.py - MARC endpoints → MARC export: exports catalogue
backend/app/api/v1/routes/ingest.py - MARC ingestion → MARC parsing and mapping: parses and maps
backend/app/services/marc_ingest.py - MARC ingestion → Catalogue and tenant data: writes records
backend/app/services/marc_ingest.py - JSONL endpoints → Source record ingestion: submits records
backend/app/api/v1/routes/ingestion.py - Source record ingestion → Ingestion batches: tracks batches
backend/app/services/ingestion.py - Search routes → Search index: queries index
backend/app/api/v1/routes/search.py - Search routes → Semantic search: requests semantic matches
backend/app/api/v1/routes/search.py - Search routes → Work details: loads work details
backend/app/api/v1/routes/search.py - Search routes → Entity merging: resolves merged entities
backend/app/api/v1/routes/search.py - Search index → Text normalization: normalizes text
backend/app/services/search_index.py - Work details → Entity merging: uses merge logic
backend/app/services/work_detail.py - Auth and tenant context → Database sessions: opens scoped sessions
backend/app/api/deps.py - Database sessions → Catalogue and tenant data: loads ORM models
- Ingestion batches → UUID generation: generates IDs
backend/app/db/models/ingestion.py - Authority workflows → UUID generation: uses generated IDs
backend/app/services/authority_queue.py