# memecalculate/moyin-creator architecture

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

- Interactive diagram: https://gitdiagram.com/memecalculate/moyin-creator
- Repository: https://github.com/memecalculate/moyin-creator

## Overview

Moyin Creator is a desktop AI filmmaking workspace. Its documented main workflow takes a script through character and scene preparation, directing and storyboard work, then S-class multi-shot video generation; it also provides batch generation, media management, freeform creation and export. The graph preserves these product branches and shows storage and AI-routing layers. Workflow transitions are documented in the README; source excerpts and index references support the indicated application, storage and AI relationships, but unsampled panel internals are not assumed.

Main entry points: [`src/components/panels/director/index.tsx`](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/director/index.tsx) (Directing and shots), [`src/lib/project-storage.ts`](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/project-storage.ts) (Project storage), [`src/components/panels/characters/index.tsx`](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/characters/index.tsx) (Character creation), [`src/components/panels/sclass/use-sclass-generation.ts`](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/sclass/use-sclass-generation.ts) (S-class generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Production workflow"]
  node_app["Application shell<br/>[App.tsx]"]
  node_script["Script parsing<br/>[script-parser.ts]"]
  node_scriptui["Script workspace<br/>[index.tsx]"]
  node_characters["Character creation<br/>[index.tsx]"]
  node_scenes["Scene generation"]
  node_director["Directing and shots<br/>[index.tsx]"]
  node_sclass["S-class generation"]
end

subgraph group_creation["Creative tools"]
  node_characterbible["Character bible<br/>[character-bible.ts]"]
  node_storyboard["Storyboard tools"]
  node_promptbuilder["S-class prompts"]
  node_media["Media workspace<br/>[index.tsx]"]
  node_freedom["Freeform studio<br/>[index.tsx]"]
  node_export["Export<br/>[index.tsx]"]
end

subgraph group_platform["AI and settings"]
  node_imagegen["Image generation<br/>[image-generator.ts]"]
  node_aiworker["AI worker<br/>[ai-worker.ts]"]
  node_providers["AI providers<br/>[feature-router.ts]"]
  node_apikeys["API key management<br/>[api-key-manager.ts]"]
  node_apiui["Provider settings<br/>[SettingsPanel.tsx]"]
  node_batch["Batch processing<br/>[batch-processor.ts]"]
  node_electron["Desktop host<br/>[main.ts]"]
end

subgraph group_state["Project data"]
  node_projectstore[("Project state<br/>[project-store.ts]")]
  node_scriptstore[("Script state<br/>[script-store.ts]")]
  node_directorstore[("Director state<br/>[director-store.ts]")]
  node_projectstorage["Project storage<br/>[project-storage.ts]"]
  node_filestorage[("File storage adapter")]
end

node_creator(("Creator"))
node_ai{{"External AI services"}}

node_creator -->|"opens"| node_app
node_app -->|"shows workspace"| node_scriptui
node_scriptui -->|"parses script"| node_script
node_script -->|"feeds characters"| node_characters
node_characters -->|"feeds scenes"| node_scenes
node_scenes -->|"feeds directing"| node_director
node_director -->|"feeds shot groups"| node_sclass
node_characters -.->|"uses consistency system"| node_characterbible
node_director -->|"generates storyboard"| node_storyboard
node_sclass -.->|"builds prompts"| node_promptbuilder
node_sclass -.->|"generates video"| node_aiworker
node_director -.->|"generates images"| node_imagegen
node_aiworker -.->|"routes tasks"| node_providers
node_providers -->|"selects keys"| node_apikeys
node_apiui -.->|"configures keys"| node_apikeys
node_batch -.->|"dispatches jobs"| node_ai
node_providers -.->|"calls providers"| node_ai
node_freedom -.->|"creates media"| node_aiworker
node_director -.->|"uses media"| node_media
node_media -.->|"exports assets"| node_export
node_projectstore -->|"persists state"| node_projectstorage
node_scriptstore -->|"persists state"| node_projectstorage
node_directorstore -->|"persists state"| node_projectstorage
node_projectstorage -->|"reads and writes"| node_filestorage
node_electron -.->|"provides file access"| node_filestorage
node_directorstore -->|"supplies storyboard state"| node_storyboard

click node_app "https://github.com/memecalculate/moyin-creator/blob/main/src/App.tsx"
click node_script "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/script/script-parser.ts"
click node_scriptui "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/script/index.tsx"
click node_characters "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/characters/index.tsx"
click node_characterbible "https://github.com/memecalculate/moyin-creator/blob/main/src/packages/ai-core/services/character-bible.ts"
click node_scenes "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/scenes/generation-panel.tsx"
click node_director "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/director/index.tsx"
click node_storyboard "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/storyboard/storyboard-service.ts"
click node_sclass "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/sclass/use-sclass-generation.ts"
click node_promptbuilder "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/sclass/sclass-prompt-builder.ts"
click node_imagegen "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/image-generator.ts"
click node_aiworker "https://github.com/memecalculate/moyin-creator/blob/main/src/workers/ai-worker.ts"
click node_providers "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/feature-router.ts"
click node_apikeys "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/api-key-manager.ts"
click node_apiui "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/SettingsPanel.tsx"
click node_batch "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/batch-processor.ts"
click node_media "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/media/index.tsx"
click node_freedom "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/freedom/index.tsx"
click node_export "https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/export/index.tsx"
click node_projectstore "https://github.com/memecalculate/moyin-creator/blob/main/src/stores/project-store.ts"
click node_scriptstore "https://github.com/memecalculate/moyin-creator/blob/main/src/stores/script-store.ts"
click node_directorstore "https://github.com/memecalculate/moyin-creator/blob/main/src/stores/director-store.ts"
click node_projectstorage "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/project-storage.ts"
click node_filestorage "https://github.com/memecalculate/moyin-creator/blob/main/src/lib/indexed-db-storage.ts"
click node_electron "https://github.com/memecalculate/moyin-creator/blob/main/electron/main.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_script,node_scriptui,node_characters,node_scenes,node_director,node_sclass toneBlue
class node_characterbible,node_storyboard,node_promptbuilder,node_media,node_freedom,node_export toneAmber
class node_imagegen,node_aiworker,node_providers,node_apikeys,node_apiui,node_batch,node_electron toneMint
class node_projectstore,node_scriptstore,node_directorstore,node_projectstorage,node_filestorage toneRose
class node_creator,node_ai toneIndigo
```

## Components

### Production workflow

- [Application shell](https://github.com/memecalculate/moyin-creator/blob/main/src/App.tsx): `src/App.tsx`
- [Script parsing](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/script/script-parser.ts): `src/lib/script/script-parser.ts`
- [Script workspace](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/script/index.tsx): `src/components/panels/script/index.tsx`
- [Character creation](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/characters/index.tsx): `src/components/panels/characters/index.tsx`
- [Scene generation](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/scenes/generation-panel.tsx): `src/components/panels/scenes/generation-panel.tsx`
- [Directing and shots](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/director/index.tsx): `src/components/panels/director/index.tsx`
- [S-class generation](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/sclass/use-sclass-generation.ts): `src/components/panels/sclass/use-sclass-generation.ts`

### Creative tools

- [Character bible](https://github.com/memecalculate/moyin-creator/blob/main/src/packages/ai-core/services/character-bible.ts): `src/packages/ai-core/services/character-bible.ts`
- [Storyboard tools](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/storyboard/storyboard-service.ts): `src/lib/storyboard/storyboard-service.ts`
- [S-class prompts](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/sclass/sclass-prompt-builder.ts): `src/components/panels/sclass/sclass-prompt-builder.ts`
- [Media workspace](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/media/index.tsx): `src/components/panels/media/index.tsx`
- [Freeform studio](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/freedom/index.tsx): `src/components/panels/freedom/index.tsx`
- [Export](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/export/index.tsx): `src/components/panels/export/index.tsx`

### AI and settings

- [Image generation](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/image-generator.ts): `src/lib/ai/image-generator.ts`
- [AI worker](https://github.com/memecalculate/moyin-creator/blob/main/src/workers/ai-worker.ts): `src/workers/ai-worker.ts`
- [AI providers](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/feature-router.ts): `src/lib/ai/feature-router.ts`
- [API key management](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/api-key-manager.ts): `src/lib/api-key-manager.ts`
- [Provider settings](https://github.com/memecalculate/moyin-creator/blob/main/src/components/panels/SettingsPanel.tsx): `src/components/panels/SettingsPanel.tsx`
- [Batch processing](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/ai/batch-processor.ts): `src/lib/ai/batch-processor.ts`
- [Desktop host](https://github.com/memecalculate/moyin-creator/blob/main/electron/main.ts): `electron/main.ts`

### Project data

- [Project state](https://github.com/memecalculate/moyin-creator/blob/main/src/stores/project-store.ts): `src/stores/project-store.ts`
- [Script state](https://github.com/memecalculate/moyin-creator/blob/main/src/stores/script-store.ts): `src/stores/script-store.ts`
- [Director state](https://github.com/memecalculate/moyin-creator/blob/main/src/stores/director-store.ts): `src/stores/director-store.ts`
- [Project storage](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/project-storage.ts): `src/lib/project-storage.ts`
- [File storage adapter](https://github.com/memecalculate/moyin-creator/blob/main/src/lib/indexed-db-storage.ts): `src/lib/indexed-db-storage.ts`

### Other components

- **Creator**
- **External AI services**

## Connections

- Creator → Application shell: opens (evidence: `README.md`)
- Application shell → Script workspace: shows workspace (evidence: `src/App.tsx`)
- Script workspace → Script parsing: parses script (evidence: `README.md`)
- Script parsing → Character creation: feeds characters (evidence: `README.md`)
- Character creation → Scene generation: feeds scenes (evidence: `README.md`)
- Scene generation → Directing and shots: feeds directing (evidence: `README.md`)
- Directing and shots → S-class generation: feeds shot groups (evidence: `README.md`)
- Character creation → Character bible: uses consistency system (evidence: `README.md`)
- Directing and shots → Storyboard tools: generates storyboard (evidence: `src/lib/storyboard/storyboard-service.ts`)
- S-class generation → S-class prompts: builds prompts
- S-class generation → AI worker: generates video
- Directing and shots → Image generation: generates images
- AI worker → AI providers: routes tasks
- AI providers → API key management: selects keys (evidence: `src/lib/ai/feature-router.ts`)
- Provider settings → API key management: configures keys
- Batch processing → External AI services: dispatches jobs
- AI providers → External AI services: calls providers
- Freeform studio → AI worker: creates media
- Directing and shots → Media workspace: uses media
- Media workspace → Export: exports assets
- Project state → Project storage: persists state (evidence: `src/lib/project-storage.ts`)
- Script state → Project storage: persists state (evidence: `src/stores/script-store.ts`)
- Director state → Project storage: persists state (evidence: `src/stores/director-store.ts`)
- Project storage → File storage adapter: reads and writes (evidence: `src/lib/project-storage.ts`)
- Desktop host → File storage adapter: provides file access
- Director state → Storyboard tools: supplies storyboard state (evidence: `src/lib/storyboard/storyboard-service.ts`)
