Skip to content

Architecture ​

The repository ​

text
dwa-platform/
├── apps/
│   ├── extension/     VS Code extension + language server (TypeScript, LSP)
│   ├── theme-hub/     Theme portal (Cloudflare Workers, D1, R2, Better Auth, React)
│   ├── mcp/           MCP server (to be built)
│   └── site/          This documentation site (VitePress)
├── packages/
│   └── core/          Core v1 catalog and theme validator, shared
├── theme/
│   ├── DWA.css        Reference theme (@theme DWA)
│   └── archive/       Old versions — do not modify or save
├── docs/language/     Language guide (reference), naming, visual catalog
├── examples/          Sample presentations
└── scripts/           test-changed.mjs: e2e journeys affected by a change

How the pieces fit together ​

text
            ┌──────────────── Author's machine ─────────────────┐
            │                                                    │
 Markdown ──┤  VS Code ── DWA extension ── Language server       │
            │                 │   │                              │
            │                 │   └── Chromium render (measure)  │
            │                 └────── PPTX export                │
            │                 │                                  │
            └─────────────────┼──────────────────────────────────┘
                              │  HTTPS, revocable token
                              ▼
                     Theme portal (Worker)
                       ├── D1: permissions, themes, versions, reports
                       ├── R2 or organization storage: private CSS
                       └── Claude API (optional): editor assistant
  • The shared core (packages/core/) contains the language catalog (src/catalog.ts) and the theme validator (src/theme-rules/). The extension, the portal (server and editor) and this site import it as source: a rule is written only once.
  • The rest of the language core (apps/extension/src/language/, render/, export/) does not depend on VS Code. It will be extracted when the MCP server needs it.
  • The extension calls the portal's extension API (src/hub/ ↔ apps/theme-hub/worker/routes/device.ts, /device-api/v2). Any API change keeps both sides compatible.
  • This site imports the shared catalog and the extension's package.json to generate the class reference and the commands and settings; slide examples are rendered with Marp Core and theme/DWA.css at build time.

The portal in detail ​

text
apps/theme-hub/
├── worker/            API (Cloudflare Worker)
│   ├── routes/        account, orgs, themes, device (extension API)
│   ├── auth.ts        Better Auth: email code + OIDC SSO
│   ├── storage.ts     multicloud storage (R2, S3 compatible, Azure)
│   └── ai.ts          editor assistant (Claude)
├── web/               React + shadcn/ui + Tailwind (Vite) interface, served by the Worker
│   └── src/editor/    editor, validation in a Web Worker, geometry measurement in an isolated iframe
├── migrations/        D1 database (SQLite)
└── tests/             e2e journeys: API, integrations, interface (Chromium)

The extension in detail ​

FileRole
src/extension.tsVS Code integration (commands, inline suggestions, export)
src/server.tsLanguage server: completion, hover, diagnostics, fixes
src/language/catalog.tsRe-exports the catalog from packages/core
src/language/language.tsMarkdown parsing and rules
src/language/activation.tsTheme detection and activation
src/language/transitions.tsSpace reserved for titles and legends (experimental)
src/render/renderer.tsRender measurement, in a separate process
src/render/callout-fit.tsAutomatic callout sizing
src/export/pptx.tsPowerPoint export, independent of VS Code
src/hub/hub.tsOrganization themes: sign-in, selection, verification, status bar, validation
src/hub/hub-client.tsExtension API client, independent of VS Code
src/hub/store.tsThemes installed in global storage, one active version per theme
src/hub/theme-server.ts127.0.0.1 server that exposes installed themes to Marp

Documentation of the DWA Core v1 language, the VS Code extension, the CLI and the theme portal.