# composeflow/composeflow architecture

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

- Interactive diagram: https://gitdiagram.com/composeflow/composeflow
- Repository: https://github.com/composeflow/composeflow

## Overview

ComposeFlow is an AI-assisted visual editor that turns user prompts and drag-and-drop edits into runnable Compose Multiplatform apps. The documented workflow runs from opening the editor, through project creation and UI/state/theme editing, to preview and project export. AI assistance is mediated by a repository layer and an LLM client; the README also documents Firebase integrations. Several editor, preview, and export implementation details are represented by their exact enclosing feature directories because their source was not sampled, so links for those documented capabilities cite the README rather than implying inspected call paths.

Main entry points: [`core/model/src/commonMain/kotlin/io/composeflow/model/project/Project.kt`](https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/model/project/Project.kt) (Project and screens), [`feature/uibuilder`](https://github.com/composeflow/composeflow/tree/main/feature/uibuilder) (UI builder), [`desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt`](https://github.com/composeflow/composeflow/blob/main/desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt) (Desktop entry), [`feature/top`](https://github.com/composeflow/composeflow/tree/main/feature/top) (ComposeFlow app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Editor app"]
  node_entry["Desktop entry<br/>[main.kt]"]
  node_app_shell["ComposeFlow app"]
end

subgraph group_authoring["Visual authoring"]
  node_ui_builder["UI builder"]
  node_project_model["Project and screens<br/>[Project.kt]"]
  node_state_editor["State editing"]
  node_theme_editor["Theme editing"]
  node_datatype_editor["Data types"]
  node_api_editor["API editor"]
  node_preview["Live preview"]
end

subgraph group_generation["AI and generation"]
  node_codegen["Code generator<br/>[CodeGenerator.kt]"]
  node_ai_repo["AI repository<br/>[LlmRepository.kt]"]
  node_llm_client["LLM client<br/>[LlmClient.kt]"]
end

subgraph group_services["Platform services"]
  node_auth["Authentication<br/>[AuthRepository.kt]"]
  node_firebase_storage["Firebase storage"]
  node_gcs_wrapper["Cloud storage wrapper"]
end

node_user(("Editor user"))
node_llm_service{{"LLM service"}}
node_firebase{{"Firebase services"}}

node_user -->|"opens editor"| node_entry
node_entry -->|"launches"| node_app_shell
node_user -->|"edits visually"| node_ui_builder
node_ui_builder -.->|"edits project"| node_project_model
node_user -->|"manages state"| node_state_editor
node_user -->|"styles app"| node_theme_editor
node_user -.->|"edits data"| node_datatype_editor
node_user -.->|"configures APIs"| node_api_editor
node_app_shell -.->|"offers authoring"| node_ui_builder
node_project_model -->|"previews changes"| node_preview
node_project_model -.->|"generates app code"| node_codegen
node_user -->|"requests AI help"| node_ai_repo
node_ai_repo -->|"invokes"| node_llm_client
node_llm_client -->|"sends requests"| node_llm_service
node_user -->|"signs in"| node_auth
node_auth -->|"provides auth tokens"| node_firebase_storage
node_firebase_storage -->|"reads and writes"| node_firebase
node_gcs_wrapper -.->|"stores assets"| node_firebase
node_user -->|"exports project"| node_codegen

click node_entry "https://github.com/composeflow/composeflow/blob/main/desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt"
click node_app_shell "https://github.com/composeflow/composeflow/tree/main/feature/top"
click node_ui_builder "https://github.com/composeflow/composeflow/tree/main/feature/uibuilder"
click node_project_model "https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/model/project/Project.kt"
click node_state_editor "https://github.com/composeflow/composeflow/blob/main/feature/appstate-editor/src/commonMain/kotlin/io/composeflow/ui/appstate/AppStateEditorScreen.kt"
click node_theme_editor "https://github.com/composeflow/composeflow/blob/main/feature/theme-editor/src/commonMain/kotlin/io/composeflow/ui/themeeditor/ColorEditorContent.kt"
click node_datatype_editor "https://github.com/composeflow/composeflow/blob/main/feature/datatype-editor/src/commonMain/kotlin/io/composeflow/ui/datatype/DataTypeEditorScreen.kt"
click node_api_editor "https://github.com/composeflow/composeflow/tree/main/feature/api-editor"
click node_preview "https://github.com/composeflow/composeflow/tree/main/feature/app-builder"
click node_codegen "https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/model/CodeGenerator.kt"
click node_ai_repo "https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/ai/LlmRepository.kt"
click node_llm_client "https://github.com/composeflow/composeflow/blob/main/core/ai/src/commonMain/kotlin/io/composeflow/ai/LlmClient.kt"
click node_auth "https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/auth/AuthRepository.kt"
click node_firebase_storage "https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/FirebaseStorageClient.kt"
click node_gcs_wrapper "https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/GoogleCloudStorageWrapper.kt"

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_entry,node_app_shell,node_user toneBlue
class node_ui_builder,node_project_model,node_state_editor,node_theme_editor,node_datatype_editor,node_api_editor,node_preview toneAmber
class node_codegen,node_ai_repo,node_llm_client toneMint
class node_auth,node_firebase_storage,node_gcs_wrapper toneRose
class node_llm_service,node_firebase toneIndigo
```

## Components

### Editor app

- [Desktop entry](https://github.com/composeflow/composeflow/blob/main/desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt): `desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt`
- [ComposeFlow app](https://github.com/composeflow/composeflow/tree/main/feature/top): `feature/top`

### Visual authoring

- [UI builder](https://github.com/composeflow/composeflow/tree/main/feature/uibuilder): `feature/uibuilder`
- [Project and screens](https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/model/project/Project.kt): `core/model/src/commonMain/kotlin/io/composeflow/model/project/Project.kt`
- [State editing](https://github.com/composeflow/composeflow/blob/main/feature/appstate-editor/src/commonMain/kotlin/io/composeflow/ui/appstate/AppStateEditorScreen.kt): `feature/appstate-editor/src/commonMain/kotlin/io/composeflow/ui/appstate/AppStateEditorScreen.kt`
- [Theme editing](https://github.com/composeflow/composeflow/blob/main/feature/theme-editor/src/commonMain/kotlin/io/composeflow/ui/themeeditor/ColorEditorContent.kt): `feature/theme-editor/src/commonMain/kotlin/io/composeflow/ui/themeeditor/ColorEditorContent.kt`
- [Data types](https://github.com/composeflow/composeflow/blob/main/feature/datatype-editor/src/commonMain/kotlin/io/composeflow/ui/datatype/DataTypeEditorScreen.kt): `feature/datatype-editor/src/commonMain/kotlin/io/composeflow/ui/datatype/DataTypeEditorScreen.kt`
- [API editor](https://github.com/composeflow/composeflow/tree/main/feature/api-editor): `feature/api-editor`
- [Live preview](https://github.com/composeflow/composeflow/tree/main/feature/app-builder): `feature/app-builder`

### AI and generation

- [Code generator](https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/model/CodeGenerator.kt): `core/model/src/commonMain/kotlin/io/composeflow/model/CodeGenerator.kt`
- [AI repository](https://github.com/composeflow/composeflow/blob/main/core/model/src/commonMain/kotlin/io/composeflow/ai/LlmRepository.kt): `core/model/src/commonMain/kotlin/io/composeflow/ai/LlmRepository.kt`
- [LLM client](https://github.com/composeflow/composeflow/blob/main/core/ai/src/commonMain/kotlin/io/composeflow/ai/LlmClient.kt): `core/ai/src/commonMain/kotlin/io/composeflow/ai/LlmClient.kt`

### Platform services

- [Authentication](https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/auth/AuthRepository.kt): `core/platform/src/commonMain/kotlin/io/composeflow/auth/AuthRepository.kt`
- [Firebase storage](https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/FirebaseStorageClient.kt): `core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/FirebaseStorageClient.kt`
- [Cloud storage wrapper](https://github.com/composeflow/composeflow/blob/main/core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/GoogleCloudStorageWrapper.kt): `core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/GoogleCloudStorageWrapper.kt`

### Other components

- **Editor user**
- **LLM service**
- **Firebase services**

## Connections

- Editor user → Desktop entry: opens editor
- Desktop entry → ComposeFlow app: launches (evidence: `desktopApp/src/jvmMain/kotlin/io/composeflow/main.kt`)
- Editor user → UI builder: edits visually
- UI builder → Project and screens: edits project
- Editor user → State editing: manages state
- Editor user → Theme editing: styles app
- Editor user → Data types: edits data
- Editor user → API editor: configures APIs
- ComposeFlow app → UI builder: offers authoring
- Project and screens → Live preview: previews changes
- Project and screens → Code generator: generates app code
- Editor user → AI repository: requests AI help
- AI repository → LLM client: invokes (evidence: `core/model/src/commonMain/kotlin/io/composeflow/ai/LlmRepository.kt`)
- LLM client → LLM service: sends requests (evidence: `core/ai/src/commonMain/kotlin/io/composeflow/ai/LlmClient.kt`)
- Editor user → Authentication: signs in
- Authentication → Firebase storage: provides auth tokens (evidence: `core/platform/src/commonMain/kotlin/io/composeflow/cloud/storage/FirebaseStorageClient.kt`)
- Firebase storage → Firebase services: reads and writes
- Cloud storage wrapper → Firebase services: stores assets
- Editor user → Code generator: exports project
