# hassancs91/desktop-app-starter architecture

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

- Interactive diagram: https://gitdiagram.com/hassancs91/desktop-app-starter
- Repository: https://github.com/hassancs91/desktop-app-starter

## Overview

This is an Electron desktop-app starter: users navigate its screens, configure settings or an API key, then use AI and file capabilities through a typed, validated main/preload/renderer boundary. The graph also preserves the window/theme/UI kit and logging capabilities. Some handlers and the secret-store implementation were not sampled; their subsystem paths are directories, and uncertain implementation links are omitted.

Main entry points: [`src/renderer/screens-registry.ts`](https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/screens-registry.ts) (Screen registry), [`src/main/ipc/register.ts`](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/register.ts) (IPC registration), [`src/main/index.ts`](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/index.ts) (Main process), [`src/main/ai/anthropic-client.ts`](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ai/anthropic-client.ts) (Claude client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Window and screens"]
  node_app["App shell<br/>[App.tsx]"]
  node_screens["Screen registry"]
  node_home["Home screen<br/>[HomeScreen.tsx]"]
  node_explorer["File explorer<br/>[ExplorerScreen.tsx]"]
  node_settingsui["Settings screen<br/>[SettingsScreen.tsx]"]
  node_settingsform["Settings form<br/>[SettingsForm.tsx]"]
  node_aiui["AI screen<br/>[AiScreen.tsx]"]
  node_apikeys["API key panel<br/>[ApiKeysPanel.tsx]"]
  node_gallery["Components gallery"]
  node_ui_components["Shared components"]
end

subgraph group_bridge["IPC and capabilities"]
  node_main["Main process<br/>[index.ts]"]
  node_preload["Preload bridge<br/>[preload.ts]"]
  node_ipc["IPC registration<br/>[register.ts]"]
  node_ai_handlers["AI handlers<br/>[ai-handlers.ts]"]
  node_fs_handlers["File handlers<br/>[fs-handlers.ts]"]
  node_fs_service["File service<br/>[fs-service.ts]"]
end

subgraph group_state["Settings and themes"]
  node_settings_handlers["Settings handlers"]
  node_settings_store[("Settings store<br/>[settings-store.ts]")]
  node_theme["Theme service<br/>[theme-service.ts]"]
  node_theme_context["Theme context<br/>[ThemeContext.tsx]"]
end

subgraph group_ai["AI and integrations"]
  node_claude["Claude client"]
  node_anthropic["Anthropic API"]
  node_secret_store[("Encrypted key storage")]
end

subgraph group_ops["Logging and reliability"]
  node_logging["Logging engine<br/>[log-engine.ts]"]
  node_log_writer["Log writer<br/>[log-writer.ts]"]
  node_crash["Crash recovery<br/>[crash-handler.ts]"]
end

node_user(("Desktop user"))

node_user -->|"uses"| node_app
node_app -->|"selects screens"| node_screens
node_screens -->|"registers"| node_home
node_screens -->|"registers"| node_explorer
node_screens -->|"registers"| node_settingsui
node_screens -->|"registers"| node_aiui
node_screens -->|"registers"| node_gallery
node_settingsui -->|"renders"| node_settingsform
node_user -->|"browses components"| node_gallery
node_main -->|"registers"| node_ipc
node_main -->|"loads bridge"| node_preload
node_preload -->|"exposes typed channels"| node_ipc
node_ipc -->|"registers"| node_ai_handlers
node_ipc -->|"registers"| node_fs_handlers
node_ipc -->|"registers"| node_settings_handlers
node_fs_handlers -.->|"delegates to"| node_fs_service
node_settings_handlers -.->|"reads and writes"| node_settings_store
node_settings_store -->|"provides settings"| node_theme
node_app -->|"provides theme"| node_theme_context
node_aiui -->|"includes key panel"| node_apikeys
node_ai_handlers -->|"calls"| node_claude
node_claude -->|"reads API key"| node_secret_store
node_claude -->|"reads model setting"| node_settings_store
node_claude -->|"sends requests"| node_anthropic
node_main -->|"initializes"| node_logging
node_logging -->|"writes logs"| node_log_writer
node_main -->|"attaches handler"| node_crash

click node_app "https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/App.tsx"
click node_screens "https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/screens-registry.ts"
click node_home "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/home/components/HomeScreen.tsx"
click node_explorer "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/explorer/components/ExplorerScreen.tsx"
click node_settingsui "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/settings/components/SettingsScreen.tsx"
click node_settingsform "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/settings/components/SettingsForm.tsx"
click node_aiui "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/ai/components/AiScreen.tsx"
click node_apikeys "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/ai/components/ApiKeysPanel.tsx"
click node_gallery "https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/components-gallery/components/ComponentsGalleryScreen.tsx"
click node_ui_components "https://github.com/hassancs91/desktop-app-starter/tree/main/src/shared/components"
click node_main "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/index.ts"
click node_preload "https://github.com/hassancs91/desktop-app-starter/blob/main/src/preload/preload.ts"
click node_ipc "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/register.ts"
click node_ai_handlers "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/ai-handlers.ts"
click node_fs_handlers "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/fs-handlers.ts"
click node_fs_service "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/fs-service.ts"
click node_settings_handlers "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/settings-handlers.ts"
click node_settings_store "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/settings-store.ts"
click node_theme "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/theme-service.ts"
click node_theme_context "https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/contexts/ThemeContext.tsx"
click node_claude "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ai/anthropic-client.ts"
click node_secret_store "https://github.com/hassancs91/desktop-app-starter/tree/main/src/main/services"
click node_logging "https://github.com/hassancs91/desktop-app-starter/blob/main/src/logging/log-engine.ts"
click node_log_writer "https://github.com/hassancs91/desktop-app-starter/blob/main/src/logging/log-writer.ts"
click node_crash "https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/reliability/crash-handler.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_screens,node_home,node_explorer,node_settingsui,node_settingsform,node_aiui,node_apikeys,node_gallery,node_ui_components,node_user toneBlue
class node_main,node_preload,node_ipc,node_ai_handlers,node_fs_handlers,node_fs_service toneAmber
class node_settings_handlers,node_settings_store,node_theme,node_theme_context toneMint
class node_claude,node_anthropic,node_secret_store toneRose
class node_logging,node_log_writer,node_crash toneIndigo
```

## Components

### Window and screens

- [App shell](https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/App.tsx): `src/renderer/App.tsx`
- [Screen registry](https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/screens-registry.ts): `src/renderer/screens-registry.ts`
- [Home screen](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/home/components/HomeScreen.tsx): `src/features/home/components/HomeScreen.tsx`
- [File explorer](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/explorer/components/ExplorerScreen.tsx): `src/features/explorer/components/ExplorerScreen.tsx`
- [Settings screen](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/settings/components/SettingsScreen.tsx): `src/features/settings/components/SettingsScreen.tsx`
- [Settings form](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/settings/components/SettingsForm.tsx): `src/features/settings/components/SettingsForm.tsx`
- [AI screen](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/ai/components/AiScreen.tsx): `src/features/ai/components/AiScreen.tsx`
- [API key panel](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/ai/components/ApiKeysPanel.tsx): `src/features/ai/components/ApiKeysPanel.tsx`
- [Components gallery](https://github.com/hassancs91/desktop-app-starter/blob/main/src/features/components-gallery/components/ComponentsGalleryScreen.tsx): `src/features/components-gallery/components/ComponentsGalleryScreen.tsx`
- [Shared components](https://github.com/hassancs91/desktop-app-starter/tree/main/src/shared/components): `src/shared/components`

### IPC and capabilities

- [Main process](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/index.ts): `src/main/index.ts`
- [Preload bridge](https://github.com/hassancs91/desktop-app-starter/blob/main/src/preload/preload.ts): `src/preload/preload.ts`
- [IPC registration](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/register.ts): `src/main/ipc/register.ts`
- [AI handlers](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/ai-handlers.ts): `src/main/ipc/ai-handlers.ts`
- [File handlers](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/fs-handlers.ts): `src/main/ipc/fs-handlers.ts`
- [File service](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/fs-service.ts): `src/main/services/fs-service.ts`

### Settings and themes

- [Settings handlers](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ipc/settings-handlers.ts): `src/main/ipc/settings-handlers.ts`
- [Settings store](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/settings-store.ts): `src/main/services/settings-store.ts`
- [Theme service](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/services/theme-service.ts): `src/main/services/theme-service.ts`
- [Theme context](https://github.com/hassancs91/desktop-app-starter/blob/main/src/renderer/contexts/ThemeContext.tsx): `src/renderer/contexts/ThemeContext.tsx`

### AI and integrations

- [Claude client](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/ai/anthropic-client.ts): `src/main/ai/anthropic-client.ts`
- **Anthropic API**
- [Encrypted key storage](https://github.com/hassancs91/desktop-app-starter/tree/main/src/main/services): `src/main/services`

### Logging and reliability

- [Logging engine](https://github.com/hassancs91/desktop-app-starter/blob/main/src/logging/log-engine.ts): `src/logging/log-engine.ts`
- [Log writer](https://github.com/hassancs91/desktop-app-starter/blob/main/src/logging/log-writer.ts): `src/logging/log-writer.ts`
- [Crash recovery](https://github.com/hassancs91/desktop-app-starter/blob/main/src/main/reliability/crash-handler.ts): `src/main/reliability/crash-handler.ts`

### Other components

- **Desktop user**

## Connections

- Desktop user → App shell: uses (evidence: `README.md`)
- App shell → Screen registry: selects screens (evidence: `src/renderer/App.tsx`)
- Screen registry → Home screen: registers (evidence: `README.md`)
- Screen registry → File explorer: registers (evidence: `README.md`)
- Screen registry → Settings screen: registers (evidence: `README.md`)
- Screen registry → AI screen: registers (evidence: `README.md`)
- Screen registry → Components gallery: registers (evidence: `README.md`)
- Settings screen → Settings form: renders (evidence: `src/features/settings/components/SettingsScreen.tsx`)
- Desktop user → Components gallery: browses components (evidence: `README.md`)
- Main process → IPC registration: registers (evidence: `src/main/index.ts`)
- Main process → Preload bridge: loads bridge (evidence: `README.md`)
- Preload bridge → IPC registration: exposes typed channels (evidence: `README.md`)
- IPC registration → AI handlers: registers (evidence: `src/main/ipc/register.ts`)
- IPC registration → File handlers: registers (evidence: `src/main/ipc/register.ts`)
- IPC registration → Settings handlers: registers (evidence: `src/main/ipc/register.ts`)
- File handlers → File service: delegates to
- Settings handlers → Settings store: reads and writes
- Settings store → Theme service: provides settings (evidence: `src/main/services/theme-service.ts`)
- App shell → Theme context: provides theme (evidence: `src/renderer/App.tsx`)
- AI screen → API key panel: includes key panel (evidence: `README.md`)
- AI handlers → Claude client: calls (evidence: `src/main/ipc/ai-handlers.ts`)
- Claude client → Encrypted key storage: reads API key (evidence: `src/main/ai/anthropic-client.ts`)
- Claude client → Settings store: reads model setting (evidence: `src/main/ai/anthropic-client.ts`)
- Claude client → Anthropic API: sends requests (evidence: `README.md`)
- Main process → Logging engine: initializes (evidence: `src/main/index.ts`)
- Logging engine → Log writer: writes logs (evidence: `src/logging/log-engine.ts`)
- Main process → Crash recovery: attaches handler (evidence: `src/main/index.ts`)
