Package layout, styling inheritance, content loading, and desktop boundaries.
Architecture
Wailspring
Park UI
Wails
The workspace separates design tokens, React components, icons, documentation content, and host applications into packages with explicit boundaries.
Package dependenciesBuild shared packages before apps
01Shared packages
@wailspring/design-systempackages/design-system
Light and dark tokens, typography styles, and Panda CSS recipes.
@wailspring/iconspackages/icons
122 SVG icons for Astro and React.
@wailspring/contentpackages/content
Markdown and MDX files with directory URLs via @wailspring/content/paths.
Astro imports design-system, icons, and content directly
Park UI extends @wailspring/design-system for React
02React UI layer
apps/site skips React and the Park UI stylesheet.
@wailspring/uipackages/ui
Park UI and Ark UI React components inheriting Wailspring tokens.
03Applications
@wailspring/siteapps/site · Astro
Static HTML pages, content schemas, local fonts, and theme controls.
@wailspring/desktopapps/desktop · Go + Wails 3.1.0 + React 19
Go validation and SQLite storage with a React frontend and browser preview mode.
Shared packages build into dist/ before app codegen runs. Apps import built package exports only.
Workspace layout
apps/ site/ @wailspring/site — Static Astro website and docs host desktop/ Go module and native Wails 3.1.0 desktop host desktop/frontend/ @wailspring/desktop — React + Vite desktop UI storybook/ @wailspring/storybook — Optional React component workshoppackages/ design-system/ @wailspring/design-system — Panda tokens and class-name recipes ui/ @wailspring/ui — Park UI React catalog and static Astro primitives design-system-docs/ @wailspring/docs — Pure token metadata and Astro/React specimens icons/ @wailspring/icons — 122 SVG icons (Astro, React, and raw SVG) content/ @wailspring/content — Source-only Markdown and MDX guides
Packages own reusable styles, icons, primitives, and raw content. Apps own routing, hydration, accessibility landmarks, translations, native integrations, data adapters, and lifecycle.
Styling: Wailspring for Astro, Park UI for React
@wailspring/design-system is a framework-independent Panda CSS 2.6 design system that generates CSS and typed class-name helpers from TypeScript token and recipe definitions. It defines semantic light and dark tokens (bg.*, text.*, border.*, accent.*, content.*, code.*, status.*), text styles, and class-name recipes (shell, button, textLink, tagList, pageHeader, projectCard, indexRow, plus docsTokens and docsPreview).
Both apps share that foundation through Panda CSS design systems without pulling React into the static site:
apps/site consumes @wailspring/design-system directly. Its panda.config.ts sets designSystem: '@wailspring/design-system' with jsxFramework unset. Pages style plain HTML with foundation recipes and colocated *.styles.ts modules, emitting static HTML and CSS with no React runtime and no Park UI stylesheet.
@wailspring/ui/astro wraps static foundation primitives. It exports Button and TextLink (also available as @wailspring/ui/astro/Button and @wailspring/ui/astro/TextLink) backed by @wailspring/design-system/recipes, with no React or Ark UI dependency. @wailspring/docs/astro provides static token swatches, type/spacing scales, and component preview frames.
apps/desktop/frontend (and optional apps/storybook) consume @wailspring/ui.Ark UI provides unstyled, accessible React primitives (keyboard navigation, ARIA roles, focus management, portals), and Park UI provides composable Panda recipes over them. @wailspring/ui inherits @wailspring/design-system directly through Panda’s designSystem chain—no Tailwind, parallel color palette, adapter layer, or unstyled overrides. Do not run upstream Park UI or Panda CLI installers over this workspace.
Source-only content
@wailspring/content holds .md and .mdx files plus media assets and has no build step or framework dependency. Its sole export, @wailspring/content/paths, returns directory URL objects { pages, docs }. Canonical guides live in docs; pages stays available for custom collections.
apps/site/src/content.config.ts loads packages/content/docs/ recursively with Astro’s glob loader and validates frontmatter with astro/zod. Only title and description are required; section, order, summary, tags, and published have defaults.
apps/site/src/pages/docs/index.astro and apps/site/src/pages/docs/[...slug].astro generate static HTML routes, including nested subdirectories.
apps/site/src/lib/docs.ts excludes drafts (published: false) and sorts pages deterministically for the landing page, docs index, and previous/next pager.
apps/site/src/lib/remark-doc-links.mjs rewrites source-relative Markdown links (keeping fragments and queries) into /docs/.../ URLs and strips a leading # Title when it matches frontmatter title.
App-owned MDX components (ArchitectureDiagram, Callout, DesignSystemShowcase) live in apps/site/src/components/ and import through @/ (apps/site/tsconfig.json).
Desktop boundaries
The desktop app splits responsibilities between Go (apps/desktop) and React (apps/desktop/frontend) across a Wails 3 bridge:
Go owns validation, storage, and native lifecycle. Registered Wails services in internal/app/run.go expose typed methods compiled into TypeScript/JavaScript bindings. Go validates every mutation independently of frontend schemas, manages SQLite (internal/items via modernc.org/sqlite) and atomic schema-1 preferences (internal/preferences), handles OS notifications (internal/desktop), and runs explicit signed-update operations (internal/app.UpdateService).
React owns UI, navigation, and local state. The frontend uses React Router HashRouter (compatible with Vite’s relative base: './' inside Wails’s embedded asset server), TanStack Query with networkMode: 'always' (so local IPC works offline), React Hook Form with Zod for immediate form feedback and response parsing, and synchronous bundled English/German resources via react-i18nextuseTranslation and i18next.
Host adapters isolate Wails bindings. Screens talk to a typed Host interface (src/host/contract.ts) resolved by Vite via the #host alias (vite.config.ts). In native builds (--mode native), src/host/native.ts checks the Wails bridge before dynamically importing @wailsio/runtime and generated bindings under ignored frontend/bindings/. In browser preview builds, src/host/browser.ts keeps sample data in session memory only, resets on reload, and disables clipboard, file dialog, notification, and update actions.
End-to-end data flow
Adding or updating an item crosses each layer explicitly:
Form input (pages/items.tsx): React Hook Form validates the title with zodResolver(itemFormSchema) (1–200 Unicode code points in host/contract.ts) and displays inline Field.ErrorText feedback on invalid input.
Mutation and host adapter (query.ts, host/contract.ts): Valid submissions invoke a TanStack Query useMutation call to host.addItem(title) (or updateItem / deleteItem) with networkMode: 'always'.
Native vs. browser execution:
Native mode (host/native.ts):guard() checks the Wails runtime, calls generated ItemsService.AddItem, and parses the result with itemSchema. On the Go side (internal/items/service.go → database.go), Go trims and validates the title (1..200 runes) independently and runs parameterized SQL against items.sqlite3 in the per-user data directory.
Browser preview (host/browser.ts): The adapter validates the title with titleSchema and mutates an in-memory array that resets on reload.
Cache refresh: On success, client.invalidateQueries({ queryKey: itemsKey }) refetches items and updates both the Items screen and Overview summary. Shared packages (@wailspring/ui, @wailspring/docs, @wailspring/icons) never import Go bindings or app translations; they render props and translated children passed by the host app.
Saved preferences follow the same boundary: only accepted settings saved through the host apply theme, language, and opt-in Developer mode (#/developer, a lazy-loaded playground with read-only diagnostics and no extra IPC privileges). See Desktop app.
Runtime and release contract
Runtime separation: Astro consumes @wailspring/design-system directly without React or the Park UI stylesheet; React apps consume @wailspring/ui. Both share semantic tokens and bundled local fonts.
Native vs. preview honesty: Go validates and persists native data; browser preview uses session memory and explicitly marks native features unavailable. Shared UI stays free of Go bindings and app state.
Content and releases: Markdown/MDX in packages/content/docs become static /docs/.../ routes owned by Astro. Signed updates and release workflows are opt-in—creating a repository from the starter does not enable an update feed, publish releases, configure signing secrets, or deploy the site.
Where to go next
Follow Build a feature for a step-by-step extension from a semantic token and shared React component through Go, bindings, TanStack Query invalidation, translations, and a static MDX guide.
The workspace separates design tokens, React components, icons, documentation content, and host applications into packages with explicit boundaries.
@wailspring/design-systempackages/design-systemLight and dark tokens, typography styles, and Panda CSS recipes.
@wailspring/iconspackages/icons122 SVG icons for Astro and React.
@wailspring/contentpackages/contentMarkdown and MDX files with directory URLs via
@wailspring/content/paths.apps/siteskips React and the Park UI stylesheet.@wailspring/uipackages/uiPark UI and Ark UI React components inheriting Wailspring tokens.
@wailspring/siteapps/site · AstroStatic HTML pages, content schemas, local fonts, and theme controls.
@wailspring/desktopapps/desktop · Go + Wails 3.1.0 + React 19Go validation and SQLite storage with a React frontend and browser preview mode.
dist/before app codegen runs. Apps import built package exports only.Workspace layout
Packages own reusable styles, icons, primitives, and raw content. Apps own routing, hydration, accessibility landmarks, translations, native integrations, data adapters, and lifecycle.
Styling: Wailspring for Astro, Park UI for React
@wailspring/design-systemis a framework-independent Panda CSS 2.6 design system that generates CSS and typed class-name helpers from TypeScript token and recipe definitions. It defines semantic light and dark tokens (bg.*,text.*,border.*,accent.*,content.*,code.*,status.*), text styles, and class-name recipes (shell,button,textLink,tagList,pageHeader,projectCard,indexRow, plusdocsTokensanddocsPreview).Both apps share that foundation through Panda CSS design systems without pulling React into the static site:
apps/siteconsumes@wailspring/design-systemdirectly. Itspanda.config.tssetsdesignSystem: '@wailspring/design-system'withjsxFrameworkunset. Pages style plain HTML with foundation recipes and colocated*.styles.tsmodules, emitting static HTML and CSS with no React runtime and no Park UI stylesheet.@wailspring/ui/astrowraps static foundation primitives. It exportsButtonandTextLink(also available as@wailspring/ui/astro/Buttonand@wailspring/ui/astro/TextLink) backed by@wailspring/design-system/recipes, with no React or Ark UI dependency.@wailspring/docs/astroprovides static token swatches, type/spacing scales, and component preview frames.apps/desktop/frontend(and optionalapps/storybook) consume@wailspring/ui. Ark UI provides unstyled, accessible React primitives (keyboard navigation, ARIA roles, focus management, portals), and Park UI provides composable Panda recipes over them.@wailspring/uiinherits@wailspring/design-systemdirectly through Panda’sdesignSystemchain—no Tailwind, parallel color palette, adapter layer, orunstyledoverrides. Do not run upstream Park UI or Panda CLI installers over this workspace.Source-only content
@wailspring/contentholds.mdand.mdxfiles plus media assets and has no build step or framework dependency. Its sole export,@wailspring/content/paths, returns directoryURLobjects{ pages, docs }. Canonical guides live indocs;pagesstays available for custom collections.apps/siteowns collection loading and rendering using Astro Content Collections and the Astro MDX integration:apps/site/src/content.config.tsloadspackages/content/docs/recursively with Astro’sglobloader and validates frontmatter withastro/zod. Onlytitleanddescriptionare required;section,order,summary,tags, andpublishedhave defaults.apps/site/src/pages/docs/index.astroandapps/site/src/pages/docs/[...slug].astrogenerate static HTML routes, including nested subdirectories.apps/site/src/lib/docs.tsexcludes drafts (published: false) and sorts pages deterministically for the landing page, docs index, and previous/next pager.apps/site/src/lib/remark-doc-links.mjsrewrites source-relative Markdown links (keeping fragments and queries) into/docs/.../URLs and strips a leading# Titlewhen it matches frontmattertitle.ArchitectureDiagram,Callout,DesignSystemShowcase) live inapps/site/src/components/and import through@/(apps/site/tsconfig.json).Desktop boundaries
The desktop app splits responsibilities between Go (
apps/desktop) and React (apps/desktop/frontend) across a Wails 3 bridge:internal/app/run.goexpose typed methods compiled into TypeScript/JavaScript bindings. Go validates every mutation independently of frontend schemas, manages SQLite (internal/itemsviamodernc.org/sqlite) and atomic schema-1 preferences (internal/preferences), handles OS notifications (internal/desktop), and runs explicit signed-update operations (internal/app.UpdateService).HashRouter(compatible with Vite’s relativebase: './'inside Wails’s embedded asset server), TanStack Query withnetworkMode: 'always'(so local IPC works offline), React Hook Form with Zod for immediate form feedback and response parsing, and synchronous bundled English/German resources viareact-i18nextuseTranslationandi18next.Hostinterface (src/host/contract.ts) resolved by Vite via the#hostalias (vite.config.ts). In native builds (--mode native),src/host/native.tschecks the Wails bridge before dynamically importing@wailsio/runtimeand generated bindings under ignoredfrontend/bindings/. In browser preview builds,src/host/browser.tskeeps sample data in session memory only, resets on reload, and disables clipboard, file dialog, notification, and update actions.End-to-end data flow
Adding or updating an item crosses each layer explicitly:
pages/items.tsx): React Hook Form validates the title withzodResolver(itemFormSchema)(1–200 Unicode code points inhost/contract.ts) and displays inlineField.ErrorTextfeedback on invalid input.query.ts,host/contract.ts): Valid submissions invoke a TanStack QueryuseMutationcall tohost.addItem(title)(orupdateItem/deleteItem) withnetworkMode: 'always'.host/native.ts):guard()checks the Wails runtime, calls generatedItemsService.AddItem, and parses the result withitemSchema. On the Go side (internal/items/service.go→database.go), Go trims and validates the title (1..200runes) independently and runs parameterized SQL againstitems.sqlite3in the per-user data directory.host/browser.ts): The adapter validates the title withtitleSchemaand mutates an in-memory array that resets on reload.client.invalidateQueries({ queryKey: itemsKey })refetches items and updates both the Items screen and Overview summary. Shared packages (@wailspring/ui,@wailspring/docs,@wailspring/icons) never import Go bindings or app translations; they render props and translated children passed by the host app.Saved preferences follow the same boundary: only accepted settings saved through the host apply theme, language, and opt-in Developer mode (
#/developer, a lazy-loaded playground with read-only diagnostics and no extra IPC privileges). See Desktop app.Runtime and release contract
@wailspring/design-systemdirectly without React or the Park UI stylesheet; React apps consume@wailspring/ui. Both share semantic tokens and bundled local fonts.packages/content/docsbecome static/docs/.../routes owned by Astro. Signed updates and release workflows are opt-in—creating a repository from the starter does not enable an update feed, publish releases, configure signing secrets, or deploy the site.Where to go next