hoangsonww / hoangsonww/Library-Management-Backend

Auto-enrich book metadata from Open Library API

Open
#9 0 comments 0 reactions 1 assignee Claimed by @hoangsonww View on GitHub
bug documentation enhancement good first issue help wanted
Dominant language
Go
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## What problem does this solve?

`POST /api/v1/books` only accepts what the caller types in (`title`, `authorId`, `totalCopies`, ...) — there's no cover image, ISBN-derived metadata (publisher, page count, description), which makes the catalog feel bare compared to real library software.

## Proposed solution

- On book creation (or via a new `POST /api/v1/books/{id}/enrich` endpoint, for existing rows), if an `isbn` is present, look it up against the free [Open Library API](https://openlibrary.org/dev/docs/api/books) and backfill `coverUrl`, `publisher`, `pageCount`, and `description` fields where the caller didn't already supply them.
- Make this best-effort and non-blocking: a failed/slow lookup should never fail the create request — enrichment failures just leave those fields empty and can be retried later via the explicit `/enrich` endpoint.
- Cache lookups by ISBN (in-memory or a small table) to avoid hammering the external API on repeated imports of the same title.

## Alternatives considered

Requiring the caller to supply all metadata upfront — simplest to implement, but pushes tedious data entry onto whoever's stocking the catalog when a free public API can fill most of it in automatically.

## Area

Books

## Priority

Nice to have — good first issue: the enrichment call itself is a small, well-isolated piece of work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.