# alndaly/mosael architecture

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

- Interactive diagram: https://gitdiagram.com/alndaly/mosael
- Repository: https://github.com/alndaly/mosael

## Overview

Mosael is a desktop AI video studio. Its main creative loop gathers project references, plans on boards or in 3D, generates media, edits picture and sound, then publishes through a desktop browser executor. The map also preserves agents, reusable workflows, plugins, and the Chrome companion as distinct capabilities. README descriptions support the product-level links; sampled source confirms workflow scheduling, backend startup, and reference preview behavior, but does not establish every route-to-domain call, so uncertain internal wiring is omitted.

Main entry points: [`backend/app/api/routes`](https://github.com/alndaly/mosael/tree/main/backend/app/api/routes) (Feature routes), [`backend/app/domain/agent`](https://github.com/alndaly/mosael/tree/main/backend/app/domain/agent) (Workspace agents), [`backend/app/domain/workflows/engine.py`](https://github.com/alndaly/mosael/blob/main/backend/app/domain/workflows/engine.py) (Workflow engine), [`backend/app/main.py`](https://github.com/alndaly/mosael/blob/main/backend/app/main.py) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workspace"]
  node_shell["Desktop shell<br/>[main.cjs]"]
  node_ui["Studio interface<br/>[client.ts]"]
  node_companion["Chrome companion<br/>[sidepanel.tsx]"]
end

subgraph group_creative["Creative planning"]
  node_documents["Notes and documents"]
  node_boards["Creative boards"]
  node_scenes["3D scenes"]
end

subgraph group_production["Media production"]
  node_media["Media library"]
  node_sequences["Timeline editing"]
  node_generation["Media generation<br/>[runner.py]"]
  node_ai["AI providers<br/>[registry.py]"]
  node_voices["Voice and transcription"]
end

subgraph group_automation["AI and automation"]
  node_agent["Workspace agents"]
  node_workflow["Workflow engine<br/>[engine.py]"]
  node_plugins["Plugin capabilities"]
  node_scheduler["Scheduled runs"]
  node_publishing["Publishing executor<br/>[publishWorker.ts]"]
end

subgraph group_platform["Runtime platform"]
  node_api["HTTP API<br/>[main.py]"]
  node_routes["Feature routes"]
  node_database[("Project database<br/>[db.py]")]
end

node_user(("Creator"))
node_externalmodels{{"Model services"}}
node_platforms{{"Video platforms"}}

node_user -->|"creates and edits"| node_ui
node_shell -->|"starts backend"| node_api
node_ui -->|"requests features"| node_api
node_companion -->|"imports media"| node_api
node_api -->|"dispatches requests"| node_routes
node_routes -->|"reads and writes"| node_database
node_routes -->|"handles documents"| node_documents
node_routes -->|"handles boards"| node_boards
node_routes -->|"handles scenes"| node_scenes
node_routes -->|"handles assets"| node_media
node_routes -->|"handles editing"| node_sequences
node_routes -->|"starts generation"| node_generation
node_routes -->|"handles audio"| node_voices
node_routes -->|"dispatches agent work"| node_agent
node_routes -->|"runs workflows"| node_workflow
node_generation -->|"selects provider"| node_ai
node_ai -.->|"sends model requests"| node_externalmodels
node_agent -->|"uses workspace tools"| node_boards
node_agent -->|"uses workspace tools"| node_documents
node_agent -->|"uses workspace tools"| node_scenes
node_agent -->|"invokes tools"| node_plugins
node_workflow -->|"runs plugin nodes"| node_plugins
node_scheduler -->|"starts scheduled runs"| node_workflow
node_workflow -->|"executes generation nodes"| node_generation
node_workflow -->|"uses media inputs"| node_media
node_sequences -->|"uses media assets"| node_media
node_publishing -->|"submits posts"| node_platforms
node_ui -->|"reviews and submits"| node_publishing

click node_shell "https://github.com/alndaly/mosael/blob/main/electron/main.cjs"
click node_ui "https://github.com/alndaly/mosael/blob/main/frontend/src/api/client.ts"
click node_companion "https://github.com/alndaly/mosael/blob/main/browser-extension/src/sidepanel.tsx"
click node_api "https://github.com/alndaly/mosael/blob/main/backend/app/main.py"
click node_routes "https://github.com/alndaly/mosael/tree/main/backend/app/api/routes"
click node_database "https://github.com/alndaly/mosael/blob/main/backend/app/core/db.py"
click node_documents "https://github.com/alndaly/mosael/tree/main/backend/app/domain/documents"
click node_boards "https://github.com/alndaly/mosael/tree/main/backend/app/domain/boards"
click node_scenes "https://github.com/alndaly/mosael/tree/main/backend/app/domain/scenes"
click node_media "https://github.com/alndaly/mosael/tree/main/backend/app/media"
click node_sequences "https://github.com/alndaly/mosael/tree/main/backend/app/domain/sequences"
click node_generation "https://github.com/alndaly/mosael/blob/main/backend/app/domain/generation/runner.py"
click node_ai "https://github.com/alndaly/mosael/blob/main/backend/app/ai/providers/registry.py"
click node_voices "https://github.com/alndaly/mosael/tree/main/backend/app/domain/voices"
click node_agent "https://github.com/alndaly/mosael/tree/main/backend/app/domain/agent"
click node_workflow "https://github.com/alndaly/mosael/blob/main/backend/app/domain/workflows/engine.py"
click node_plugins "https://github.com/alndaly/mosael/tree/main/backend/app/domain/plugins"
click node_scheduler "https://github.com/alndaly/mosael/tree/main/backend/app/domain/scheduler"
click node_publishing "https://github.com/alndaly/mosael/blob/main/electron/publish/publishWorker.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_shell,node_ui,node_companion toneBlue
class node_documents,node_boards,node_scenes toneAmber
class node_media,node_sequences,node_generation,node_ai,node_voices toneMint
class node_agent,node_workflow,node_plugins,node_scheduler,node_publishing toneRose
class node_api,node_routes,node_database,node_user,node_externalmodels,node_platforms toneIndigo
```

## Components

### Desktop workspace

- [Desktop shell](https://github.com/alndaly/mosael/blob/main/electron/main.cjs): `electron/main.cjs`
- [Studio interface](https://github.com/alndaly/mosael/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Chrome companion](https://github.com/alndaly/mosael/blob/main/browser-extension/src/sidepanel.tsx): `browser-extension/src/sidepanel.tsx`

### Creative planning

- [Notes and documents](https://github.com/alndaly/mosael/tree/main/backend/app/domain/documents): `backend/app/domain/documents`
- [Creative boards](https://github.com/alndaly/mosael/tree/main/backend/app/domain/boards): `backend/app/domain/boards`
- [3D scenes](https://github.com/alndaly/mosael/tree/main/backend/app/domain/scenes): `backend/app/domain/scenes`

### Media production

- [Media library](https://github.com/alndaly/mosael/tree/main/backend/app/media): `backend/app/media`
- [Timeline editing](https://github.com/alndaly/mosael/tree/main/backend/app/domain/sequences): `backend/app/domain/sequences`
- [Media generation](https://github.com/alndaly/mosael/blob/main/backend/app/domain/generation/runner.py): `backend/app/domain/generation/runner.py`
- [AI providers](https://github.com/alndaly/mosael/blob/main/backend/app/ai/providers/registry.py): `backend/app/ai/providers/registry.py`
- [Voice and transcription](https://github.com/alndaly/mosael/tree/main/backend/app/domain/voices): `backend/app/domain/voices`

### AI and automation

- [Workspace agents](https://github.com/alndaly/mosael/tree/main/backend/app/domain/agent): `backend/app/domain/agent`
- [Workflow engine](https://github.com/alndaly/mosael/blob/main/backend/app/domain/workflows/engine.py): `backend/app/domain/workflows/engine.py`
- [Plugin capabilities](https://github.com/alndaly/mosael/tree/main/backend/app/domain/plugins): `backend/app/domain/plugins`
- [Scheduled runs](https://github.com/alndaly/mosael/tree/main/backend/app/domain/scheduler): `backend/app/domain/scheduler`
- [Publishing executor](https://github.com/alndaly/mosael/blob/main/electron/publish/publishWorker.ts): `electron/publish/publishWorker.ts`

### Runtime platform

- [HTTP API](https://github.com/alndaly/mosael/blob/main/backend/app/main.py): `backend/app/main.py`
- [Feature routes](https://github.com/alndaly/mosael/tree/main/backend/app/api/routes): `backend/app/api/routes`
- [Project database](https://github.com/alndaly/mosael/blob/main/backend/app/core/db.py): `backend/app/core/db.py`

### Other components

- **Creator**
- **Model services**
- **Video platforms**

## Connections

- Creator → Studio interface: creates and edits
- Desktop shell → HTTP API: starts backend
- Studio interface → HTTP API: requests features
- Chrome companion → HTTP API: imports media
- HTTP API → Feature routes: dispatches requests
- Feature routes → Project database: reads and writes
- Feature routes → Notes and documents: handles documents
- Feature routes → Creative boards: handles boards
- Feature routes → 3D scenes: handles scenes
- Feature routes → Media library: handles assets
- Feature routes → Timeline editing: handles editing
- Feature routes → Media generation: starts generation
- Feature routes → Voice and transcription: handles audio
- Feature routes → Workspace agents: dispatches agent work
- Feature routes → Workflow engine: runs workflows
- Media generation → AI providers: selects provider
- AI providers → Model services: sends model requests
- Workspace agents → Creative boards: uses workspace tools
- Workspace agents → Notes and documents: uses workspace tools
- Workspace agents → 3D scenes: uses workspace tools
- Workspace agents → Plugin capabilities: invokes tools
- Workflow engine → Plugin capabilities: runs plugin nodes
- Scheduled runs → Workflow engine: starts scheduled runs
- Workflow engine → Media generation: executes generation nodes
- Workflow engine → Media library: uses media inputs
- Timeline editing → Media library: uses media assets
- Publishing executor → Video platforms: submits posts
- Studio interface → Publishing executor: reviews and submits
