NextBooks is built from a Goodreads dataset of over 2,000,000 books. The live catalog includes books with usable cover images and uses Next.js 16.3, Drizzle, PostgreSQL, and Instant Navigations.
Rebuild of vercel-labs/book-inventory, now archived. Full dataset here.
See Ensuring instant navigations.
- Cache Components cache each query with
'use cache'andcacheLife. See Migrating to Cache Components. - Partial Prefetching prefetches the shared App Shell of links entering the viewport.
- Per-link prefetching prioritizes the initial browsing path: book links on the first catalog page and pagination links use
prefetch={true}, while book links on later pages wait for hover or keyboard focus before resolving their URL-dependent content. - Fast Link starts eligible mouse navigation on press for book cards, while preserving hover and focus prefetching. Pagination uses Next.js links so its inline loading indicators still work.
pnpm install
pnpm devPOSTGRES_URL is optional. Without it the app serves a small preview catalog.
pnpm lint
pnpm exec tsc --noEmit
pnpm build@next/playwright with instant(), asserting navigations stay instant. Runs in CI.
pnpm test:e2eThe original dataset contains more than two million Goodreads books. The schema uses PostgreSQL's unaccent extension for accent-insensitive title search:
CREATE EXTENSION IF NOT EXISTS unaccent;The source dataset is available from the UCSD Book Graph project.
Set POSTGRES_URL, then create the schema and load the bundled four-book sample:
pnpm db:setupOptionally generate the cover-image placeholders after seeding:
pnpm db:seed-thumbhashTo import the complete UCSD Goodreads catalog, download the compressed book
and author metadata files into the ignored data/ directory. The seeders read
gzip files directly, preserve Goodreads IDs, and checkpoint large imports:
mkdir -p data
curl -L https://mcauleylab.ucsd.edu/public_datasets/gdrive/goodreads/goodreads_book_authors.json.gz -o data/authors.json.gz
curl -L https://mcauleylab.ucsd.edu/public_datasets/gdrive/goodreads/goodreads_books.json.gz -o data/books.json.gz
AUTHORS_DATA_PATH=./data/authors.json.gz TOTAL_AUTHORS=829529 pnpm db:seed-authors
BOOKS_DATA_PATH=./data/books.json.gz TOTAL_BOOKS=2360655 pnpm db:seed-books