This package provides the back-end for Boston College Libraries' "bento" search page.
The server requires:
- PHP 8.1+
- the composer dependency manager
- the Symfony CLI tool
- redis
- a Boston College Eagle VPN connection
Use composer to install:
git clone https://github.com/BCLibraries/bcbento-server.git
cd bcbento-server
git fetch
git checkout update-to-php8.1
composer install
Create an .env.local file in the root directory and add any missing or changed values from the .env file. The contents of a working .env.local file can be found in bento documentation on the BC Libraries wiki.
Use the Symfony local server for development:
symfony serve
Services are provided via GraphQL. You can query the development server interactively using GraphiQL at http://127.0.0.1:8000/graphiql (update the port number as appropriate).
Use thr GraphiQL documentation browser to see all available queries and parameters. Some example queries include:
searchCatalog(keyword: "otters") {
total
docs {
id
title
creator
availability {
availableCount
totalCount
libraryName
callNumber
locationName
}
}
facets {
name
values {
value
count
}
}
}
recommendLibrarian(keyword: "history") {
docs {
id
name
email
image
subjects
}
}
bestBet(keyword: "history") {
title
... on LocalBestBet {
displayText
link
}
}
Testing is performed using the PHPUnit testing framework.
Integration tests run queries against the server and try to verify that we are getting sane results. Integration tests must pass before a new deployment is activated.
The integration test file (search-terms-hidden.csv) can be found on the BC Libraries wiki. It must be copied to the tests/integration directory before integration tests can be run.
To run the integration tests:
./vendor/bin/phpunit tests/integration
The ElasticSearch indexes are built from the command line.
# Build the librarians index
./bin/console librarians:build
# Edit or create a librarian, using their LibGuides ID
./bin/console librarians:edit 1234567
# Build the website index
./bin/console website:build
# Index all website pages
./bin/console website:index --all
# Index website page updated since last indexing job
./bin/console website:index
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.