libris / librisxl
Libris XL
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing libris/librisxl in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewLibris XL ---- • Parts • Dependencies • Setup • Data • Maintenance ---- Parts The project consists of: • Core • The root component of XL. A shared library implementing a linked data store, including search and MARC conversion. • Applications • A servlet web application. OAIPMH service for Libris XL • A servlet web application. Search, RESTful CRUD and other HTTP APIs • A servlet (and CLI program) for exporting libris data as MARC. • Java application to load or reindex data into the system. • A servlet web application. XL reimplementation of the Libris legacy APIX API. • Tools • CLI tool for running scripted mass updates of data. • Configuration and scripts used for setup, maintenance and operations. Related external repositories: • Core metadata to be loaded is managed in the definitions repository. • Also see LXLViewer, our application for viewing and editing the datasets through the REST API. • API documentation is available at https://libris.kb.se/api/docs/ (generated from the libris-api-docs repository). Dependencies The instructions below assume an Ubuntu 22.04 system (Debian should be identical), but should work for e.g. Fedora/CentOS/RHEL with minor adjustments. • Gradle No setup required. Just use the checked-in gradle wrapper to automatically get the specified version of Gradle and Groovy. • Elasticsearch (version 8.x) Download Elasticsearch For Ubuntu/Debian, select "apt-get" and follow the instructions. • PostgreSQL (version 14.2 or later) Windows: Download and install https://www.postgresql.org/download/windows/ • Java (version 21) • nginx Setup Cloning repositories Make sure you check out this repository, and also definitions and devops: You should now have the following directory structure: Setting up PostgreSQL Ensure PostgreSQL is started. In Debian/Ubuntu, this happens automatically after . Otherwise, try in any modern Linux system. Create database and a database user and set up permissions: Give all users access to your local database by editing . You got the path from the last command just above. It's probably something like . Edit it and add the following _above_ any uncommented line (PostgreSQL uses the first match): Restart PostgreSQL for the changes to take effect: Test connectivity: Setting up Elasticsearch Assuming Elasticsearch is already running, first set the password of the user: Next, install the ICU Analysis plugin: Finally, (re)start Elasticsearch: To adjust the JVM heap size for Elasticsearch, edit and then restart Elasticsearch. In a local development environment, you might want to add the following to prevent Elasticsearch from hogging memory: Configuring secrets Use as a starting point: Importing test data Run the fabric task that sets up a new Elasticsearch index and imports example data: Running To start the CRUD part of the whelk, run the following commands: *NIX-systems: Windows: The system is then available on . (The OAI-PMH service is started in a similar way: just cd into instead of .) To run the frontend, first set up the Libris cataloging client and the id.kb.se web app (follow the README in each): • Libris cataloging • id.kb.se At this point, you should have the LXLViewer cataloging client running on port 8080 and the id.kb.se app running on port 3000, but they won't work yet. Next, add these lines to Finally, in devops again (with the fab virtual environment activated), run the following: This will place some nginx configuration files in and (re)start nginx. If everything went well, you should now be able to visit http://id.kb.se.localhost:5000 and use the cataloging client on http://libris.kb.se.localhost:5000/katalogisering/. The XL API itself is available on http://libris.kb.se.localhost:5000 (proxied via nginx), or directly on http://localhost:8180. Maintenance Everything you would want to do should be covered by the devops repo. This section is mostly kept as a reminder of alternate (less preferred) ways. Development Workflow If you need to work locally (e.g. in this or the "definitions" repo) and perform specific tests, you can use this workflow: • Create and push a branch for your work. • Set the branch in the config in the devops repo. • Use the regular tasks to e.g. reload data. New Elasticsearch config If a new index is to be set up, and unless you run locally in a pristine setup, or use the recommended devops-method for loading data you need to PUT the config to the index, like: Create an alias for your index (To replace an existing setup with entirely new configuration, you need to delete the index and read all data again (even locally).) Format updates If the MARC conversion process has been updated and needs to be run anew, the only option is to reload the data from production using the importers application. Statistics Produce a stats file (here for bib) by running: