Ali Esfandyari
Back to Projects

BookBinder

Architecture of an AI-powered digitization pipeline for turning raw scans into structured, offline-ready EPUB books.

Role

Product Manager & Lead Prompt Architect

Category

AI Content Digitization · SaaS

Overview

BookBinder is an end-to-end SaaS platform for readers, students, and creators who need faithful digital books instead of raw scanned PDFs. The product converts page images and document scans into clean markdown, compiles structured manuscripts, and delivers offline-ready EPUB outputs for mobile reading.

Architecture

BookBinder architecture showing ingest pipeline, literary refinement engine, and high-performance system design

Product & AI design

The core ingestion path uses Google Gemini to translate raw page images directly into markdown with strict output contracts. Prompts enforce clean body output and explicitly remove common noise such as page numbers, running headers, and footer artifacts.

To solve mid-sentence page breaks, the pipeline applies a sliding-window context strategy: the rolling tail of the previous page is injected as a delimited context block, then the model completes the next page without echoing prior context into the final output.

For full-manuscript refinement, an optional AI polish mode runs deterministic chunking, bounded parallel execution, and boundary repair passes to improve literary continuity while respecting token and context constraints.

System & offline UX

Large EPUB binaries are delivered through a backend bypass pattern. The frontend requests pre-signed S3 GET URLs, then downloads book bytes directly from AWS storage instead of proxying through the API layer. This keeps latency low and reduces backend egress overhead.

For offline reading, compiled files are cached locally via IndexedDB using localforage. Readers can open and continue books without re-downloading, even on unstable or disconnected mobile networks.

Mobile interface

BookBinder workspace showing project list and compile status

Workspace

Raw scans and drafts in one place with project-level status tracking.

BookBinder library showing offline-ready books with read and download actions

Library

Compiled books are organized for in-app reading and direct offline download.

BookBinder factory page with upload, AI polish, and EPUB generation controls

Factory

Ingest pages, run AI polish, and generate a structured EPUB from clean markdown.

Stack

Google GeminiReact 19TypeScriptViteTanStack QueryPython 3.12FastAPISQLAlchemyAWS S3SQLite/PostgreSQLIndexedDB (localforage)Capacitor

Try BookBinder

Open the live app on bookbinder.alisfand.com.

Open live demo