NovelBridge
A local-first web app that translates raw Chinese/Japanese web-novel chapters into English with consistent names, terminology, and tone — using any LLM, including a free local one, as a swappable engine.
- TypeScript
- React
- Vite
- FastAPI
- Python
- IndexedDB
- Dexie
- spaCy
- AWS




Overview
Official English translations of long web-novel series often get dropped partway through, and pasting raw chapters straight into an LLM breaks immersion. Character names change, terminology drifts, and writing style varies between chapters. NovelBridge provides a structured workflow that combines reference chapters, glossary management, and LLM-powered translation so an entire series remains coherent over time.
The project is intentionally model-agnostic. Users can translate with a local Ollama model, OpenRouter, or Gemini, bringing their own model and credentials instead of being locked into a proprietary service. References, glossaries, style profiles, drafts, and translation history are stored locally in the browser through IndexedDB, while the backend acts as stateless compute for translation, NLP, and AI-assisted analysis.
What I built
- A streaming FastAPI translation service that delivers token-by-token output over Server-Sent Events, supports configurable concurrency limits and queue timeouts, and works across local and hosted LLM providers.
- A pluggable translation-engine architecture supporting Ollama, Gemini, OpenRouter, and deterministic mock providers behind a shared interface. Provider and model selection happen per request, allowing users to switch engines without changing project data.
- An English-first glossary system designed around how readers actually consume translated novels. Terms can be categorized as characters, titles, or general terminology, include optional gender metadata, move through candidate/approved/rejected states, and influence future translations without automatically rewriting output.
- An opt-in in-context glossary review workflow that detects glossary occurrences within finished translations, highlights them for review, and lets users approve or reject terminology decisions directly from translation output.
- A reference-processing pipeline that extracts style profiles, candidate glossary terms, chapter context, and named entities from previously translated chapters. Reference content is converted into reusable metadata instead of repeatedly injecting large amounts of raw text into prompts.
- Several deterministic NLP systems built with spaCy and Python, including proper-name detection, chapter-number extraction, pronoun-drift analysis, source-language term discovery, and glossary candidate generation.
- A local-first data architecture using IndexedDB and Dexie. Projects, references, glossaries, drafts, translation history, and style profiles remain in the user's browser and can be exported or imported as JSON for backup and sharing.
- A React + TypeScript frontend featuring project management, glossary review, reference analysis, model selection, health monitoring, dark mode support, draft persistence, translation history, and long-running streaming workflows that survive tab navigation.
- AWS deployment infrastructure using Elastic Beanstalk for the Dockerized FastAPI backend and CloudFront/S3 hosting for the frontend, while keeping user content outside server-side storage.
Highlights
- Fully local-first storage model. User projects, references, glossary entries, drafts, translation history, and style profiles live in IndexedDB rather than a hosted database.
- Bring-your-own-model architecture supporting local Ollama servers, OpenRouter, and Gemini through the same workflow and UI.
- English-first glossary workflow inspired by professional translation tools, including approval states, category metadata, gender-aware character entries, and in-context review.
- Stateless backend design. Translation requests can include glossary and style data directly, allowing hosted deployments that store no user content on the server.
- Deterministic-first philosophy: term detection, glossary matching, draft management, chapter ordering, and many review workflows avoid unnecessary LLM calls.
- Comprehensive offline test coverage backed by deterministic mock engines, enabling fast development without requiring a running model.
Interesting challenges
- Building a consistency system that works with weak local models. Instead of expecting a small model to handle translation, glossary extraction, style matching, and terminology review in one prompt, the workflow breaks those concerns into focused tasks.
- Designing English-first glossary management. Readers usually know the translated name they want to see rather than the original Chinese or Japanese term, so the glossary workflow was redesigned around preferred English terms while still supporting source-language mappings.
- Migrating from a backend-persisted architecture to a browser-authoritative storage model without rewriting major UI components. A StorageService abstraction allowed API-backed and IndexedDB-backed implementations to coexist behind the same frontend interfaces.
- Balancing deterministic NLP and LLM-assisted analysis. The project uses traditional algorithms wherever possible and reserves model calls for cases that genuinely benefit from language understanding.
- Supporting local and hosted models through the same engine abstraction while allowing custom Ollama endpoints, session-only credential handling, provider-specific model lists, health monitoring, and graceful degradation when services are unavailable.