How peterjaberau/dev-kit works
1. Repository shape
- This is a pnpm monorepo for a design-system / UI-kit ecosystem called dev-kit.
- The repo is split into reusable packages, Storybook-driven documentation apps, and starter templates.
2. Core product boundary: packages/ui-kit/components
- This is the main component library and the architectural center of the repo.
- It contains reusable UI primitives and composites such as dialogs, menus, form controls, overlays, feedback, navigation, and utility components.
- It also includes more specialized widgets like draggable-panel and floating-panel, which have their own submodules for constants, recipes, utils, and types.
3. Experimental UI layer: packages/ui-kit/experiments
- This package holds non-core, likely unstable components such as resizable-panel and toolbar.
- It is separated from the main component package, which suggests the repo distinguishes between supported UI primitives and exploratory features.
4. Icon system: packages/icons
- Icons are managed as a dedicated package with SVG/component/type layers.
- This gives the design system a separate asset pipeline for icon definitions and rendering, rather than treating icons as ad hoc assets inside components.
5. Documentation/rendering support: packages/documenter
- This package provides components and types for “documenter” functionality, likely used to present component or token documentation in a structured way.
- It sits between raw UI packages and the story/demo apps, acting as a documentation presentation layer.
6. Primary showcase app: apps/stories
- This is a Next.js + Storybook application used to present examples and interactive stories.
- Its content is organized by domain: charts, system components, tokens, site-level examples, and experiments.
- The large number of example files indicates it serves as the main visual QA and documentation surface for the UI kit.
7. Storybook runtime and theming
- The root .storybook directory provides shared Storybook configuration, decorators, preview setup, and theme handling.
- It also includes “actors” support files, suggesting Storybook stories are wired into a state/model layer for interactive demos and controlled examples.
- The theme decorator and preview setup are important boundaries: they wrap every story in the design-system context.
8. Standalone demo app: apps/ui-actors-stateless
- This is a separate Next.js app, likely used to exercise the actor-based UI patterns without persistent app state.
- Its minimal structure suggests it is a focused demo or verification surface rather than a full product app.
9. Template layer: templates/basic and templates/cloudflare
- These are starter app templates for consumers of the kit.
- Both include an actors architecture with model, hooks, selectors, shared data, and providers, plus standard app/layout/page entry points.
- templates/cloudflare adds deployment-specific configuration (open-next.config.ts, wrangler.jsonc, env.d.ts), showing a deployment boundary for Cloudflare/OpenNext.
10. Shared architecture pattern: actors/state modeling
- Multiple places in the repo use an actors directory with model, machines, selectors, hooks, and provider.
- This indicates a deliberate application-state pattern built around actor/machine concepts, shared across templates and demos.
- In diagram terms, this is a cross-cutting state layer that sits between UI components and app pages.
11. How code flows through the repo
- The dependency direction is generally: packages provide reusable UI/docs/icon primitives, apps/stories and templates consume them, and Storybook demonstrates them in isolation.
- The story/demo apps are the primary integration points where components, themes, and actor-based state models are composed together.
12. Tooling and build surface
- The repo uses modern frontend tooling: Next.js for apps, Storybook for component exploration, Vite and tsup for build-related tasks, and TypeScript everywhere.
- Root config files (tsconfig, ESLint, Prettier, workspace config) suggest a shared monorepo toolchain rather than isolated package tooling.
13. What to draw as the main boundaries
- Draw three major areas: reusable packages, interactive documentation/demo apps, and starter templates.
- Inside reusable packages, separate core components, experimental components, icons, and documentation helpers.
- Inside apps, show Storybook/app shell, theming/decorators, and actor/state providers as the key composition layers.
Main entry points: stories Stories app · components Core components · documenter Documenter · actors Storybook actors
Components 20
Reusable packages
Core UI kit, icons, and documenter libraries.
- Core components · Main reusable component library: dialogs, menus, forms, overlays, navigation, and composites.
packages/ui-kit/components - Floating panel · Floating panel subsystem with recipe and namespace support.
packages/ui-kit/components/src/components/floating-panel - Draggable panel · Draggable panel subsystem with constants, recipe, utils, and types.
packages/ui-kit/components/src/components/draggable-panel - Experimental UI · Non-core exploratory components such as resizable panel and toolbar.
packages/ui-kit/experiments - Icon system · Dedicated SVG/component/type pipeline for icons.
packages/icons - Documenter · Documentation presentation components and types.
packages/documenter
Interactive apps
Storybook showcase and standalone demo app.
- Stories app · Primary showcase app for charts, system examples, tokens, and experiments.
apps/stories - Chart demos · Large set of composition examples for charting components.
apps/stories/src/components/compositions/examples/charts - System demos · System-level examples for recipes, color, animation, and styling patterns.
apps/stories/src/components/compositions/examples/system - Token demos · Token and style documentation examples.
apps/stories/src/components/compositions/examples/tokens - Component demos · Examples for draggable and floating panel components.
apps/stories/src/components/compositions/examples/components - Experiment demos · Story examples for documenter, resizable panels, and toolbar.
apps/stories/src/components/compositions/examples/experiments - Site demos · Site-level documentation and accessibility examples.
apps/stories/src/components/compositions/examples/site - Stateless demo · Standalone app for exercising actor-based UI patterns without persistent app state.
apps/ui-actors-stateless
Starter templates
Consumer app templates with shared actor/state architecture.
- Basic template · Starter template with actor model, app shell, and views.
templates/basic - Cloudflare template · Cloudflare/OpenNext starter with actor model and deployment config.
templates/cloudflare
Shared runtime
Cross-cutting Storybook theming and actor/state model.
- Storybook shell · Shared Storybook entrypoints and preview/manager setup.
.storybook - Storybook actors · Interactive Storybook actor model, hooks, provider, and data defaults.
.storybook/actors - Theme decorator · Wraps stories in design-system theme and preview context.
.storybook/decorators/withTheme.tsx
Tooling
Workspace-level build and type tooling.
- Monorepo tooling · Workspace config, TypeScript, linting, formatting, and build tooling.
Connections 38
- Monorepo tooling → Storybook shell: builds · Shared workspace tooling supports the Storybook app.
- Monorepo tooling → Stories app: builds · Shared workspace tooling supports the showcase app.
- Monorepo tooling → Stateless demo: builds · Shared workspace tooling supports the standalone demo app.
- Monorepo tooling → Basic template: scaffolds · Workspace tooling and conventions shape the starter template.
- Monorepo tooling → Cloudflare template: scaffolds · Workspace tooling and conventions shape the Cloudflare starter.
- Storybook shell → Theme decorator: wraps · Storybook preview applies the theme decorator.
- Storybook shell → Storybook actors: loads · Shared preview/runtime imports actor support.
- Storybook actors → Theme decorator: feeds · Actor-driven stories are rendered within themed context.
- Stories app → Storybook shell: uses · The stories app consumes Storybook configuration and runtime.
- Stories app → Core components: showcases · The showcase app renders the core UI kit.
- Stories app → Experimental UI: showcases · The showcase app renders experimental components.
- Stories app → Icon system: showcases · The showcase app uses the icon system in demos.
- Stories app → Documenter: showcases · The showcase app includes documenter demos.
- Stories app → Chart demos: contains · Chart example surface inside the showcase app.
- Stories app → System demos: contains · System example surface inside the showcase app.
- Stories app → Token demos: contains · Token example surface inside the showcase app.
- Stories app → Component demos: contains · Component example surface inside the showcase app.
- Stories app → Experiment demos: contains · Experiment example surface inside the showcase app.
- Stories app → Site demos: contains · Site example surface inside the showcase app.
- Component demos → Draggable panel: drives · Draggable panel examples exercise the component subsystem.
- Component demos → Floating panel: drives · Floating panel examples exercise the component subsystem.
- Experiment demos → Experimental UI: drives · Experimental stories exercise the unstable UI layer.
- Experiment demos → Documenter: drives · Documenter stories exercise documentation components.
- Basic template → Core components: consumes · Starter apps consume the reusable UI kit.
- Basic template → Icon system: consumes · Starter apps consume the shared icon package.
- Basic template → Storybook actors: uses · Starter apps follow the shared actor/state pattern.
- Cloudflare template → Core components: consumes · Cloudflare starter consumes the reusable UI kit.
- Cloudflare template → Icon system: consumes · Cloudflare starter consumes the shared icon package.
- Cloudflare template → Storybook actors: uses · Cloudflare starter follows the shared actor/state pattern.
- Core components → Draggable panel: includes · Core library contains the draggable panel subsystem.
- Core components → Floating panel: includes · Core library contains the floating panel subsystem.
- Core components → Icon system: depends on · Components use the shared icon package for glyphs.
- Core components → Documenter: documents with · Component docs and metadata are supported by the documenter package.
- Experimental UI → Core components: extends · Experimental UI builds on the core component layer.
- Documenter → Core components: describes · Documenter presents the core UI primitives and composites.
- Documenter → Icon system: renders · Documenter can render icon-related content.
- Stateless demo → Storybook actors: shares pattern · Standalone demo uses the same actor-based UI model.
- Stateless demo → Core components: consumes · Demo app composes the reusable UI kit.