A cross-platform desktop app for AI-assisted novel planning and writing, built with Tauri v2
中文 | English
StoryBook is a local-first desktop application for novel creation. It combines project management, chapter editing, metadata organization, timeline planning, and configurable AI assistance in a single Tauri application.
The current codebase focuses on a practical writing workflow:
- manage novel projects locally
- edit chapters and characters
- maintain novel metadata and timeline outlines
- configure LLMs and Agents
- use AI to generate novel info, metadata, timeline drafts, and chat responses
- Create, update, and delete novel projects
- Store novel base information such as title, summary, style, target audience, and length type
- Save AI original requirement text for AI-created novels
- Maintain writing settings separately from the base novel record
Basictab for novel profile and writing settingsMetatab for structured novel metadata editingTimelinetab for volume/chapter-range planningWorkflowtab as a lightweight placeholder for future orchestration
- Chapter CRUD with a custom CodeMirror-based Markdown editor
- Character CRUD with role, gender, and personality fields
- Word count tracking stored on the chapter side
- AI-generated novel base info from a free-text requirement
- Streaming AI chat in the assistant page
- AI generation for novel metadata with streaming output into the editor
- AI generation for timeline content with structured JSON response and form autofill
- Writing settings can be injected into AI prompts when a novel context is available
- Manage LLM configurations in-app
- Manage Agent runtime bindings in-app
- Agent definitions, names, descriptions, and prompts are loaded from
src-tauri/src/ai/prompts/*.toml - Agent runtime config only stores
agent_code, optionalllm_config_id, and optionalextra_config - If an Agent has no runtime config row, it still works and falls back to the default LLM
- Built-in Agents currently include:
general_chatnovel_info_generatornovel_outlinechapter_timelinecharacter_designmeta_generatorchapter_contentchapter_polish
- Local password access page
- SQLite-based local data storage
- Tauri Store for local settings persistence
The current implementation supports real requests for these providers:
- OpenAI
- DeepSeek
- OpenRouter
- Ollama (OpenAI-compatible endpoint)
The codebase contains provider abstractions for more models, but not every listed provider is fully wired for real requests yet.
The repository still contains some placeholder or incomplete areas. Examples:
- workflow automation is not finished
- some AI entry points were added recently and are still evolving
- advanced structured writing pipelines are not fully connected end-to-end
- some documentation from older iterations overstated the current scope
This README reflects the current implemented behavior rather than the original roadmap.
Current built-in style enum values:
| Style | Description |
|---|---|
| Urban | Modern / city themes |
| Fantasy | Fantasy world |
| Suspense | Mystery / suspense |
| Comedy | Light / humorous |
| Romance | Relationship-driven |
| Horror | Horror / thriller |
| Sci-Fi | Science fiction |
| Historical | Historical themes |
| Wuxia | Martial arts |
| Xianxia | Cultivation fantasy |
- Vanilla JavaScript
- Vite
- CodeMirror 6
- markdown-it
- Tauri API v2
- Tauri v2
- Rust
- SeaORM
- SQLite
- Tokio
- rig-core
StoryBook/
├── src/
│ ├── api/ # Tauri invoke wrappers
│ ├── components/ # Reusable UI pieces and modals
│ ├── lib/ # Modal, markdown editor, tabs, toast, store
│ ├── pages/
│ │ ├── dashboard.js
│ │ ├── novels.js
│ │ ├── chapters.js
│ │ ├── characters.js
│ │ ├── chat.js
│ │ ├── llm-config.js
│ │ ├── agent-config.js
│ │ ├── security.js
│ │ ├── workspace.js
│ │ └── workspace/
│ │ ├── workspace-basic.js
│ │ ├── workspace-meta.js
│ │ ├── workspace-timeline.js
│ │ └── workspace-workflow.js
│ ├── state/ # Lightweight frontend state
│ ├── style/ # Global and page styles
│ ├── main.js
│ └── router.js
├── src-tauri/
│ ├── src/
│ │ ├── ai/ # LLM, Agent, prompt loading, AI execution
│ │ ├── commands/ # Tauri commands
│ │ ├── constants/ # Built-in meta and chapter property definitions
│ │ ├── entity/ # SeaORM entities
│ │ ├── repository/ # Repository layer
│ │ ├── seeds/ # Seed data
│ │ ├── db.rs # SQLite init and migration-like column checks
│ │ ├── lib.rs # Tauri app entry
│ │ ├── storage.rs # App storage paths
│ │ └── tray.rs # Tray support
│ └── Cargo.toml
├── package.json
├── vite.config.js
└── README.md
- Node.js >= 18
- Rust >= 1.70
- npm
git clone https://github.com/zzmzaizai/storybook.git
cd storybook
npm installnpm run tauri:devnpm run tauri:buildBuild artifacts are generated under src-tauri/target/release/bundle/.
- Main data: SQLite in the user app data directory
- Local settings: Tauri Store plugin
- Novel-related files: managed under the app storage directory
- The frontend uses direct DOM rendering instead of a framework
- Workspace tabs and AI features are evolving quickly; reading the current code is more reliable than relying on older screenshots or external descriptions
- Some recently added AI flows use streaming events, others use structured JSON responses depending on the editor scenario
This project is licensed under the MIT License. See LICENSE for details.