A private, offline-first local workspace for writing books in Markdown, designing covers, and exporting print-ready PDFs.
Book Forge is an all-in-one, local desktop web application designed for authors, researchers, and technical writers who want to write and publish books without relying on cloud services, accounts, subscriptions, or proprietary formats.
Everything stays 100% offline on your computer.
New Book ➔ Add Chapters & Outline ➔ Write in Markdown ➔ Add Local Images ➔ Design Cover ➔ Preview ➔ Export PDF
- Multiple Page Formats: Standard A5 (fiction/non-fiction), 6 × 9 in (trade book), and A4 (workbook/manual).
- Chapter Arrangement: Add, rename, delete, and reorder chapters up/down on the fly.
- Word Counts: Live word counting per chapter and aggregated across the whole manuscript.
- Local Storage: Backed by high-performance SQLite via Drizzle ORM in the
data/directory.
- Split-Screen Studio: Dual-pane editor with live rendered preview using
react-markdownandremark-gfm. - Formatting Toolbar & Hotkeys: Quick shortcuts for headings (H1–H3), bold, italic, blockquotes, ordered/unordered lists, code, and links.
- Embedded Media: Upload local PNG, JPG, WebP, and GIF images (up to 20 MB) with 1-click Markdown embedding.
- Real-Time Autosave: Background autosave with non-intrusive status indicators so you never lose your progress.
- Preset Design Themes: Classic Minimalist, Modern Emerald, Midnight Indigo, Terracotta Earth.
- Layer Editing: Customizable typography, colors, background styles (solid, gradient, image), and logo/photo uploads.
- 300 DPI High-Resolution Export: Renders a print-ready PNG cover and automatically binds it to your book's PDF output.
- Print-Aware Book Template: Seamless layout rendering cover page, half-title / title page, automatic Table of Contents (TOC), and paginated chapters.
- Precise Page Breaks: Built-in CSS Paged Media (
@page,break-after: page) ensuring clean transitions between chapters. - Custom Typography: Adjust font families (Serif, Sans, Monospace), font size, line height, and margins.
- Dual Export Options:
- Headless PDF Engine: One-click PDF generation via Playwright.
- Browser Native Print: Direct system print dialog fallback with full
@media printsupport.
- 1-Click Project Duplication: Clone an entire book with all its chapters, settings, cover art, and local image assets.
- Full ZIP Export: Download your project as a self-contained
.ziparchive containingbook.json, individual chapter.mdfiles, and theuploads/folder. - ZIP Import: Restore or migrate books across machines effortlessly.
- Standalone Window: Runs as a lightweight local desktop app without browser toolbars.
- Dynamic Zoom Controls: Full zooming support via
Ctrl++/-,Ctrl+0(reset), andCtrl+ Mouse Wheel scroll. - Offline & Private: Completely isolated on your local machine with automatic background server lifecycle management.
| Layer | Technology |
|---|---|
| Desktop Wrapper | Electron 44 (Native window, auto-start, zoom integration) |
| Framework | Next.js 16 (App Router, Turbopack, Server Actions) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS v4 |
| Database & ORM | better-sqlite3 + Drizzle ORM |
| Markdown Engine | react-markdown + remark-gfm |
| PDF Generation | Playwright (Chromium headless) |
| Archives | JSZip |
| Test Suite | Vitest |
- Node.js: v20.x or higher
- pnpm: v9.x or higher
-
Clone the repository:
git clone https://github.com/takzen/book-forge.git cd book-forge -
Install dependencies:
pnpm install
-
Install Playwright browser binaries (for PDF generation):
pnpm exec playwright install chromium -
(Optional) Create a Desktop Shortcut (Windows):
pnpm shortcut
-
Start Book Forge as a Desktop App (Electron):
pnpm electron:dev
Alternatively, to run only in the web browser:
pnpm dev
pnpm electron:dev— Start the application in an Electron desktop window with hot reload.pnpm electron:start— Run the production build in an Electron window.pnpm electron— Open the Electron wrapper directly.pnpm shortcut— Create a native Windows Desktop shortcut with icon for Book Forge.pnpm dev— Start the Next.js development server (browser mode).pnpm build— Build the optimized production application.pnpm start— Start the production server.pnpm test— Run the automated test suite with Vitest.pnpm lint— Run ESLint check.pnpm db:generate— Generate Drizzle ORM schema migrations.pnpm db:push— Push schema changes directly to SQLite.
book-forge/
├── data/ # Local SQLite DB and uploaded media (auto-created)
│ ├── book-forge.db
│ └── uploads/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ ├── books/[bookId]/export/ # ZIP archive export
│ │ │ ├── books/[bookId]/pdf/ # Playwright PDF rendering
│ │ │ └── uploads/ # Local image serving and uploading
│ │ ├── books/[bookId]/ # Manuscript editor studio
│ │ │ ├── cover/ # Cover design studio
│ │ │ ├── preview/ # Full book preview & PDF controls
│ │ │ └── print/ # Clean printable layout
│ │ ├── dashboard/ # Book library & ZIP import
│ │ └── layout.tsx
│ ├── components/
│ │ ├── cover/ # Cover designer canvas and controls
│ │ ├── dashboard/ # BookCard component with actions
│ │ ├── editor/ # Markdown editor with live preview
│ │ ├── preview/ # Book preview viewer
│ │ └── sidebar/ # Navigation and chapter management
│ └── lib/
│ ├── books.ts # Core business logic (CRUD, duplicate, ZIP)
│ └── db/ # Drizzle schema and connection
├── tests/ # Integration & unit test suites
├── drizzle.config.ts # Drizzle Kit configuration
├── vitest.config.ts # Vitest runner configuration
└── PLAN.md # Architectural blueprint & roadmap
This project is licensed under the MIT License — see the LICENSE file for details.