# okazaki112/prompthub architecture

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

- Interactive diagram: https://gitdiagram.com/okazaki112/prompthub
- Repository: https://github.com/okazaki112/prompthub

## Overview

PromptHub is a local-first workspace for prompts, skills, and project-level AI coding assets. Users manage and organize assets in the desktop workspace, then test prompts with AI models or deploy skills to supported coding tools; they can also back up or synchronize data. The repository includes desktop, CLI, mobile, self-hosted web, and Cloudflare web-data surfaces. The README documents the major workflows, while sampled source shows selected renderer-to-store and server route wiring; unsampled subsystem internals and some cross-process links are not asserted.

Main entry points: [`apps/desktop/src/renderer/App.tsx`](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/renderer/App.tsx) (Desktop workspace), [`apps/desktop/src/renderer/components/prompt`](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/prompt) (Prompt management), [`apps/desktop/src/renderer/components/skill`](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/skill) (Skill management), [`apps/web/src/app.ts`](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/web/src/app.ts) (Self-hosted web)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workspace"]
  node_desktop_ui["Desktop workspace<br/>[App.tsx]"]
  node_local_db[("Local data store<br/>[sqlite.ts]")]
  node_ipc["Desktop IPC<br/>[index.ts]"]
end

subgraph group_assets["Asset capabilities"]
  node_prompt_work["Prompt management"]
  node_skill_work["Skill management"]
  node_plugin_mcp["Plugin and MCP"]
  node_rules["Rules workspace"]
  node_ai["AI services<br/>[ai-client.ts]"]
  node_deployment["Agent deployment<br/>[skill-installer.ts]"]
end

subgraph group_sync["Sync and services"]
  node_backup["Backup and restore<br/>[database-backup.ts]"]
  node_webdav["WebDAV sync<br/>[webdav.ts]"]
  node_web_app["Self-hosted web<br/>[app.ts]"]
  node_cloud_sync["Cloudflare sync<br/>[worker.ts]"]
end

subgraph group_clients["Other clients"]
  node_cli["CLI<br/>[index.ts]"]
  node_mobile["Mobile client<br/>[database.ts]"]
end

node_user(("User"))

node_user -->|"manages assets"| node_desktop_ui
node_desktop_ui -->|"edits prompts"| node_prompt_work
node_desktop_ui -->|"manages skills"| node_skill_work
node_desktop_ui -->|"manages integrations"| node_plugin_mcp
node_desktop_ui -->|"manages rules"| node_rules
node_desktop_ui -->|"stores locally"| node_local_db
node_desktop_ui -.->|"uses IPC"| node_ipc
node_prompt_work -->|"tests with models"| node_ai
node_skill_work -->|"deploys skills"| node_deployment
node_desktop_ui -->|"backs up data"| node_backup
node_desktop_ui -->|"syncs via"| node_webdav
node_user -->|"uses self-hosted"| node_web_app
node_web_app -.->|"persists workspace"| node_local_db
node_user -.->|"syncs devices"| node_cloud_sync
node_user -->|"uses CLI"| node_cli
node_user -.->|"uses mobile app"| node_mobile

click node_desktop_ui "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/renderer/App.tsx"
click node_prompt_work "https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/prompt"
click node_skill_work "https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/skill"
click node_plugin_mcp "https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/plugin"
click node_rules "https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/rules"
click node_local_db "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/database/sqlite.ts"
click node_ipc "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/ipc/index.ts"
click node_ai "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/services/ai-client.ts"
click node_deployment "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/services/skill-installer.ts"
click node_backup "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/renderer/services/database-backup.ts"
click node_webdav "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/webdav.ts"
click node_web_app "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/web/src/app.ts"
click node_cloud_sync "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/web-cloudflare/src/worker.ts"
click node_cli "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/cli/src/index.ts"
click node_mobile "https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/mobile/src/storage/database.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_desktop_ui,node_local_db,node_ipc,node_user toneBlue
class node_prompt_work,node_skill_work,node_plugin_mcp,node_rules,node_ai,node_deployment toneAmber
class node_backup,node_webdav,node_web_app,node_cloud_sync toneMint
class node_cli,node_mobile toneRose
```

## Components

### Desktop workspace

- [Desktop workspace](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/renderer/App.tsx): `apps/desktop/src/renderer/App.tsx`
- [Local data store](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/database/sqlite.ts): `apps/desktop/src/main/database/sqlite.ts`
- [Desktop IPC](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/ipc/index.ts): `apps/desktop/src/main/ipc/index.ts`

### Asset capabilities

- [Prompt management](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/prompt): `apps/desktop/src/renderer/components/prompt`
- [Skill management](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/skill): `apps/desktop/src/renderer/components/skill`
- [Plugin and MCP](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/plugin): `apps/desktop/src/renderer/components/plugin`
- [Rules workspace](https://github.com/okazaki112/prompthub/tree/feature/v0.6.4/apps/desktop/src/renderer/components/rules): `apps/desktop/src/renderer/components/rules`
- [AI services](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/services/ai-client.ts): `apps/desktop/src/main/services/ai-client.ts`
- [Agent deployment](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/services/skill-installer.ts): `apps/desktop/src/main/services/skill-installer.ts`

### Sync and services

- [Backup and restore](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/renderer/services/database-backup.ts): `apps/desktop/src/renderer/services/database-backup.ts`
- [WebDAV sync](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/desktop/src/main/webdav.ts): `apps/desktop/src/main/webdav.ts`
- [Self-hosted web](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/web/src/app.ts): `apps/web/src/app.ts`
- [Cloudflare sync](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/web-cloudflare/src/worker.ts): `apps/web-cloudflare/src/worker.ts`

### Other clients

- [CLI](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/cli/src/index.ts): `apps/cli/src/index.ts`
- [Mobile client](https://github.com/okazaki112/prompthub/blob/feature/v0.6.4/apps/mobile/src/storage/database.ts): `apps/mobile/src/storage/database.ts`

### Other components

- **User**

## Connections

- User → Desktop workspace: manages assets (evidence: `README.md`)
- Desktop workspace → Prompt management: edits prompts (evidence: `README.md`)
- Desktop workspace → Skill management: manages skills (evidence: `README.md`)
- Desktop workspace → Plugin and MCP: manages integrations (evidence: `README.md`)
- Desktop workspace → Rules workspace: manages rules
- Desktop workspace → Local data store: stores locally (evidence: `README.md`)
- Desktop workspace → Desktop IPC: uses IPC
- Prompt management → AI services: tests with models (evidence: `README.md`)
- Skill management → Agent deployment: deploys skills (evidence: `README.md`)
- Desktop workspace → Backup and restore: backs up data (evidence: `README.md`)
- Desktop workspace → WebDAV sync: syncs via (evidence: `README.md`)
- User → Self-hosted web: uses self-hosted (evidence: `README.md`)
- Self-hosted web → Local data store: persists workspace
- User → Cloudflare sync: syncs devices
- User → CLI: uses CLI (evidence: `README.md`)
- User → Mobile client: uses mobile app
