Digital Research Books' front end application based on NYPL's Reservoir Design System.
Provides a "Welcome page" entry point with heading, search box, and tagline. Connects to an ElasticSearch index via an API endpoint (https://digital-research-books-api.nypl.org). Simple searches can be entered in the form and an index response is displayed back to the user.
This is a Next.js project bootstrapped with create-next-app
.
- Install Node.js v18 or later
- To view pdfs locally through the webreader, you will need to set up a local proxy. If you used environment variables from
.env.sample
you should be able to pull the web-reader repo, install it, and runnpm run cors-proxy
. See the web-reader repo for more instructions
- Install the required packages
npm install
- Create a
.env
file and add required environment variables. See.env.sample
for an example.
npm run dev
In order to successfully login under a local deployment, you will need to update your machine's etc/hosts
file. This hosts file maps local host names to ip addresses.
This is necessary because NYPL's authentication system works by reading cookies and parsing the patron's encrypted credentials. These cookies only work on .nypl.org domains, so we need to map our local deployment to a .nypl.org domain.
Add this line to your etc/hosts
file:
127.0.0.1 local.nypl.org
- Download and install Docker.
cd
intosfr-bookfinder-front-end
repo- To build and run the application, run:
docker-compose up
- Check that app is being served at http://localhost:3000
- Create a new branch off
development
with the nameNO-REF_prepare-<VERSION>
, i.e.NO-REF_prepare-1.2.3
. Replace any reference to "Pre-release" and the previous production version in the package.json and package-lock.json files with the current version number. Push the branch and create a Pull Request with the nameNOREF prepare <VERSION> release
, i.e.NOREF prepare 1.2.3 release
. Merge these changes once the PR is approved. - Create a Pull Request to
production
fromdevelopment
with the nameRelease <VERSION> to production
, i.e.Release 1.2.3 to production
. The description of the PR should be the new version's changelog to be used in the tag and release step of the .yaml file. - Merge the PR after approval to trigger the
build-production.yaml
GitHub Action, which pushes a Docker image to ECR, updates theproduction
ECS deployment, and creates a new release version on GitHub. - Add the link to the PR to the release ticket in Jira and tag the appropriate member of QA, the project manager, and the product manager. Move the ticket to "In QA" and assign it to the appropriate member of QA. QA should be done on https://drb-qa.nypl.org/.
- NextJS
- NYPL Design System
- NYPL Web Reader
Currently takes in a query string to pass along to the ResearchNow Search API which submits a keyword search to the Elasticsearch instance, and renders the returned output. Sends the query
parameter specified in the rendered search form on the main page.
Search via keyword, author, title, subject have been implemented. Terms use the AND boolean operator by default. Search terms can also use the OR boolean operator and search terms can be quoted for phrase searching. Combinations of these can be used as well for more complex searching using the basic search input.
Term combinations
- One term: jefferson
- Multiple terms: world war
- Phrase: "English Literature"
- Single term and phrase: james AND "English Literature"
These types of combinations can be used with any available field selection.
Search Results can be filtered by year range, language and available format.
Advanced Search works like the Simple Search, but allows searching for multiple fields and for pre-filtering. Terms use the AND boolean operator Term combinations
- Example: Subject:"English Literature" AND Keyword:"Witches"
- Each source record is represented as an Item (something that can actually be read online), which are grouped into Editions (e.g. the 1917 edition of X), which are in turn grouped into Works, (e.g. Moby Dick, or, The Whale). Through this a user can search for and find a single Work record and see all editions of that Work and all of its options for reading online.
- The information and code for this normalization is found in the drb-etl-pipeline repo
- Books can be read three ways:
- Embedded page: DRB embeds a read-online page from a different source. DRB commonly does this for Hathitrust books
- Webpub reader: DRB serves an epub through the webpub-viewer. DRB commonly does this for Gutenberg Project books.
- Download: DRB offers a link to download the book online. This is often done for PDFs.
The EPUB to Webpub Next.js app is deployed at https://epub-to-webpub.vercel.app
. The /api/[containerXmlUrl]
endpoint is used by the DRB backend to convert container.xml
files of exploded EPUBs to webpub manifests.
To run unit tests, run npm run test
in the terminal.
Diagrams for DRB can found via our public Structurizr link and can be updated in the (c4-diagrams repo)[https://github.com/NYPL-Simplified/c4-diagrams].
As of September 2023, the rspec-integration-tests.yml workflow is no longer in use and has been replaced by the Playwright.yml workflow. Please contact the DRB team in Digital for more information.