How up2wp/story-matrix-ai works
Story Matrix AI is a full-stack AI-assisted novel-creation application. Authors move through story seeding, world building, outlining, constraints, and chapter drafting, iterating as needed; supporting workflows include imported-work backfill, proofreading/export, audiobook creation, and visual-asset generation. The React client routes users to these workflows and persists work through a REST API backed by SQLite. AI, Voicebox, image-provider, and optional Immich integrations are mediated by backend routes and services. README documents capabilities not covered by the sampled source; those are represented at their supported directory paths, without asserting unverified internal wiring.
Main entry points: store.ts Work State · App.tsx Application Router · index.ts API Server · SeedPage.tsx Story Seed
Components 33
Novel Creation
- Work Management
src/pages/works/WorksPage.tsx - Story Seed
src/pages/seed/SeedPage.tsx - World Builder
src/pages/world/WorldPage.tsx - Outline Editor
src/pages/outline/OutlinePage.tsx - Core Constraints
src/pages/constraints/ConstraintsPage.tsx - Chapter Writing
src/pages/chapters/ChaptersPage.tsx - Import Backfill
src/features/backfill/useImportBackfill.ts - Proofreading
src/features/proofread/useProofread.ts - Preview & Export
src/features/preview/usePreview.ts
Client Platform
- Application Router
src/App.tsx - Work State
src/core/store.ts - REST Client
src/core/api-client.ts - AI Client
src/ai/client.ts
Backend Services
- API Server
server/src/index.ts - Work Routes
server/src/routes/works.ts - SQLite Database
server/src/db.ts - AI Routes
server/src/routes/ai.ts - Image Provider Services
server/src/services/image-generation-runner.ts - Immich Client
server/src/services/immich-client.ts
Media Workflows
- Audiobook Workflow
src/features/audiobook/useAudiobook.ts - Voicebox Proxy
server/src/routes/voicebox.ts - Visual Assets
src/features/image-generation/useImageGeneration.ts - Image Generation API
server/src/routes/image-generation.ts - Imagegen Workspace
server/src/routes/imagegen.ts
Accounts & Config
- Authentication
server/src/routes/auth.ts - User Management
server/src/routes/users.ts - System Configuration
server/src/routes/system-config.ts
Other components
- Author
- Administrator
- Configured AI
- Voicebox Service
- Image Provider
- Immich Storage
Connections 48
- Author → Application Router: uses
- Administrator → Application Router: administers
- Application Router → Work Management: routes
- Application Router → Story Seed: routes
- Application Router → World Builder: routes
- Application Router → Outline Editor: routes
- Application Router → Core Constraints: routes
- Application Router → Chapter Writing: routes
- Author → Story Seed: starts story
- Story Seed → World Builder: advances creation
- World Builder → Outline Editor: advances creation
- Outline Editor → Core Constraints: advances creation
- Core Constraints → Chapter Writing: guides drafting
- Work Management → Work State: updates work
- Story Seed → Work State: updates work
- World Builder → Work State: updates work
- Outline Editor → Work State: updates work
- Core Constraints → Work State: updates work
- Chapter Writing → Work State: updates work
- Import Backfill → Work State: updates work
- Proofreading → Work State: edits work
- Preview & Export → Work State: reads work
- Work State → REST Client: requests data
- REST Client → API Server: sends REST requests
- API Server → Work Routes: dispatches work requests
- API Server → Authentication: dispatches auth requests
- API Server → User Management: dispatches user requests
- API Server → System Configuration: dispatches config requests
- Work Routes → SQLite Database: reads/writes works
- User Management → SQLite Database: reads/writes users
- System Configuration → SQLite Database: reads/writes config
- Authentication → SQLite Database: reads/writes accounts
- Import Backfill → AI Client: requests extraction
- Audiobook Workflow → AI Client: requests prompts
- AI Client → API Server: posts AI requests
- API Server → AI Routes: dispatches AI requests
- AI Routes → Configured AI: forwards prompts
- Author → Audiobook Workflow: creates chapter audio
- Audiobook Workflow → Voicebox Proxy: requests Voicebox operations
- Voicebox Proxy → Voicebox Service: proxies requests
- Author → Visual Assets: creates visual assets
- Visual Assets → Image Generation API: requests generation
- Author → Imagegen Workspace: uses workspace
- Imagegen Workspace → Image Provider Services: requests image operations
- Image Generation API → Image Provider Services: runs generation
- Image Provider Services → Image Provider: sends image requests
- Image Provider Services → Immich Client: stores/retrieves assets
- Immich Client → Immich Storage: uses storage API