Skip to content

Repository files navigation

To do:

  • user input - if they input more than one word aka want a phrase search "social psychology" need to pass param as 'su=' not 'su:' results in too many 500s
async function searchBooks(token, subject, digitalOnly) {
  const apiUrl = "https://metadata.api.oclc.org/worldcat/search/brief-bibs";

  // Check if subject contains a space
  const isSingleWord = !subject.includes(' ');

  // Construct query parameter based on whether it's a single word or multiple words
  const queryParam = isSingleWord ? `su:${subject}` : `su="${subject}"`;

  const params = new URLSearchParams({
    q: queryParam,
  • look up librarian toolbox worldcat indexing ref webpage
  • if want to use DDC to search in some way, use 'Dewey Linked data' api and can get FAST URI to use that API for subjects

next:

  • add lazy load for books 15 to 28 and so on
  • remove commented code - rotational placeholder feature
  • [ ]

fix:

  • need to double click twice on the first example pulled, if user does not search first
  • leave subject in search bar after search complete
  • book covers
  • add title and style

problems

  • Get PostgresQL installed
  • Check dependencies - querystring API0.2.1 (legacy) URLSearchParams API instead?
  • need a data storage solution maybe not?
  • improve dev ops understanding

yes features:

layout:

  • book preview
  • ebook button colours
  • card colours - lighter than browse button
  • add title text on hover over book covrs?
  • icons?
  • dark mode? new website design is dark mode first
  • enhance book cover images design
  • remove carousel and go to responsive grid layout after UX insights
  • sort alignment issues - https://tailwindcss.com/docs
  • ebook toggle design - where should it be located? Wording?
  • alter colours - esp eBook button (stay light until toggled)
  • Remove transparency from book covers not currently selected
  • make covers larger
  • on xl/l, add white space to left and right of results for a 5 x layout?
  • integrate title overlay on book covers

maybe features:

  • book cover removal notice?
  • on initial load, add some buttons for users to click and try out searches?
  • add more explanatory text?
  • item blurb/summary? card to load external record inside app?
  • Add advanced searching with DDC number option?
    • add DDC guidance when no items found for subject?
  • Export record urls? No because library search has that feature

finalising

  • test subjects from librarians lists - plus spec col topics
  • optimise speed
  • testing
  • digi marketing - fonts
  • analytics - GA or clarity?

Book Search Application

Overview

This project is a Book Search Application built with Next.js that allows users to search for books in our holdings. Users can search for all books or filter results to show only eBooks using a toggle switch. Once the user has found an interesting book cover they can click the cover to be directed to the Library Search record.

Features

  • Search Functionality: Users can enter a subject to search for relevant books.
  • Book Cover Display: Displays book covers along with titles, allowing users to click through to the record for more information and access/reserve the resource.
  • Toggle for eBooks: A toggle switch allows users to filter results to show full text digital books.
  • Responsive Design: The application is designed to be responsive and user-friendly on various devices.
  • Accessibility (under testing/improvement): alt text is automatically generated from metadata on all book cover images.

Technologies Used

  • Next.js: A React framework for building server-side rendered applications.
  • React: The UI and carousel component for displaying book covers in a slider format.
  • OCLC Metadata API: An external supplier API used to fetch book data.
  • Google Books API: An external public API used to fetch book covers.

Getting Started

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/book-search-app.git

Navigate into the project directory: bash cd book-search-app

  1. Install the dependencies: bash npm install

  2. Set up environment variables: Create a .env.local file in the root of the project and add your OCLC credentials: text OCLC_CLIENT_ID=your_client_id OCLC_CLIENT_SECRET=your_client_secret SYMBOL=your_symbol

  3. Start the development server: bash npm run dev

  4. Open your browser and go to http://localhost:3001.

Usage

Enter a subject in the search bar. Use the toggle switch to filter results for digital books only. Click the "Search" button to fetch and display the results.

Contributing

License

Acknowledgements

  • OCLC makes it possible to access our holdings via the Metadata API.
  • Inspired by various open-source projects and tutorials on Next.js and React.

About

View book covers of our collection online

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages