Skip to content

Samples

Tested examples for framework features. Two buckets:

  • recipes/ — one concept = one feature definition + one test. If a framework change breaks something, the recipe test goes red. Server-only, no UI.
  • apps/ — full-stack demos with dev-server + browser client. Show the UI layer + auth wiring + WorkspaceShell.

For a full app-domain showcase running in production, see publicstatus.eu — a statuspage service built end-to-end on Kumiko (multi-tenant, SSE-realtime, EU-hosted).

I want to…SampleTest type
Entity + standard handlers + soft delete + optimistic lockingrecipes-basic-entityIntegration
Custom handlers with business logicrecipes-custom-handlersIntegration
Parent-child relations + cascade/restrictrecipes/relationsIntegration
Embedded objects (1:1 sub-shapes inside a parent row)recipes/embeddedIntegration
Hide/protect fields per rolerecipes-field-accessIntegration
Hooks (validation, preSave, postSave)recipes-lifecycle-hooksIntegration
Seed reference data (r.referenceData)recipes/reference-dataIntegration
Full-text search (searchable, searchWeight)recipes/searchIntegration
Realtime updates via SSErecipes/realtime-sseIntegration
Cross-feature reactions (ctx.appendEvent + r.multiStreamProjection)recipes-cross-feature-eventsIntegration
Full event sourcing (defineEvent + Upcaster + Projections + asOf + archive)recipes-event-sourcingIntegration
State machine (allowed transitions enforced)recipes/state-machineIntegration
Request deduplication (idempotency)recipes/idempotencyIntegration
Multi-tenant data isolationrecipes/tenant-isolationIntegration
Anonymous access (public endpoints, no auth)recipes/anonymous-accessIntegration
Anonymous access in multi-tenant setuprecipes/anonymous-access-multitenantIntegration
Internationalization (i18n)recipes/i18nUnit
Clean error handling (Kumiko error classes, reasons, helpers)recipes-error-contractIntegration
Default-deny access rules + FK indices via relationsrecipes/access-controlIntegration
Features inject identity facts into the JWT (r.authClaims)recipes/auth-claimsIntegration
Row-level ownership (entity + field, read + write, straddle-safe)recipes/ownershipIntegration
Pin jobs to deploy lane (runIn: "api" | "worker"), event-triggered fan-outrecipes/lane-routingIntegration
Register screens + navigation (r.screen + r.nav) with cross-feature parentsrecipes/screens-navUnit
Generate Playwright E2E specs from the registryrecipes/e2e-generatorUnit
Multi-currency money type (global rate table)recipes/currencies-globalIntegration
Multi-currency money type (per-tenant rate table)recipes/currencies-per-tenantIntegration
Email/SMS/in-app delivery notificationsrecipes-delivery-notificationsIntegration
Encrypted tenant config (per-tenant secrets at rest)recipes-encrypted-tenant-configIntegration
Feature toggles (per-tenant on/off)recipes/feature-togglesIntegration
File upload + post-processing (resize, virus scan, etc.)recipes/files-post-processingIntegration
Legal pages (terms, privacy, imprint) with versioned acceptancerecipes-legal-pagesIntegration
Rate limiting per user / IP / endpointrecipes/rate-limitingIntegration
Secrets management (env-var → encrypted DB row)recipes/secrets-demoIntegration
Session revocation (logout-all, force-logout, audit)recipes/session-revocationIntegration
Designer-driven feature (live schema edits via UI)recipes/designer-demo
SampleWhat it shows
apps-ui-walkthroughDefaultAppShell + LanguageSwitcher + ThemeToggle + emailPasswordClient + TenantSwitcher + tasks demo. Includes Playwright E2E.
apps-workspacesWorkspaceShell + persona/role-gated workspaces + cross-feature nav members + server-injected AppSchema.
apps-marketing-demoAsset tracker + helpdesk on one Kumiko instance — internal-tools showcase with translated select options, deterministically seeded.
apps-showcaseGeneric showcase app to exercise the full feature surface in one place.
apps-cap-billing-demoBilling-foundation + cap engine + Stripe + Mollie integration on one app.
apps-user-data-rights-demoDSGVO Art. 15+17+18+20 end-to-end with EXT_USER_DATA hooks.
Terminal window
bun kumiko test # Unit tests (incl. recipes/i18n + recipes/screens-nav)
bun kumiko test integration # Integration tests (all recipes with DB)
bun kumiko test e2e # Playwright E2Es (apps/)
bun kumiko test all # Unit + Integration

bun run build in any app workspace produces deployable artifacts. Requires "scripts": { "build": "kumiko-build" } in the package.json. Convention- driven discovery — kumiko-build builds whatever is present:

ConventionOutputContents
src/client.tsx, public/, index.html, src/styles.cssdist/Client bundle: hashed assets, Tailwind, static files
bin/main.tsdist-server/Server bundle: server.js + kumiko.js + migration-hooks.js (optional) + minimal package.json with native externals

Workspaces without bin/main.ts get only the client; headless apps without a browser get only the server. Both are built in parallel when present.

Server bundle: bundles framework + bundled-features + app source into a ~1 MB JS file. Native externals (argon2, bullmq, postgres, ioredis, temporal-polyfill) stay as prod-deps in a generated dist-server/package.json. Version-pin from the repo’s packages/framework/package.json. For app-specific externals, see buildServerBundle({ extraRuntimeExternals }) in @cosmicdrift/kumiko-dev-server/build.

Container deploy: the canonical pattern is a multi-stage Dockerfile that builds both bundles, with the runtime image only carrying dist/, dist-server/, and migration SQL dirs (drizzle/ legacy or kumiko/migrations/). The dist-server/package.json is filled in the runtime stage via bun install --production (~30 MB node_modules + 100 MB bun-alpine base ≈ 270 MB image). Migrate step in pre-deploy: bun /app/kumiko.js migrate apply runs the bundled kumiko CLI against the DB. The publicstatus.eu deployment uses this exact pattern.

samples/recipes/my-recipe/
package.json ← { "name": "@cosmicdrift/kumiko-sample-my-recipe", "dependencies": { "@cosmicdrift/kumiko-framework": "workspace:*" } }
src/
feature.ts ← defineFeature + entity + handler
__tests__/
feature.integration.ts ← test (or .test.ts for unit tests)

Rule: every new framework feature needs a recipe — or an extension to an existing one.


Source path: samples/README.md