# mayday-wpf/snow-app architecture

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

- Interactive diagram: https://gitdiagram.com/mayday-wpf/snow-app
- Repository: https://github.com/mayday-wpf/snow-app

## Overview

Snow App is an Electron desktop workspace for AI-assisted software development. The main user flow begins in the React chat interface, crosses the preload and Electron IPC boundary, and reaches Rust conversation/AI services, which stream responses from configured model providers and persist conversation state. The product also exposes developer tools and remote access. The README documents these capabilities; sampled source confirms selected UI, bridge, browser-state, and storage behavior, but not every subsystem’s internal call wiring.

Main entry points: [`native/src/api/conversation/mod.rs`](https://github.com/mayday-wpf/snow-app/blob/main/native/src/api/conversation/mod.rs) (Conversation runtime), [`src/renderer/components/mainContent/ChatContent.tsx`](https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/ChatContent.tsx) (Chat interface), [`src/renderer/components/mainContent/chatInput/useChatInputController.ts`](https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/chatInput/useChatInputController.ts) (Chat composer), [`src/preload/index.ts`](https://github.com/mayday-wpf/snow-app/blob/main/src/preload/index.ts) (Preload API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_chat_ui["Chat interface<br/>[ChatContent.tsx]"]
  node_chat_input["Chat composer"]
end

subgraph group_desktop["Desktop services"]
  node_preload["Preload API<br/>[index.ts]"]
  node_ipc["IPC handlers"]
  node_native_bridge["Native bridge<br/>[nativeBridge.ts]"]
  node_terminal["Terminal sessions<br/>[ptyManager.ts]"]
  node_ssh["SSH management<br/>[sshManager.ts]"]
  node_git["Git tooling<br/>[mod.rs]"]
  node_browser["Browser panel<br/>[browserWindow.ts]"]
  node_settings["Configuration<br/>[apiConfigs.ts]"]
end

subgraph group_agent["AI and tools"]
  node_conversation["Conversation runtime<br/>[mod.rs]"]
  node_provider_api["Provider adapters<br/>[mod.rs]"]
  node_mcp["MCP tools<br/>[service.rs]"]
  node_prompt["Prompt modes<br/>[mod.rs]"]
  node_hooks["Lifecycle hooks<br/>[mod.rs]"]
  node_codebase["Codebase search<br/>[mod.rs]"]
  node_imagegen["Image generation<br/>[mod.rs]"]
end

subgraph group_state["Persistence"]
  node_database[("SQLite storage<br/>[database.rs]")]
end

subgraph group_remote["Remote access"]
  node_remote_control["Remote control<br/>[mod.rs]"]
  node_mobile_ui["Mobile controls<br/>[main.ts]"]
end

node_user(("Developer"))
node_model_provider{{"AI provider"}}

node_user -->|"uses"| node_chat_ui
node_chat_ui -->|"composes"| node_chat_input
node_chat_input -->|"submits through"| node_preload
node_preload -->|"invokes"| node_ipc
node_ipc -->|"calls"| node_native_bridge
node_native_bridge -->|"dispatches"| node_conversation
node_conversation -->|"requests completion"| node_provider_api
node_provider_api -->|"streams requests"| node_model_provider
node_conversation -->|"persists conversations"| node_database
node_conversation -->|"uses prompts"| node_prompt
node_conversation -->|"dispatches tools"| node_mcp
node_conversation -->|"runs lifecycle hooks"| node_hooks
node_user -->|"runs commands"| node_terminal
node_user -->|"connects remotely"| node_ssh
node_user -->|"manages repositories"| node_git
node_user -->|"browses"| node_browser
node_user -->|"searches code"| node_codebase
node_user -->|"generates images"| node_imagegen
node_user -->|"controls session"| node_mobile_ui
node_mobile_ui -->|"sends actions"| node_remote_control
node_remote_control -->|"relays conversation actions"| node_conversation
node_settings -->|"configures providers"| node_database

click node_chat_ui "https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/ChatContent.tsx"
click node_chat_input "https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/chatInput/useChatInputController.ts"
click node_preload "https://github.com/mayday-wpf/snow-app/blob/main/src/preload/index.ts"
click node_ipc "https://github.com/mayday-wpf/snow-app/blob/main/src/main/ipc/registerIpcHandlers.ts"
click node_native_bridge "https://github.com/mayday-wpf/snow-app/blob/main/src/main/native/nativeBridge.ts"
click node_conversation "https://github.com/mayday-wpf/snow-app/blob/main/native/src/api/conversation/mod.rs"
click node_provider_api "https://github.com/mayday-wpf/snow-app/blob/main/native/src/api/mod.rs"
click node_mcp "https://github.com/mayday-wpf/snow-app/blob/main/native/src/mcp/service.rs"
click node_prompt "https://github.com/mayday-wpf/snow-app/blob/main/native/src/prompt/mod.rs"
click node_hooks "https://github.com/mayday-wpf/snow-app/blob/main/native/src/hooks/mod.rs"
click node_database "https://github.com/mayday-wpf/snow-app/blob/main/native/src/storage/database.rs"
click node_terminal "https://github.com/mayday-wpf/snow-app/blob/main/src/main/pty/ptyManager.ts"
click node_ssh "https://github.com/mayday-wpf/snow-app/blob/main/src/main/ssh/sshManager.ts"
click node_git "https://github.com/mayday-wpf/snow-app/blob/main/native/src/storage/services/git/mod.rs"
click node_browser "https://github.com/mayday-wpf/snow-app/blob/main/src/main/browser/browserWindow.ts"
click node_codebase "https://github.com/mayday-wpf/snow-app/blob/main/native/src/exports/codebase/mod.rs"
click node_imagegen "https://github.com/mayday-wpf/snow-app/blob/main/native/src/mcp/servers/imagegen/mod.rs"
click node_remote_control "https://github.com/mayday-wpf/snow-app/blob/main/native/src/remote_control/mod.rs"
click node_mobile_ui "https://github.com/mayday-wpf/snow-app/blob/main/src/mobile/main.ts"
click node_settings "https://github.com/mayday-wpf/snow-app/blob/main/src/main/settings/apiConfigs.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_chat_ui,node_chat_input toneBlue
class node_preload,node_ipc,node_native_bridge,node_terminal,node_ssh,node_git,node_browser,node_settings toneAmber
class node_conversation,node_provider_api,node_mcp,node_prompt,node_hooks,node_codebase,node_imagegen toneMint
class node_database toneRose
class node_remote_control,node_mobile_ui,node_user,node_model_provider toneIndigo
```

## Components

### User interface

- [Chat interface](https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/ChatContent.tsx): `src/renderer/components/mainContent/ChatContent.tsx`
- [Chat composer](https://github.com/mayday-wpf/snow-app/blob/main/src/renderer/components/mainContent/chatInput/useChatInputController.ts): `src/renderer/components/mainContent/chatInput/useChatInputController.ts`

### Desktop services

- [Preload API](https://github.com/mayday-wpf/snow-app/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [IPC handlers](https://github.com/mayday-wpf/snow-app/blob/main/src/main/ipc/registerIpcHandlers.ts): `src/main/ipc/registerIpcHandlers.ts`
- [Native bridge](https://github.com/mayday-wpf/snow-app/blob/main/src/main/native/nativeBridge.ts): `src/main/native/nativeBridge.ts`
- [Terminal sessions](https://github.com/mayday-wpf/snow-app/blob/main/src/main/pty/ptyManager.ts): `src/main/pty/ptyManager.ts`
- [SSH management](https://github.com/mayday-wpf/snow-app/blob/main/src/main/ssh/sshManager.ts): `src/main/ssh/sshManager.ts`
- [Git tooling](https://github.com/mayday-wpf/snow-app/blob/main/native/src/storage/services/git/mod.rs): `native/src/storage/services/git/mod.rs`
- [Browser panel](https://github.com/mayday-wpf/snow-app/blob/main/src/main/browser/browserWindow.ts): `src/main/browser/browserWindow.ts`
- [Configuration](https://github.com/mayday-wpf/snow-app/blob/main/src/main/settings/apiConfigs.ts): `src/main/settings/apiConfigs.ts`

### AI and tools

- [Conversation runtime](https://github.com/mayday-wpf/snow-app/blob/main/native/src/api/conversation/mod.rs): `native/src/api/conversation/mod.rs`
- [Provider adapters](https://github.com/mayday-wpf/snow-app/blob/main/native/src/api/mod.rs): `native/src/api/mod.rs`
- [MCP tools](https://github.com/mayday-wpf/snow-app/blob/main/native/src/mcp/service.rs): `native/src/mcp/service.rs`
- [Prompt modes](https://github.com/mayday-wpf/snow-app/blob/main/native/src/prompt/mod.rs): `native/src/prompt/mod.rs`
- [Lifecycle hooks](https://github.com/mayday-wpf/snow-app/blob/main/native/src/hooks/mod.rs): `native/src/hooks/mod.rs`
- [Codebase search](https://github.com/mayday-wpf/snow-app/blob/main/native/src/exports/codebase/mod.rs): `native/src/exports/codebase/mod.rs`
- [Image generation](https://github.com/mayday-wpf/snow-app/blob/main/native/src/mcp/servers/imagegen/mod.rs): `native/src/mcp/servers/imagegen/mod.rs`

### Persistence

- [SQLite storage](https://github.com/mayday-wpf/snow-app/blob/main/native/src/storage/database.rs): `native/src/storage/database.rs`

### Remote access

- [Remote control](https://github.com/mayday-wpf/snow-app/blob/main/native/src/remote_control/mod.rs): `native/src/remote_control/mod.rs`
- [Mobile controls](https://github.com/mayday-wpf/snow-app/blob/main/src/mobile/main.ts): `src/mobile/main.ts`

### Other components

- **Developer**
- **AI provider**

## Connections

- Developer → Chat interface: uses
- Chat interface → Chat composer: composes
- Chat composer → Preload API: submits through
- Preload API → IPC handlers: invokes
- IPC handlers → Native bridge: calls
- Native bridge → Conversation runtime: dispatches
- Conversation runtime → Provider adapters: requests completion
- Provider adapters → AI provider: streams requests
- Conversation runtime → SQLite storage: persists conversations
- Conversation runtime → Prompt modes: uses prompts
- Conversation runtime → MCP tools: dispatches tools
- Conversation runtime → Lifecycle hooks: runs lifecycle hooks
- Developer → Terminal sessions: runs commands
- Developer → SSH management: connects remotely
- Developer → Git tooling: manages repositories
- Developer → Browser panel: browses
- Developer → Codebase search: searches code
- Developer → Image generation: generates images
- Developer → Mobile controls: controls session
- Mobile controls → Remote control: sends actions
- Remote control → Conversation runtime: relays conversation actions
- Configuration → SQLite storage: configures providers
