Bookshelf
Bookshelf (বইঘর) - a Bengali reading app with 100+ free books, a 3D bookshelf, a distraction-free reader, ebooks and offline reading. Started in 2021 with React and Firebase, rebuilt in 2026 on Next.js 16.

- Pet Project
- Reading App
- Next.js
- PWA
Bookshelf (বইঘর) is a web app for reading Bengali books for free. Readers browse a library of 100+ books across 36 genres and 60+ authors, open a book and read it chapter by chapter, and the app picks up exactly where they left off. Admins sign in to write, import, publish and back up books.
I built the first version in 2021 with React, Material UI and Firebase to track my own reading. In 2026 I rebuilt it from scratch on Next.js 16 as a proper reading product, keeping the existing Firestore data.
At a glance
- Role: Solo developer: product, design, frontend, data layer and deployment
- Stack: Next.js 16 (App Router, Turbopack), React 19, TypeScript, Tailwind CSS 4, shadcn/ui, TanStack Query 5, Firebase, Serwist
- Interface: Fully in Bangla, with Bengali numerals and fonts
- Live: bookshelf.msar.me
Key features
Library and discovery: The home page has a daily pick, featured books, new arrivals and genre chips. Genre, author and tag pages group the catalogue. A /library view shows every book as a spine on an illustrated bookcase; picking one opens it as a book with a page-turn animation and its table of contents.
Phonetic search: Bengali readers often type in English letters. Search runs the query through an Avro phonetic parser, so golpo finds গল্প. / focuses search and ⌘K opens it from any page.
Distraction-free reader: The toolbar and header hide while you read. The reader has a progress bar, arrow-key and swipe navigation, and an end-of-chapter card, and it prefetches the next chapter. Readers can choose from six colour themes, three Bengali fonts, text size, line spacing and width, and turn on a bionic reading mode. The screen stays awake while reading.
Resume anywhere: Reading progress is saved for every book, including the chapter, the place within it and which chapters are done. The book page marks read chapters and offers to continue.
Ebooks and your own files: Admins upload PDF and EPUB ebooks; the title, author, page count and cover are read from the file. PDFs render as pages with a thumbnail sidebar. Visitors can also open their own EPUB, PDF, Markdown, HTML or text file in the same reader. The file never leaves their browser.
Generated covers: Most books have no cover art, so each one gets a procedural SVG cover from more than 25 illustrated designs, chosen from the book's ID so it stays the same everywhere.
Offline and installable: The app is a PWA. Readers can download books for offline reading, and failed pages fall back to an offline screen.
Admin console: A dashboard and books table with filters and a publish toggle, chapters with drag-to-reorder and undo, a full-page Markdown editor with live preview and draft autosave, EPUB import with a preview, cover uploads, ebook management, and JSON backups with restore.
Technical challenges
Rebuilding without losing data. Years of books and chapters already lived in Firestore under the old app's structure. I kept the data, wrote a resumable, quota-aware backfill script for the new fields, and built a single table-of-contents document per book, so a reader loads one document instead of every chapter.
Fast pages on a client-side database. Pages are server components that prefetch data and hand it to TanStack Query, then the Firestore SDK takes over in the browser. Profiling with Lighthouse showed the entry animation was hiding already-rendered text, and that the auth iframe and unused Firebase modules were in the main bundle. After fixing those, observed LCP fell from about 1 second to under 200 ms, and the book page went from four Firestore requests on load to none.
Security when the browser talks to the database. The client reads Firestore directly, so the security rules are the real access control. Signed-out readers only see published, public books; owners and super admins can write; and ebook files in Storage follow their Firestore record's visibility through cross-service rules.
Swappable backend. All data access goes through a driver layer with repository interfaces for books, chapters, ebooks and storage. Firebase is the current driver, and nothing outside it imports the Firebase data SDKs, so the app can move to another provider without touching pages or hooks.
Quality
- TypeScript strict throughout, with ESLint and
tscchecks - Vitest unit tests for the data driver, EPUB parsing, imports, reading progress, roles, taxonomy and cover generation
- Lighthouse baselines recorded before and after each round of performance work






