Skip to content

Quickstart: Seeded Template

The sibling GitHub template repo, local path ../emdash-mika-template, is the fastest source-backed first success path. It is a host Astro app that wires the local Mika package, fixture commerce data, copied storefront files, admin action fields, and agent-readable metadata.

Use this quickstart to see the complete shape before copying files into another app.

Use Node >=22.13.0 for the template. It depends on the sibling Mika package through file:../emdash-mika, so lifecycle scripts rebuild Mika locally before dev, build, preview, typecheck, test, and seed commands.

Terminal window
cd ../emdash-mika-template
npm install
npm run fixture:reset
npm run dev

npm run fixture:reset resets the local template fixture state under .emdash/; run it only when you want the smoke app returned to seeded data. A published template should replace the local Mika path with a released npm version.

Expected state after npm run dev: Astro starts the template app, the local Mika package has been rebuilt by the template lifecycle script, and the storefront paths below resolve from the host app.

After npm run dev starts, open these paths in the template app:

  • / for product listing.
  • /products/mira-field-clipboard for a product page.
  • /products/thirdbase-team-pennants for printable stock-state fixtures.
  • /products/junie-sidewalk-zine-kit for zine-kit stock and cart fixtures.
  • /products/buttonwood-creator-bundle for download, subscription, license, and stock-state fixtures.
  • /?category=creator-tools or /?category=paper-goods&tag=printables for homepage category/tag filters.
  • /cart, /wishlist, /account, and /account/magic-link for customer flows.
  • /checkout/success?checkoutId=checkout_buttonwood_1001 for a seeded checkout return.
  • /download/download_panel_pack_mira for the seeded-repo download fixture; see Template Fixture Route.
  • /llms.txt and /.well-known/mika-agent.json for agent-readable storefront metadata.
  • /_emdash/admin for the EmDash admin UI.
  • /api/mika-action-contract.json for the admin action provider contract.

The seeded repo is not just a copy of ../emdash-mika/src/templates/astro/**. It adds host-app files that prove the integration:

File Purpose
src/pages/products/[slug].astro Host product page that loads fixture product content and renders copied Mika purchase components.
src/lib/mika-api.ts Host API entrypoint that combines fixture storefront overrides with admin/testbed behavior.
src/lib/mika-fixture-storefront.ts Fixture catalog, cart, wishlist, account, checkout, and download behavior for smoke flows.
src/plugins/mika-template-plugin.ts Native plugin entrypoint used when function overrides cannot be serialized through descriptor options.
src/emdash/mika-action-fields.ts EmDash field-button wiring for Mika admin actions.
src/pages/api/mika-action-contract.json.ts Readback endpoint for the admin action provider contract.

Use those files to learn the shape of a host integration. Do not copy testbed fixture behavior into production unless you are intentionally building a fixture app.

The seeded GitHub template repo should pass:

Terminal window
npm run typecheck
npm run test
npm run build

Expected result: all three commands exit successfully.

Next: Install shows how to wire Mika into a separate Astro + EmDash app. First Product Page explains the same boundary in the smallest manual host route.

  • ../emdash-mika-template/README.md
  • ../emdash-mika-template/package.json
  • ../emdash-mika-template/docs/testbed.md
  • ../emdash-mika-template/docs/usage.md
  • ../emdash-mika-template/src/pages/index.astro
  • ../emdash-mika-template/src/pages/products/[slug].astro
  • ../emdash-mika-template/src/lib/mika-api.ts
  • ../emdash-mika-template/src/lib/mika-fixture-storefront.ts
  • ../emdash-mika-template/src/plugins/mika-template-plugin.ts
  • ../emdash-mika-template/src/emdash/mika-action-fields.ts
  • ../emdash-mika-template/src/pages/api/mika-action-contract.json.ts