# maestroai-company/opera architecture

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

- Interactive diagram: https://gitdiagram.com/maestroai-company/opera
- Repository: https://github.com/maestroai-company/opera

## Overview

Opera is a privacy-first assistant app, with Maestro as its in-app assistant. The main user workflow runs from the chat screen through model-backed generation and optional tools, then presents rich replies and stores conversations locally. Separate product branches cover model configuration, attachments and voice, MCP integrations, encrypted cloud sync and backup, sharing, and Android assistant/overlay features. The README documents these capabilities; sampled source confirms app initialization, a generation call, tool registration, and database/settings storage. Several subsystem links below rely on README documentation because their implementation files were not sampled.

Main entry points: [`src/app/index.tsx`](https://github.com/maestroai-company/opera/blob/main/src/app/index.tsx) (Chat screen), [`src/services/CloudSyncService.ts`](https://github.com/maestroai-company/opera/blob/main/src/services/CloudSyncService.ts) (Cloud sync), [`src/components/features/ChatBar.tsx`](https://github.com/maestroai-company/opera/blob/main/src/components/features/ChatBar.tsx) (Message composer), [`src/services/ai/generation/GenerationService.ts`](https://github.com/maestroai-company/opera/blob/main/src/services/ai/generation/GenerationService.ts) (Generation pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["Chat screen<br/>[index.tsx]"]
  node_chatui["Chat interface<br/>[ChatView.tsx]"]
  node_chatbar["Message composer<br/>[ChatBar.tsx]"]
  node_markdown["Rich replies<br/>[MarkdownText.tsx]"]
  node_widgets["Reply widgets"]
  node_attachments["Document attachments<br/>[DocumentService.ts]"]
end

subgraph group_assistant["Assistant runtime"]
  node_ai["AI module<br/>[AIModule.ts]"]
  node_generation["Generation pipeline"]
  node_providers["Model providers"]
  node_tools["Tool manager<br/>[ToolManager.ts]"]
  node_toolset["Assistant tools"]
  node_mcp["MCP services"]
end

subgraph group_data["Data and integrations"]
  node_database[("Conversation database<br/>[DatabaseService.ts]")]
  node_sqlite[("SQLite access<br/>[sqlite.ts]")]
  node_settings[("App settings<br/>[SettingsService.ts]")]
  node_sync["Cloud sync"]
  node_cloud["Cloud providers"]
  node_backup["Backup service<br/>[BackupService.ts]"]
  node_sharing["Encrypted sharing<br/>[ShareService.ts]"]
end

subgraph group_platform["Platform features"]
  node_speech["Speech services"]
  node_overlay["Screen overlay"]
  node_native["Android integration"]
  node_quickactions["Quick actions"]
end

node_user(("User"))
node_cloudservice["Cloud storage"]
node_privatebin["PrivateBin host"]
node_model(("Selected model"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_chatui
node_user -->|"enters prompt"| node_chatbar
node_chatbar -.->|"submits prompt"| node_ai
node_app -->|"requests generation"| node_ai
node_ai -.->|"delegates generation"| node_generation
node_generation -.->|"uses model"| node_providers
node_model -->|"selects"| node_providers
node_generation -.->|"invokes tools"| node_tools
node_tools -->|"registers"| node_toolset
node_tools -->|"loads MCP tools"| node_mcp
node_generation -.->|"returns reply"| node_chatui
node_chatui -.->|"renders reply"| node_markdown
node_markdown -.->|"renders widgets"| node_widgets
node_chatui -.->|"stores conversations"| node_database
node_database -->|"opens database"| node_sqlite
node_app -->|"initializes settings"| node_settings
node_settings -->|"opens database"| node_sqlite
node_app -->|"starts sync"| node_sync
node_sync -->|"reads and merges"| node_database
node_sync -->|"merges settings"| node_settings
node_sync -->|"uses backup data"| node_backup
node_sync -->|"uses provider"| node_cloud
node_cloud -.->|"syncs remotely"| node_cloudservice
node_app -->|"offers sharing"| node_sharing
node_sharing -->|"publishes encrypted link"| node_privatebin
node_chatbar -.->|"accepts documents"| node_attachments
node_chatbar -.->|"accepts dictation"| node_speech
node_native -.->|"enables screen overlay"| node_overlay
node_app -.->|"offers quick actions"| node_quickactions
node_native -.->|"supports voice"| node_speech

click node_app "https://github.com/maestroai-company/opera/blob/main/src/app/index.tsx"
click node_chatui "https://github.com/maestroai-company/opera/blob/main/src/components/features/ChatView.tsx"
click node_chatbar "https://github.com/maestroai-company/opera/blob/main/src/components/features/ChatBar.tsx"
click node_markdown "https://github.com/maestroai-company/opera/blob/main/src/components/ui/MarkdownText.tsx"
click node_widgets "https://github.com/maestroai-company/opera/tree/main/src/components/widgets"
click node_attachments "https://github.com/maestroai-company/opera/blob/main/src/services/documents/DocumentService.ts"
click node_ai "https://github.com/maestroai-company/opera/blob/main/src/services/ai/AIModule.ts"
click node_generation "https://github.com/maestroai-company/opera/blob/main/src/services/ai/generation/GenerationService.ts"
click node_providers "https://github.com/maestroai-company/opera/tree/main/src/services/ai/providers"
click node_tools "https://github.com/maestroai-company/opera/blob/main/src/services/ai/tools/ToolManager.ts"
click node_toolset "https://github.com/maestroai-company/opera/tree/main/src/services/ai/tools"
click node_mcp "https://github.com/maestroai-company/opera/tree/main/src/services/mcp"
click node_database "https://github.com/maestroai-company/opera/blob/main/src/services/db/DatabaseService.ts"
click node_sqlite "https://github.com/maestroai-company/opera/blob/main/src/services/db/sqlite.ts"
click node_settings "https://github.com/maestroai-company/opera/blob/main/src/services/settings/SettingsService.ts"
click node_sync "https://github.com/maestroai-company/opera/blob/main/src/services/CloudSyncService.ts"
click node_cloud "https://github.com/maestroai-company/opera/tree/main/src/services/cloud"
click node_backup "https://github.com/maestroai-company/opera/blob/main/src/services/BackupService.ts"
click node_sharing "https://github.com/maestroai-company/opera/blob/main/src/services/share/ShareService.ts"
click node_speech "https://github.com/maestroai-company/opera/tree/main/src/services/speech"
click node_overlay "https://github.com/maestroai-company/opera/tree/main/src/services/overlay"
click node_native "https://github.com/maestroai-company/opera/tree/main/native/android/src"
click node_quickactions "https://github.com/maestroai-company/opera/blob/main/src/services/quickActions/QuickActionsService.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_chatui,node_chatbar,node_markdown,node_widgets,node_attachments,node_user toneBlue
class node_ai,node_generation,node_providers,node_tools,node_toolset,node_mcp,node_cloudservice toneAmber
class node_database,node_sqlite,node_settings,node_sync,node_cloud,node_backup,node_sharing toneMint
class node_speech,node_overlay,node_native,node_quickactions toneRose
class node_privatebin,node_model toneIndigo
```

## Components

### App experience

- [Chat screen](https://github.com/maestroai-company/opera/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Chat interface](https://github.com/maestroai-company/opera/blob/main/src/components/features/ChatView.tsx): `src/components/features/ChatView.tsx`
- [Message composer](https://github.com/maestroai-company/opera/blob/main/src/components/features/ChatBar.tsx): `src/components/features/ChatBar.tsx`
- [Rich replies](https://github.com/maestroai-company/opera/blob/main/src/components/ui/MarkdownText.tsx): `src/components/ui/MarkdownText.tsx`
- [Reply widgets](https://github.com/maestroai-company/opera/tree/main/src/components/widgets): `src/components/widgets`
- [Document attachments](https://github.com/maestroai-company/opera/blob/main/src/services/documents/DocumentService.ts): `src/services/documents/DocumentService.ts`

### Assistant runtime

- [AI module](https://github.com/maestroai-company/opera/blob/main/src/services/ai/AIModule.ts): `src/services/ai/AIModule.ts`
- [Generation pipeline](https://github.com/maestroai-company/opera/blob/main/src/services/ai/generation/GenerationService.ts): `src/services/ai/generation/GenerationService.ts`
- [Model providers](https://github.com/maestroai-company/opera/tree/main/src/services/ai/providers): `src/services/ai/providers`
- [Tool manager](https://github.com/maestroai-company/opera/blob/main/src/services/ai/tools/ToolManager.ts): `src/services/ai/tools/ToolManager.ts`
- [Assistant tools](https://github.com/maestroai-company/opera/tree/main/src/services/ai/tools): `src/services/ai/tools`
- [MCP services](https://github.com/maestroai-company/opera/tree/main/src/services/mcp): `src/services/mcp`

### Data and integrations

- [Conversation database](https://github.com/maestroai-company/opera/blob/main/src/services/db/DatabaseService.ts): `src/services/db/DatabaseService.ts`
- [SQLite access](https://github.com/maestroai-company/opera/blob/main/src/services/db/sqlite.ts): `src/services/db/sqlite.ts`
- [App settings](https://github.com/maestroai-company/opera/blob/main/src/services/settings/SettingsService.ts): `src/services/settings/SettingsService.ts`
- [Cloud sync](https://github.com/maestroai-company/opera/blob/main/src/services/CloudSyncService.ts): `src/services/CloudSyncService.ts`
- [Cloud providers](https://github.com/maestroai-company/opera/tree/main/src/services/cloud): `src/services/cloud`
- [Backup service](https://github.com/maestroai-company/opera/blob/main/src/services/BackupService.ts): `src/services/BackupService.ts`
- [Encrypted sharing](https://github.com/maestroai-company/opera/blob/main/src/services/share/ShareService.ts): `src/services/share/ShareService.ts`

### Platform features

- [Speech services](https://github.com/maestroai-company/opera/tree/main/src/services/speech): `src/services/speech`
- [Screen overlay](https://github.com/maestroai-company/opera/tree/main/src/services/overlay): `src/services/overlay`
- [Android integration](https://github.com/maestroai-company/opera/tree/main/native/android/src): `native/android/src`
- [Quick actions](https://github.com/maestroai-company/opera/blob/main/src/services/quickActions/QuickActionsService.ts): `src/services/quickActions/QuickActionsService.ts`

### Other components

- **User**
- **Cloud storage**
- **PrivateBin host**
- **Selected model**

## Connections

- User → Chat screen: opens
- Chat screen → Chat interface: renders (evidence: `src/app/index.tsx`)
- User → Message composer: enters prompt
- Message composer → AI module: submits prompt
- Chat screen → AI module: requests generation (evidence: `src/app/index.tsx`)
- AI module → Generation pipeline: delegates generation
- Generation pipeline → Model providers: uses model
- Selected model → Model providers: selects
- Generation pipeline → Tool manager: invokes tools
- Tool manager → Assistant tools: registers (evidence: `src/services/ai/tools/ToolManager.ts`)
- Tool manager → MCP services: loads MCP tools (evidence: `src/services/ai/tools/ToolManager.ts`)
- Generation pipeline → Chat interface: returns reply
- Chat interface → Rich replies: renders reply
- Rich replies → Reply widgets: renders widgets
- Chat interface → Conversation database: stores conversations
- Conversation database → SQLite access: opens database (evidence: `src/services/db/DatabaseService.ts`)
- Chat screen → App settings: initializes settings (evidence: `src/app/index.tsx`)
- App settings → SQLite access: opens database (evidence: `src/services/settings/SettingsService.ts`)
- Chat screen → Cloud sync: starts sync (evidence: `src/app/index.tsx`)
- Cloud sync → Conversation database: reads and merges (evidence: `src/services/CloudSyncService.ts`)
- Cloud sync → App settings: merges settings (evidence: `src/services/CloudSyncService.ts`)
- Cloud sync → Backup service: uses backup data (evidence: `src/services/CloudSyncService.ts`)
- Cloud sync → Cloud providers: uses provider (evidence: `src/services/CloudSyncService.ts`)
- Cloud providers → Cloud storage: syncs remotely
- Chat screen → Encrypted sharing: offers sharing (evidence: `src/app/index.tsx`)
- Encrypted sharing → PrivateBin host: publishes encrypted link
- Message composer → Document attachments: accepts documents
- Message composer → Speech services: accepts dictation
- Android integration → Screen overlay: enables screen overlay
- Chat screen → Quick actions: offers quick actions
- Android integration → Speech services: supports voice
