← All Projects
My Library

My Library

Search millions of books, import with one click, and organize your collection with categories and custom views

react-native
sqlite
rest-api
context-api
typescript
mobile
database
api-integration
google-gemini
app-hero

Problem

Readers tracking physical book collections had no offline-capable tool that combined barcode scanning for quick import, multi-filter search for large libraries, reading analytics, and AI recommendations — all without requiring an account or internet access for core functionality.

Stack Decisions

SQLite with versioned migrations

A migration runner checks the current schema version on startup and applies pending migrations in order. This lets the schema evolve across app updates without wiping user data — critical for an app where the library is the entire value.

Google Books API for barcode import

Scanning an ISBN and hitting the Books API to pre-fill title, author, cover, and page count made adding a book a 3-second flow instead of a form-fill. The API was chosen over Open Library for its cover image quality and query reliability.

Gemini for personalized recommendations

Sending the full library — titles, authors, ratings, categories, and reading status — as context gave Gemini enough signal to produce recommendations that matched reading taste rather than just genre tags. The prompt is constructed dynamically from the live SQLite state.

Challenges

01

Schema migrations without data loss

Adding columns to existing tables with ALTER TABLE is safe in SQLite, but renaming tables or columns requires a full copy-and-drop sequence. The migration runner wraps each migration in a transaction so a failed upgrade rolls back cleanly rather than leaving the schema in a partial state.

02

Barcode scanning across device cameras

EAN-13 scanning failed on low-light and low-resolution cameras when using the default scanner configuration. Adjusting the scan region, enabling torch on demand, and adding a manual ISBN entry fallback covered the cases where optical scanning wasn't reliable.

03

Gemini token limits with large libraries

A library of 300+ books exceeds the context window when serialized naively. The prompt builder selects the most relevant fields (title, author, rating, category) and truncates older, unrated entries to stay within limits while preserving the signal that matters most for recommendations.

Outcome

Barcode scanning, reading analytics, AI recommendations, CSV export, and multi-filter search — all local-first with no account required. The versioned migration system shipped three schema upgrades across app versions without a single reported data loss, which validated the approach for future iterations.