Skip to content

Templates

create-dashild ships three starters:

  • basic: no extra files. The dashboard shows the empty state; with the default --auth better-auth you also get the login, signup, and reset pages.
  • blog: posts, categories, tags, comments, and an editorial workflow. Authors only see their own posts; admins moderate everything (ana@blog.test admin, bruno@blog.test / carla@blog.test authors; password dashild123).
  • demo: users, posts, and labels, with permissive demo policies and a seed (ana@acme.test / dashild123).
  • shop: catalog, stock, suppliers, customers, orders, and order items. Any signed-in staff member manages it (ana@shop.test / dashild123).
  • saas: organizations, members, and projects, isolated by tenant. It enables tenancy for you (ana@acme.test is an admin, carla@beta.test a member of another organization; password dashild123).
Terminal window
pnpm create dashild@latest my-app --template demo

Here, --template demo chooses the seeded demo starter, my-app names the new folder, and pnpm create runs the published generator. Omitting --template lets the generator ask which starter to use.

A starter can also be a local folder or come from GitHub:

Terminal window
npx create-dashild@latest my-app --template ./starters/crm
npx create-dashild@latest my-app --template local:../starters/crm
npx create-dashild@latest my-app --template github:acme/dashild-crm#main

npm templates are not supported in the current alpha. The --template value is a local path (./..., an absolute path, or local:<path>) or a github: spec.

A template is a folder with template.json and project files:

{
"name": "crm",
"version": "1.0.0",
"dashild": ">=0.1.0-alpha.15",
"prisma": { "provider": ["postgresql"] },
"requires": { "auth": ["better-auth"] },
"extend": { "User": ["role Role @default(USER)"] },
"env": ["STRIPE_SECRET"]
}
Field Purpose
name, version Identity recorded in dashild.json.
dashild Supported Dashild semver range.
prisma.provider Allowed database providers.
requires.auth Required auth integration (array).
requires.tenancy true needs --tenancy; false forbids it.
overwrite Generated files this starter replaces on purpose (under src/).
extend Extra Prisma fields for an existing model.
dependencies, devDependencies Extra app dependencies.
env Env keys appended to .env.example when missing.
  • prisma/models.prisma is appended to the schema inside a marker block. If the same template is applied again, the command fails with “already applied” instead of duplicating models. The marker detects the reapplication; it does not make it idempotent.
  • extend adds fields to models that already exist (for example User). Fields that are already present are skipped silently.
  • A model or enum whose name already exists in the schema is a hard error.
  • src/dashild/resources/*.ts are copied and registered in panel.ts.
  • src/dashild/policies.ts replaces the default policies, and files listed in overwrite replace the generated glue (blog uses it for session.ts and actions/index.ts).
  • prisma/seed.ts runs only when the install and migration steps succeeded; with --seed but no migration it stays pending.
  • env keys are appended to .env.example with an empty value; values are yours to fill in.

Templates run after the Better Auth models are created, so a template can extend User safely.

dashild.json records the chosen template, auth, database, route, and creation date. It does not store the installed package versions.

create-dashild pins @dashild/* in the generated package.json to the stack version it ships with (the dashildPackages field of its own manifest). The scaffolder can move ahead of the stack for its own fixes; the generated app keeps the published packages it was tested with.

A template’s dependencies are merged after that pinning, so a template can override @dashild/* and break the guarantee. Do not declare @dashild/* packages in a template.

create-dashild is published with both latest and alpha; the docs use pnpm create dashild@latest.