# whitetowerai/ohmygame architecture

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

- Interactive diagram: https://gitdiagram.com/whitetowerai/ohmygame
- Repository: https://github.com/whitetowerai/ohmygame

## Overview

OhMyGame is a desktop game-making studio where a user guides an AI agent through project design, asset creation, implementation, playtesting, and publishing. The graph preserves the documented canvas, game-authoring, provider, plugin, and community capabilities. Some links describe the README’s product workflow; source excerpts are incomplete, so internal wiring not shown there is omitted.

Main entry points: [`src/daemon/agent.ts`](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/agent.ts) (Agent), [`src/renderer/app.tsx`](https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/app.tsx) (Studio interface), [`src/daemon/publish/client.ts`](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/publish/client.ts) (Publish client), [`src/daemon/projects.ts`](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/projects.ts) (Projects and workspaces)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Studio app"]
  node_desktop["Desktop shell<br/>[main.ts]"]
  node_renderer["Studio interface<br/>[app.tsx]"]
  node_daemon["Runtime API<br/>[app.ts]"]
  node_contracts["Shared contracts<br/>[contracts.ts]"]
end

subgraph group_agent["Agent and integrations"]
  node_agent["Agent<br/>[agent.ts]"]
  node_conversations[("Persistent conversations<br/>[conversations.ts]")]
  node_plugins["Plugin capabilities"]
  node_providers["Media generation providers<br/>[image-models.ts]"]
end

subgraph group_canvas["Canvas and assets"]
  node_canvasui["Canvas editor"]
  node_canvasapi["Canvas API<br/>[canvas-api.ts]"]
  node_canvasstore[("Canvas workspace store")]
  node_canvasroutes["Canvas routes<br/>[canvas-routes.ts]"]
  node_assetlibrary[("Asset library<br/>[asset-library.ts]")]
end

subgraph group_games["Game workflow"]
  node_projects[("Projects and workspaces<br/>[projects.ts]")]
  node_playable["Interactive story runtime"]
  node_preview["Live preview<br/>[preview.ts]"]
  node_playtest["Game playtesting<br/>[playtest-driver.ts]"]
end

subgraph group_community["Publishing and community"]
  node_publisher["Publish client<br/>[client.ts]"]
  node_communityroutes["Community routes"]
  node_publishcontract["Publish data contracts<br/>[publish-v1.ts]"]
end

node_user(("Game maker"))

node_user -->|"guides work"| node_renderer
node_renderer -.->|"requests runtime"| node_daemon
node_desktop -->|"hosts interface"| node_renderer
node_daemon -.->|"provides agent"| node_agent
node_agent -->|"uses sessions"| node_conversations
node_agent -->|"uses plugins"| node_plugins
node_agent -->|"generates media"| node_providers
node_agent -->|"drives canvas"| node_canvasui
node_canvasui -->|"edits boards"| node_canvasapi
node_canvasapi -->|"calls routes"| node_canvasroutes
node_canvasroutes -->|"delegates storage"| node_canvasstore
node_canvasstore -->|"uses assets"| node_assetlibrary
node_projects -->|"manages assets"| node_assetlibrary
node_agent -->|"builds project"| node_projects
node_projects -.->|"runs preview"| node_preview
node_preview -->|"supports playtesting"| node_playtest
node_agent -->|"plays game"| node_playtest
node_agent -->|"authors stories"| node_playable
node_renderer -.->|"starts publishing"| node_publisher
node_publisher -->|"uses contracts"| node_publishcontract
node_communityroutes -->|"delegates requests"| node_publisher
node_publisher -->|"publishes remotely"| node_communityroutes
node_agent -->|"publishes game"| node_publisher
node_renderer -.->|"browses community"| node_communityroutes

click node_desktop "https://github.com/whitetowerai/ohmygame/blob/main/src/desktop/main.ts"
click node_renderer "https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/app.tsx"
click node_daemon "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/app.ts"
click node_contracts "https://github.com/whitetowerai/ohmygame/blob/main/src/shared/contracts.ts"
click node_agent "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/agent.ts"
click node_conversations "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/conversations.ts"
click node_plugins "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/plugin-capabilities.ts"
click node_canvasui "https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/asset-canvas-workspace.tsx"
click node_canvasapi "https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/canvas-api.ts"
click node_canvasstore "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/canvas-workspace.ts"
click node_canvasroutes "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/canvas-routes.ts"
click node_assetlibrary "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/asset-library.ts"
click node_projects "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/projects.ts"
click node_playable "https://github.com/whitetowerai/ohmygame/blob/main/src/shared/playable-runtime.ts"
click node_preview "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/preview.ts"
click node_playtest "https://github.com/whitetowerai/ohmygame/blob/main/src/desktop/playtest-driver.ts"
click node_providers "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/image-models.ts"
click node_publisher "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/publish/client.ts"
click node_communityroutes "https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/publish/community-routes.ts"
click node_publishcontract "https://github.com/whitetowerai/ohmygame/blob/main/src/shared/publish-v1.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,node_renderer,node_daemon,node_contracts toneBlue
class node_agent,node_conversations,node_plugins,node_providers toneAmber
class node_canvasui,node_canvasapi,node_canvasstore,node_canvasroutes,node_assetlibrary toneMint
class node_projects,node_playable,node_preview,node_playtest toneRose
class node_publisher,node_communityroutes,node_publishcontract,node_user toneIndigo
```

## Components

### Studio app

- [Desktop shell](https://github.com/whitetowerai/ohmygame/blob/main/src/desktop/main.ts): `src/desktop/main.ts`
- [Studio interface](https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/app.tsx): `src/renderer/app.tsx`
- [Runtime API](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/app.ts): `src/daemon/app.ts`
- [Shared contracts](https://github.com/whitetowerai/ohmygame/blob/main/src/shared/contracts.ts): `src/shared/contracts.ts`

### Agent and integrations

- [Agent](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/agent.ts): `src/daemon/agent.ts`
- [Persistent conversations](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/conversations.ts): `src/daemon/conversations.ts`
- [Plugin capabilities](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/plugin-capabilities.ts): `src/daemon/plugin-capabilities.ts`
- [Media generation providers](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/image-models.ts): `src/daemon/image-models.ts`

### Canvas and assets

- [Canvas editor](https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/asset-canvas-workspace.tsx): `src/renderer/asset-canvas-workspace.tsx`
- [Canvas API](https://github.com/whitetowerai/ohmygame/blob/main/src/renderer/canvas-api.ts): `src/renderer/canvas-api.ts`
- [Canvas workspace store](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/canvas-workspace.ts): `src/daemon/canvas-workspace.ts`
- [Canvas routes](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/canvas-routes.ts): `src/daemon/canvas-routes.ts`
- [Asset library](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/asset-library.ts): `src/daemon/asset-library.ts`

### Game workflow

- [Projects and workspaces](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/projects.ts): `src/daemon/projects.ts`
- [Interactive story runtime](https://github.com/whitetowerai/ohmygame/blob/main/src/shared/playable-runtime.ts): `src/shared/playable-runtime.ts`
- [Live preview](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/preview.ts): `src/daemon/preview.ts`
- [Game playtesting](https://github.com/whitetowerai/ohmygame/blob/main/src/desktop/playtest-driver.ts): `src/desktop/playtest-driver.ts`

### Publishing and community

- [Publish client](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/publish/client.ts): `src/daemon/publish/client.ts`
- [Community routes](https://github.com/whitetowerai/ohmygame/blob/main/src/daemon/publish/community-routes.ts): `src/daemon/publish/community-routes.ts`
- [Publish data contracts](https://github.com/whitetowerai/ohmygame/blob/main/src/shared/publish-v1.ts): `src/shared/publish-v1.ts`

### Other components

- **Game maker**

## Connections

- Game maker → Studio interface: guides work (evidence: `README.md`)
- Studio interface → Runtime API: requests runtime
- Desktop shell → Studio interface: hosts interface (evidence: `src/desktop/main.ts`)
- Runtime API → Agent: provides agent (evidence: `src/daemon/app.ts`)
- Agent → Persistent conversations: uses sessions (evidence: `src/daemon/agent.ts`)
- Agent → Plugin capabilities: uses plugins (evidence: `src/daemon/agent.ts`)
- Agent → Media generation providers: generates media (evidence: `README.md`)
- Agent → Canvas editor: drives canvas (evidence: `README.md`)
- Canvas editor → Canvas API: edits boards
- Canvas API → Canvas routes: calls routes (evidence: `src/daemon/canvas-routes.ts`)
- Canvas routes → Canvas workspace store: delegates storage (evidence: `src/daemon/canvas-routes.ts`)
- Canvas workspace store → Asset library: uses assets (evidence: `src/daemon/canvas-workspace.ts`)
- Projects and workspaces → Asset library: manages assets (evidence: `src/daemon/projects.ts`)
- Agent → Projects and workspaces: builds project (evidence: `README.md`)
- Projects and workspaces → Live preview: runs preview
- Live preview → Game playtesting: supports playtesting (evidence: `README.md`)
- Agent → Game playtesting: plays game (evidence: `README.md`)
- Agent → Interactive story runtime: authors stories (evidence: `README.md`)
- Studio interface → Publish client: starts publishing
- Publish client → Publish data contracts: uses contracts (evidence: `src/daemon/publish/client.ts`)
- Community routes → Publish client: delegates requests (evidence: `src/daemon/publish/community-routes.ts`)
- Publish client → Community routes: publishes remotely (evidence: `src/daemon/publish/community-routes.ts`)
- Agent → Publish client: publishes game (evidence: `README.md`)
- Studio interface → Community routes: browses community
