RFDs/0023
Free book catalogs
Goal
Let people find and add free, public-domain books without leaving Shōsai. The first version covers about 95,000 books from three sources: Project Gutenberg, Aozora Bunko (青空文庫) and Standard Ebooks. Browsing and searching them happen in the existing Search place, which gains a Browse free books view when its field is empty. A catalog index that we publish on a schedule makes search instant and works offline. Only the book a person chooses is downloaded.
Context
Shōsai reads EPUB and PDF files the person already has (RFD 12). Getting a book in means finding it on the web, downloading it and choosing Add books. For classics that are free anyway, that is a lot of friction, and Japanese readers have no easy route to Aozora Bunko’s texts at all: Aozora publishes XHTML and its own text markup, not EPUB.
RFD 10 leaves catalog downloads out of its format work. RFD 16 defines one search over book text and notes across the library. This RFD adds free books to that search and decides where the catalog data comes from.
The free sources were surveyed on 2026-10-24 by fetching their real feeds and catalog files:
| Source | Books | What it offers |
|---|---|---|
Project Gutenberg |
78,383 texts |
A weekly catalog file of every book with title, author, language, LCSH subjects, LoCC class and "Category" bookshelves. Predictable cover URLs. EPUB 3 with images, and EPUB without images. Its OPDS feed lists titles and authors only and is being retired in 2027. Gutenberg asks programs to use the offline catalog files rather than crawl the site. |
Aozora Bunko |
17,840 works |
One catalog file licensed CC BY 4.0 and explicitly allowed in reading
software, including commercial use. It has kana readings of titles and
authors, NDC classes, orthography (新字新仮名 and others) and the copyright
status of each work. Texts are Shift_JIS XHTML with real |
Standard Ebooks |
about 1,535 |
Carefully edited editions of public-domain books, with new cover art, rich descriptions, subjects, word counts and reading-ease scores. Their own work is dedicated to the public domain (CC0). English only. |
Open Library and the Internet Archive list 1.86 million works with a public scan, but the files are OCR’d page scans (one sample EPUB was 30 MB). OpenStax has 84 textbooks as PDFs. Feedbooks' public-domain catalog is gone, ManyBooks blocks programs, and Wikisource, Faded Page, Gutenberg Australia and HathiTrust offer HTML pages or scans rather than a catalog of books.
Proposal
One Search, with Browse inside it
Search stays one place, modelled on how Spotify combines browsing and search. There is no separate Discover place, because two places that both find books, one for the library and one for free books, would be confusing.
-
Empty field. Search shows recent searches, then Browse free books: a grid of category tiles such as Classics of Literature, Science Fiction & Fantasy, Crime & Mystery, Children & Young Adult, Poetry, 青空文庫 · 小説 and 青空文庫 · 童話, plus New from Standard Ebooks. Clearing the field returns to this view.
-
Typing. One query covers your books, your notes and free books. Your own matches come first, then authors and free books. Chips narrow the results to Your books, Notes, Free books or Authors. The Free books chip adds catalog filters: language, genre, length and source.
-
Entry points. The Search item in the sidebar, kbd:[⌘K] or kbd:[Ctrl+K] from anywhere, and the Search tab on phones. Find in this book stays in the reader’s own search bar.
Book page
Every free-book result and tile opens a book page: cover, title, author with life dates, first publication, language, summary, subjects and reading ease where the source has them. One work can have several editions, for example a Standard Ebooks edition and two Gutenberg files, or one Aozora work in several orthographies. The page lists them with their sizes, the best edition selected first. Add to library downloads the chosen file and adds it like any other book. The page shows the edition’s rights line and credits its source.
Aozora Bunko
The Aozora tiles open an author index by kana rows (あかさたな…), which only Aozora’s kana readings make possible, with filters for orthography and NDC class. Aozora works have no covers, so Shōsai draws a cover from the title and author in the book face.
Adding an Aozora work downloads its XHTML, converts it from Shift_JIS, and wraps it in an EPUB 3 with vertical writing, the original ruby, and Aozora’s colophon (底本, 入力, 校正) kept as the license asks. From then on it is an ordinary EPUB in the library and uses the vertical text, ruby and emphasis-dot support Shōsai already has.
A catalog index we publish
A scheduled job builds one merged catalog from the sources' own catalog files and publishes it as a static site on Cloudflare Pages, either on the Shōsai website or as a separate project. It runs weekly, matching Gutenberg’s weekly catalog file, and can run daily because a build takes seconds. It publishes:
-
manifest.json: format version, build date, counts per source, and the size and SHA-256 of each file. -
catalog.sqlite.gz: books, editions, authors, subjects and categories, with editions of the same work merged across sources. About 7.5 MB today. -
Small cover thumbnails for editions whose source has none at a usable size.
The app checks the manifest at most once a day while Search is in use, downloads the catalog only when it changes, verifies the checksum, builds a trigram full-text index on the device (about 3 seconds, needed for Japanese substring search) and swaps the new catalog in atomically. The catalog lives in its own database file, separate from the library store, so replacing it never touches the person’s books or notes.
Covers and book files load from each source when they are needed. Browsing downloads metadata and small cover images only.
Publishing the index rather than calling each source live gives one search across sources with merged editions, filters and offline use, and keeps the app’s traffic to each source down to cover images and the books people add. Building it ourselves, rather than on each device, keeps the app from downloading and parsing the sources' raw catalog files, lets us merge editions and fix data in one place, and lets us add sources without an app update.
Rights and credit
Each book page shows its source’s rights line, such as "Public domain in the USA", followed by "If you live elsewhere, check your local laws." Shōsai does not block books by region. Every edition credits its source by name with a link to it; Standard Ebooks editions also link to the page where readers can support the project. The app’s About screen and the published index credit Aozora Bunko’s catalog data under CC BY 4.0.
The catalog leaves out Aozora works that are still in copyright, which Aozora shares for private reading only, and Gutenberg’s audio books.
Alternatives considered
A separate Discover place
A Discover place beside Library and Search, with its own shelf of free books and its own search, was mocked up first. It was rejected because two places that both find books, differing only in where the books come from, are confusing.
Live requests to each source
The app could call each source directly with no index and nothing to host. Gutenberg’s feed lists arrive without covers or summaries, there is no cross-source search or merging, Aozora has nothing to call, and Gutenberg’s XML feed ends in 2027.
Building the index on each device
The app could download Gutenberg’s and Aozora’s catalog files and build the index itself. That avoids hosting, but every device repeats the parsing and merging, data fixes need an app update, and some sources could not be added this way at all.
Decisions
Recorded from owner review on 2026-10-24.
-
One Search with Browse inside, modelled on Spotify; no separate Discover place.
-
We publish the catalog index on a schedule, served from the Shōsai website or a separate Cloudflare Pages site, rather than each device building it.
-
The first version’s sources are Project Gutenberg, Aozora Bunko and Standard Ebooks. Open Library is later, for matching editions and covers. OpenStax textbooks are optional.
-
Rights: every book shows its source’s rights line and nothing is blocked by region.
-
Credit: every book credits its source, and Standard Ebooks editions link to the page where readers can support them.
Dependencies and consequences
-
RFD 12: Search becomes a place with its own screen on desktop and tablet. Its surface table changes when this lands.
-
RFD 16: search results gain free books after the person’s own books and notes.
-
RFD 10: catalog downloads stay out of the format work; this RFD owns them.
-
RFD 13: the catalog site is deployed and monitored alongside the release infrastructure.
-
RFD 11: none. The catalog is the same for everyone and is not synchronized.
Implementation
The build job, the app work and their order are tracked in RFD 23 implementation checklist.