-
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
- add lazy load for books 15 to 28 and so on
- remove commented code - rotational placeholder feature
- [ ]
- 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
- Get PostgresQL installed
- Check dependencies - querystring API0.2.1 (legacy) URLSearchParams API instead?
-
need a data storage solutionmaybe not? - improve dev ops understanding
- add footer
- Add feedback form
- add instructions/user info messages
- add open library api cover search? e.g. https://covers.openlibrary.org/b/isbn/9780199955053.jpg
-
might be able to use https://github.com/e-e-e/bookcovers - generate book covers?
- change API to call from Discovery API
- 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
- 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
- test subjects from librarians lists - plus spec col topics
- optimise speed
- testing
- digi marketing - fonts
- analytics - GA or clarity?
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.
- 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.
- 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.
Make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/yourusername/book-search-app.git
Navigate into the project directory: bash cd book-search-app
-
Install the dependencies: bash npm install
-
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
-
Start the development server: bash npm run dev
-
Open your browser and go to http://localhost:3001.
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.
- 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.