# knee2420/novelbiblewiki architecture

> Architecture diagram of the GitHub repository knee2420/novelbiblewiki, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/knee2420/novelbiblewiki
- Repository: https://github.com/knee2420/novelbiblewiki

## Overview

My-Wiki is an Electron/web writing-world wiki for managing novel entities, scenes, episodes, plots, and AI-assisted analysis. The main workflow is to open an archive or dashboard, inspect or edit wiki content, and use AI tools to analyze scenes or characters and review proposed entities. The graph preserves the documented UI domains and core schema/graph modules. Some renderer-to-main IPC wiring and unsampled feature internals cannot be verified from the excerpts, so those links are omitted or marked unverified.

Main entry points: [`my-wiki/src/renderer/src/App.tsx`](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/App.tsx) (Application router), [`my-wiki/src/main/handlers/aiHandler.ts`](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/handlers/aiHandler.ts) (AI request handlers), [`my-wiki/src/renderer/src/components/Analysis/CharacterAnalysisEngine.tsx`](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/CharacterAnalysisEngine.tsx) (Character analysis), [`my-wiki/src/renderer/src/main.tsx`](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/main.tsx) (Renderer bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["Application router<br/>[App.tsx]"]
  node_layout["Wiki layout<br/>[WikiLayout.tsx]"]
  node_web_entry["Renderer bootstrap<br/>[main.tsx]"]
end

subgraph group_wiki["Wiki workspace"]
  node_archives["Wiki archives<br/>[GenericArchive.tsx]"]
  node_entry["Wiki entry detail"]
  node_create["Create entry<br/>[CreateNewModal.tsx]"]
  node_wiki_types["Wiki data types<br/>[wiki.ts]"]
  node_names["Name resolution<br/>[nameResolver.ts]"]
  node_home["Home dashboard<br/>[HomeDashboard.tsx]"]
end

subgraph group_story["Story planning"]
  node_plot["Plot dashboard<br/>[PlotDashboard.tsx]"]
  node_episodes["Episode archive<br/>[EpisodeArchive.tsx]"]
  node_canvas["Episode canvas<br/>[EpisodeCanvas.tsx]"]
  node_board["Relation board<br/>[RelationBoard.tsx]"]
end

subgraph group_ai["AI tools"]
  node_analysis["Character analysis"]
  node_growth["Character growth tree"]
  node_analysis_types["Analysis schema types<br/>[analysis-schema.ts]"]
  node_schema_page["AI schema settings<br/>[AISchemaPage.tsx]"]
  node_schema_wizard["Schema wizard<br/>[SchemaWizard.tsx]"]
end

subgraph group_runtime["Persistence and runtime"]
  node_ai_handler["AI request handlers<br/>[aiHandler.ts]"]
  node_prompt["Prompt builder<br/>[promptBuilder.ts]"]
  node_gemini_schema["Gemini schemas<br/>[geminiSchema.ts]"]
  node_wiki_service["Wiki file service<br/>[wikiService.ts]"]
  node_character_service["Character file service"]
  node_analysis_handler["Analysis handlers<br/>[analysisHandler.ts]"]
  node_web_service["Web API adapter<br/>[webWikiService.ts]"]
end

node_writer(("Writer"))

node_writer -->|"uses"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_plot
node_app -->|"routes to"| node_episodes
node_app -->|"routes to"| node_board
node_app -->|"routes to"| node_archives
node_app -->|"renders"| node_entry
node_episodes -->|"renders"| node_canvas
node_entry -->|"renders"| node_growth
node_board -->|"resolves names"| node_names
node_analysis -->|"uses"| node_analysis_types
node_schema_page -->|"renders"| node_schema_wizard
node_app -.->|"opens analysis"| node_analysis
node_app -->|"routes to"| node_schema_page
node_web_entry -->|"renders"| node_app
node_web_entry -->|"installs adapter"| node_web_service
node_app -.->|"requests wiki data"| node_web_service
node_ai_handler -->|"builds prompts"| node_prompt
node_prompt -->|"uses schema"| node_gemini_schema
node_ai_handler -->|"updates wiki"| node_wiki_service
node_ai_handler -->|"updates characters"| node_character_service
node_analysis_handler -.->|"calls Gemini"| node_writer
node_analysis -.->|"requests analysis"| node_analysis_handler

click node_app "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/App.tsx"
click node_layout "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Layout/WikiLayout.tsx"
click node_archives "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/GenericArchive.tsx"
click node_entry "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Common/WikiDetailModal.tsx"
click node_create "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Common/CreateNewModal.tsx"
click node_wiki_types "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/shared/types/wiki.ts"
click node_names "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/utils/nameResolver.ts"
click node_home "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/HomeDashboard.tsx"
click node_plot "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/PlotDashboard.tsx"
click node_episodes "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/EpisodeArchive.tsx"
click node_canvas "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Episode/EpisodeCanvas.tsx"
click node_board "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/RelationBoard.tsx"
click node_analysis "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/CharacterAnalysisEngine.tsx"
click node_growth "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/CharacterGrowthTree.tsx"
click node_analysis_types "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/types/analysis-schema.ts"
click node_schema_page "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/AISchemaPage.tsx"
click node_schema_wizard "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/SchemaWizard.tsx"
click node_ai_handler "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/handlers/aiHandler.ts"
click node_prompt "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/lib/ai/promptBuilder.ts"
click node_gemini_schema "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/lib/ai/geminiSchema.ts"
click node_wiki_service "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/services/wikiService.ts"
click node_character_service "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/services/characterService.ts"
click node_analysis_handler "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/handlers/analysisHandler.ts"
click node_web_entry "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/main.tsx"
click node_web_service "https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/services/webWikiService.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_layout,node_web_entry toneBlue
class node_archives,node_entry,node_create,node_wiki_types,node_names,node_home toneAmber
class node_plot,node_episodes,node_canvas,node_board toneMint
class node_analysis,node_growth,node_analysis_types,node_schema_page,node_schema_wizard toneRose
class node_ai_handler,node_prompt,node_gemini_schema,node_wiki_service,node_character_service,node_analysis_handler,node_web_service,node_writer toneIndigo
```

## Components

### App shell

- [Application router](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/App.tsx): `my-wiki/src/renderer/src/App.tsx`
- [Wiki layout](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Layout/WikiLayout.tsx): `my-wiki/src/renderer/src/components/Layout/WikiLayout.tsx`
- [Renderer bootstrap](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/main.tsx): `my-wiki/src/renderer/src/main.tsx`

### Wiki workspace

- [Wiki archives](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/GenericArchive.tsx): `my-wiki/src/renderer/src/pages/GenericArchive.tsx`
- [Wiki entry detail](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Common/WikiDetailModal.tsx): `my-wiki/src/renderer/src/components/Common/WikiDetailModal.tsx`
- [Create entry](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Common/CreateNewModal.tsx): `my-wiki/src/renderer/src/components/Common/CreateNewModal.tsx`
- [Wiki data types](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/shared/types/wiki.ts): `my-wiki/src/shared/types/wiki.ts`
- [Name resolution](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/utils/nameResolver.ts): `my-wiki/src/renderer/src/utils/nameResolver.ts`
- [Home dashboard](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/HomeDashboard.tsx): `my-wiki/src/renderer/src/pages/HomeDashboard.tsx`

### Story planning

- [Plot dashboard](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/PlotDashboard.tsx): `my-wiki/src/renderer/src/pages/PlotDashboard.tsx`
- [Episode archive](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/EpisodeArchive.tsx): `my-wiki/src/renderer/src/pages/EpisodeArchive.tsx`
- [Episode canvas](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Episode/EpisodeCanvas.tsx): `my-wiki/src/renderer/src/components/Episode/EpisodeCanvas.tsx`
- [Relation board](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/RelationBoard.tsx): `my-wiki/src/renderer/src/pages/RelationBoard.tsx`

### AI tools

- [Character analysis](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/CharacterAnalysisEngine.tsx): `my-wiki/src/renderer/src/components/Analysis/CharacterAnalysisEngine.tsx`
- [Character growth tree](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/CharacterGrowthTree.tsx): `my-wiki/src/renderer/src/components/Analysis/CharacterGrowthTree.tsx`
- [Analysis schema types](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/types/analysis-schema.ts): `my-wiki/src/renderer/src/types/analysis-schema.ts`
- [AI schema settings](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/pages/AISchemaPage.tsx): `my-wiki/src/renderer/src/pages/AISchemaPage.tsx`
- [Schema wizard](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/components/Analysis/SchemaWizard.tsx): `my-wiki/src/renderer/src/components/Analysis/SchemaWizard.tsx`

### Persistence and runtime

- [AI request handlers](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/handlers/aiHandler.ts): `my-wiki/src/main/handlers/aiHandler.ts`
- [Prompt builder](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/lib/ai/promptBuilder.ts): `my-wiki/src/main/lib/ai/promptBuilder.ts`
- [Gemini schemas](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/lib/ai/geminiSchema.ts): `my-wiki/src/main/lib/ai/geminiSchema.ts`
- [Wiki file service](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/services/wikiService.ts): `my-wiki/src/main/services/wikiService.ts`
- [Character file service](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/services/characterService.ts): `my-wiki/src/main/services/characterService.ts`
- [Analysis handlers](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/main/handlers/analysisHandler.ts): `my-wiki/src/main/handlers/analysisHandler.ts`
- [Web API adapter](https://github.com/knee2420/novelbiblewiki/blob/main/my-wiki/src/renderer/src/services/webWikiService.ts): `my-wiki/src/renderer/src/services/webWikiService.ts`

### Other components

- **Writer**

## Connections

- Writer → Application router: uses
- Application router → Wiki layout: renders (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Home dashboard: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Plot dashboard: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Episode archive: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Relation board: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Wiki archives: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Application router → Wiki entry detail: renders (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Episode archive → Episode canvas: renders (evidence: `my-wiki/src/renderer/src/pages/EpisodeArchive.tsx`)
- Wiki entry detail → Character growth tree: renders (evidence: `my-wiki/src/renderer/src/components/Common/WikiDetailModal.tsx`)
- Relation board → Name resolution: resolves names (evidence: `my-wiki/src/renderer/src/pages/RelationBoard.tsx`)
- Character analysis → Analysis schema types: uses
- AI schema settings → Schema wizard: renders (evidence: `my-wiki/src/renderer/src/pages/AISchemaPage.tsx`)
- Application router → Character analysis: opens analysis
- Application router → AI schema settings: routes to (evidence: `my-wiki/src/renderer/src/App.tsx`)
- Renderer bootstrap → Application router: renders (evidence: `my-wiki/src/renderer/src/main.tsx`)
- Renderer bootstrap → Web API adapter: installs adapter (evidence: `my-wiki/src/renderer/src/main.tsx`)
- Application router → Web API adapter: requests wiki data
- AI request handlers → Prompt builder: builds prompts (evidence: `my-wiki/src/main/handlers/aiHandler.ts`)
- Prompt builder → Gemini schemas: uses schema (evidence: `my-wiki/src/main/lib/ai/promptBuilder.ts`)
- AI request handlers → Wiki file service: updates wiki (evidence: `my-wiki/src/main/handlers/aiHandler.ts`)
- AI request handlers → Character file service: updates characters (evidence: `my-wiki/src/main/handlers/aiHandler.ts`)
- Analysis handlers → Writer: calls Gemini
- Character analysis → Analysis handlers: requests analysis
