Skip to main content
If you want to run from source, extend the app, or contribute code, start here to learn the repository’s tech stack, module layout, and startup workflow. We recommend first reading the “Run from Source (Developers)” section in Installation & Download, which covers the quickest startup flow.

Tech Stack

Directory Structure

The repository uses a pnpm workspace to organize multiple packages. Key directories are: The full directory definition is in the repository source.

V1 and V2 Relationship

The V2 core lives in server/src/modules/director/. Business capabilities are exposed through the application layer. V1 retains its own orchestration modules. Both versions share saved novel assets and underlying chapter capabilities, while tasks, recovery, and version ownership are managed independently. To temporarily disable V2, set DIRECTOR_NEXT_ENABLED=false in server/.env. This closes the V2 entry point without switching the director for existing novels. For more version isolation rules, see the Development Wiki on GitHub and the Module Boundaries note.

Environment Requirements

Common Commands

Run the following commands from the repository root. The full script list is in the root package.json.
Desktop development requires downloading the Electron runtime on first launch. If the network is unavailable, configure a proxy or mirror first. You can also run pnpm run prepare:desktop-runtime separately.

Testing

Tests use Node’s built-in node:test and node:assert/strict. Backend fast tests exclude heavy files such as real SQLite paths, migration smoke tests, RAG-compatible imports, and prompt governance scans by default. These are covered by test:integration and test:all. When adding pure functions or states, add a corresponding *.test.js under server/tests/, keeping the existing style: run pnpm run build first, then require("../dist/...") to reference compiled output. For more detailed test scope and isolation rules, see the Backend Testing Guide.

Development Wiki

The project’s stable knowledge is stored under docs/wiki/, covering architecture decisions, workflow boundaries, module ownership, and debugging experience. It is not a release changelog. Directories include:
  • docs/wiki/architecture/: module boundaries, configuration ownership, API access token boundaries, etc.
  • docs/wiki/workflows/: director runtime, chapter production chain, task states, book breakdown workflow, etc.
  • docs/wiki/prompts/: Prompt Registry, structured output, JSON repair, etc.
  • docs/wiki/rag/: Knowledge Base and context assembly
  • docs/wiki/debugging/: recurring failure modes, database migration drift, test isolation, etc.
  • docs/wiki/product/: beginner-first and whole-book completion principles, workbench state expression, etc.
The full wiki index is at docs/wiki/README.md. After changes to core chains such as the director, chapter production, Prompt Schema, or task recovery, update the corresponding wiki page.

Environment Variables

Server and frontend configuration reference

Contributing

Report issues, submit PRs, and community links