Skip to content

Get started

Updating from the kit

The kit lives in layers/kit/ and your app lives around it. Your app keeps the kit as a second git remote named template and takes each kit update as one commit on a branch you review. Nothing is installed, and your main shares none of the kit's history. You need this page when you create the app and each time you take an update.

How it works

  1. .template-base, at your app's root, records the kit commit your app is at. The update writes it; the kit never ships it.
  2. pnpm kit:update fetches the template remote and takes everything the kit changed between that commit and the target: the kit's main, or a tag you name.
  3. It replaces layers/kit/ with the kit's folder at the target, and applies the kit's changes to the files at your root with git cherry-pick. Both land as one commit, together with the new .template-base. The commit is titled chore(template): update to <tag or commit>, and its body lists the subject of every kit commit it brings.
  4. layers/kit/ never conflicts: nothing in it is merged. Where you and the kit changed the same lines of a file at the root, the update stops with conflict markers, like any cherry-pick.

The first update has no .template-base to read. It looks for the kit commit whose files are identical to your app's first commit, so that first commit has to be the unchanged kit.

Create your app

Click "Use this template" on the kit repository, nuxter-app/kit, clone your new repository and add the remote once:

git remote add template https://github.com/nuxter-app/kit.git

To host the repository anywhere else, clone the kit and drop its history:

git clone https://github.com/nuxter-app/kit.git my-app
cd my-app
git update-ref -d HEAD
git commit -m "chore: start from the template"
git branch --unset-upstream
git remote rename origin template
git remote add origin <your repository>

git update-ref -d HEAD removes the kit's history and leaves its files staged exactly as the kit has them, so your first commit is the kit byte for byte.

To start the app in a folder of a repository that already exists, such as a monorepo, see Apps in a subfolder.

Whichever way you start, make your own changes in the commits after the first.

Take an update

git switch -c kit-update-$(date +%Y%m%d)
pnpm kit:update

The working tree must be clean; the script refuses while tracked files have uncommitted changes, or while a merge, cherry-pick or revert is in progress, and names the commands that finish or abandon it. When it finishes, push the branch and open a pull request. Squash-merge it to keep main linear. For an app that is the whole repository, the kit-update workflow can do all of this every day and leave you the pull request (Automatic updates).

CommandWhat it does
pnpm kit:updateTakes the kit's main.
pnpm kit:update v1.4.0Takes that tag. A branch name or a commit from the kit works too.
pnpm kit:update --no-commitStages the update without committing, so you can read the whole diff first.
pnpm kit:update --base <tag or commit>Treats that kit commit as the one your app is at, in place of .template-base.
pnpm kit:update --forceDiscards your changes inside layers/kit/ instead of refusing them.

Use --base when the script can't work out where your app started: when your first commit wasn't an unchanged copy of the kit, or when .template-base names a commit the remote doesn't have. Both errors say so.

If your app is already at the target, or already has every change since the commit --base names, the script prints Already at the template's <commit>. and changes nothing.

Once .template-base exists, this shows what the next update brings:

git fetch template
git log "$(cat .template-base)"..template/main

A changed layers/kit/ is refused

Before it changes anything, the update compares layers/kit/ with the kit commit in .template-base. If you changed a file there, it names every one that differs and stops, because replacing the folder would lose those changes. Move each change into a file of yours at the same path outside layers/kit/ (Your files and the kit's), commit, and run the update again. --force discards the changes instead.

Your replacements the update changed

A file of yours at the path of a kit file replaces it, and keeps only what the kit's file had on the day you made your copy. After an update, the script lists each such file of yours whose kit original the update changed, with the command that shows the kit's change. It finds them by path alone: a component or auto-import of yours that replaces the kit's by name from another file, such as app/components/AuthCard.vue for the kit's app/components/auth/Card.vue, is never listed.

These files of yours replace kit files this update changed. Compare each with the kit's change:

  app/pages/auth/login.vue   git diff c3de373efe91 826d350cc2e7 -- ':(top,literal)layers/kit/app/pages/auth/login.vue'

The command runs from any folder of the repository, the app's own in a monorepo included; its quotes keep the shell from reading the brackets in a route file's name as a pattern.

The update never touches your file. Read the kit's change and carry over what your copy should have, a security fix above all. nuxt.config.ts, app/app.config.ts, drizzle.config.ts, server/database/schema.ts and server/database/migrations/ are never listed: they sit beside the kit's rather than replacing them.

Resolve conflicts

A conflicted update lists the paths and exits with status 1:

Template 3f2a9c1d0b7e..8e41d5a2c6f0 applied with conflicts in:

  starter.config.ts
  wrangler.jsonc

Resolve each one: `git add` keeps your resolution, `git rm` keeps a file deleted.
Then `git cherry-pick --continue`. To back out entirely: `git cherry-pick --abort`.

Fix the markers in each file and git add it. A file you deleted that the kit changed shows as a modify/delete conflict; git rm <path> keeps it deleted. Then finish:

git cherry-pick --continue

git cherry-pick --abort puts everything back as it was. After --no-commit there is no cherry-pick to continue: resolve, then git commit, or back out with git reset --merge.

If an update is too much to resolve at once, abort it and take one release at a time by passing each tag in turn.

Dependency conflicts

Both sides change package.json, and the kit's lockfile moves with every dependency refresh. Keep both sides' entries in package.json, then rebuild the lockfile instead of merging it by hand:

git checkout --theirs pnpm-lock.yaml
pnpm install
git add package.json pnpm-lock.yaml

During the update, --theirs is the kit's side. pnpm install resolves the merged package.json against the kit's lockfile and adds your packages back.

Where both sides set the same package, keep the higher range, vue above all: Nuxt needs a minimum Vue, and a lower vue of yours leaves two copies installed, between which reactivity does not cross. A <NuxtLink> then stops following a to that changes.

patchedDependencies in pnpm-workspace.yaml patches a package at one exact version, such as nitropack@2.13.6, and pnpm refuses a patch it cannot apply. When a change of yours moves the package past it, such as a newer Nuxt, and pnpm install stops with ERR_PNPM_UNUSED_PATCH, delete the entry and its file in patches/.

What conflicts, and what does not

layers/kit/ is replaced, never merged, so a conflict can only come from a file at your root that the kit also changes. Most of those are yours alone.

The kit has two halves, and they follow different rules:

  • The front end is yours to change. The kit's pages, components, composables, layouts and mail templates are a starting point, not a library. Change markup, design, copy and flow wherever the product needs it, the kit's dashboard and its sign-in and account pages included, by putting your own file at the same path at your root. Each update names the ones whose kit original changed.
  • The back end is the kit's to evolve. layers/kit/server/, layers/kit/shared/, layers/kit/build/, layers/kit/modules/ and the kit's tables are where updates land, security fixes included. Extend them through events, listeners, jobs, tasks and adapters. When the seam you need doesn't exist, ask for it in the kit rather than patching around it in your app.

Yours

The kit never writes these, or ships them once and never again:

  • app/, server/, shared/, emails/, i18n/, test/ and scripts/ at your root. A file there at the path of a kit file replaces it where Your files and the kit's lists its kind; any other is new. The kit ships an empty app/app.config.ts, an empty server/database/schema.ts and an empty test/helpers/schema-cascades.ts. Keep app/ itself: without it Nuxt reads your root as its source folder, and the build refuses that.
  • nuxt.config.ts, which the kit ships empty. Nuxt merges it over the kit's.
  • drizzle.config.ts and server/database/migrations/, your tables' chain (Database).
  • content/ and public/. The kit ships the sample post, the legal drafts, favicon.svg and the post's cover, and still rewords them now and then: a file you changed conflicts when it does.
  • .template-base.

Shared

These conflict on purpose. starter.config.ts gains a key when the kit adds an option, and you choose its value. blog.config.mjs holds your blog pipeline settings and gains the kit's new options and models. wrangler.jsonc holds your Worker's name, bindings and crons, and gains a binding when a kit feature needs one. package.json and pnpm-lock.yaml carry both sides' dependencies.

The kit's

layers/kit/, whole: every update replaces it, and refuses to run over a change of yours. At your root, the kit also owns README.md, TEMPLATE.md, AGENTS.md, CHANGELOG.md, LICENSE, THIRD_PARTY_NOTICES.md, CLAUDE.md, .claude/, .cursor/, .mcp.json, .vscode/mcp.json, .github/, .env.example, tsconfig.json and the other dotfiles. You can edit any of these, and each edit conflicts the next time the kit changes the same lines.

The kit's six tasks run on schedule.cleanup. Yours, in server/tasks/, run on the crons schedule.tasks gives them, each listed in triggers.crons in wrangler.jsonc too. A schedule set anywhere but starter.config.ts fails the build (Background jobs). The kit's Playwright specs skip the features and languages your app turned off and, once .template-base exists, the sample content it removed, so they need no edit to pass on it.

Two habits keep updates small:

  • Change the back end's behaviour through starter.config.ts before you replace a kit file.
  • Wrap what you only surround, and replace what you redesign. A wrapper renders the kit's own file through #layers/kit/ and keeps taking its fixes; a replacement is yours from then on.

Migrations

Your tables go in server/database/schema.ts, and pnpm db:generate writes their migrations to server/database/migrations/. The kit's schema and migrations live in layers/kit/server/database/, so an update brings new kit migrations without a conflict, and pnpm db:migrate applies them. Prefix your table names and their exports with your app's own, such as acme_menus and acmeMenus. Your tables share Postgres's public schema and tables with the kit's, which are unprefixed, and an update that adds a table under a name you use fails layers/kit/test/unit/migration-freshness.test.ts(Licensees only) until you ship a rename of your own. Extend a kit table with a table of your own keyed by its id, never with a column: the kit's schema is inside layers/kit/. A kit migration that renames or drops a column comes in a major release, and the changelog names it. The two migration chains are covered on Database.

Apps in a subfolder

Several apps can each start from the kit in a folder of their own:

git remote add template https://github.com/nuxter-app/kit.git
git fetch template
git read-tree --prefix=apps/web/ -u template/main
git commit -m "feat(web): start from the template"

git read-tree --prefix stages the kit's files under the folder unchanged, so the commit that adds the folder is the unmodified kit. The first update matches against the folder as that commit left it.

Run the update from the app's folder. It writes apps/web/.template-base, changes nothing outside the folder, and titles the commit chore(template): update apps/web to <tag or commit>, moving part of that into the body when the title would run long. In a pnpm workspace, run it from the workspace root:

pnpm --filter ./apps/web kit:update

Or run node layers/kit/scripts/template/update.mjs inside the folder. The kit ships its own pnpm-workspace.yaml, so pnpm kit:update run inside the folder treats it as a separate workspace and reinstalls against the folder's pnpm-lock.yaml first. The update then stops on the files that install changed.

GitHub runs workflows only from the repository root, so the app's .github/ comes along and never runs. Copy the workflows you want to the root, except kit-update, which serves only an app that is the whole repository: an app in a folder takes updates with pnpm kit:update. Commit hooks install only at the root too: in a folder, pnpm install reports .git can't be found and skips them.

Releases

With no argument the update takes the kit's main, which is always deployable. Tags mark releases:

pnpm kit:update v1.4.0

You can move from tags to main at any time. Moving from main to tags waits for the next tag, because a tag older than the commit in .template-base is refused: taking it would revert kit changes you already have.

The version number says how much the update asks of you:

  • Major: you need to act. A renamed variable or config key, a moved or removed kit name, a migration to read before you deploy, or a change likely to conflict with your files.
  • Minor: something new that applies without your help.
  • Patch: fixes only.

CHANGELOG.md lists every release, and each entry opens with what to do before you take it. The tags are the kit's only version numbers: its package.json has no version field.

Apps from before the layer

An app started before the kit moved into layers/kit/ has the kit's files at its root. Take the update that moves it with the kit's new updater, once, not with its own pnpm template:update: the old one follows the kit's files into layers/kit/ and carries your edits there, where every later update refuses them.

git fetch template
updater="$(mktemp -d)"
git archive template/main layers/kit/scripts | tar -x -C "$updater"
node "$updater/layers/kit/scripts/template/update.mjs"

Pass a tag after it to take a release instead of main. Every kit file you never changed moves into layers/kit/ without a conflict. One you changed stops as a modify/delete conflict at its old path. git add keeps yours as a replacement of the kit's only where Your files and the kit's lists its kind, such as a page, component, composable, server route, job or mail template. Anywhere else, server/utils/, plugins, server middleware, modules/, shared/, build/ and scripts/ among them, a kept copy is ignored for the kit's, runs beside it, or fails the build by exporting a name the kit's helpers auto-import: git rm it, which takes the kit's, and carry your change through starter.config.ts or a seam. Your own files stay where they are. CHANGELOG.md lists what else that release asks of you, the imports to change among it. From then on the command is pnpm kit:update.

Good to know

  • The remote must be named template. The script looks it up by that name and stops if it is missing.
  • A file you unstage after --no-commit is declined for good. The staged .template-base already names the target, so the next update starts past it. To take it later, pass the commit .template-base named before that update as --base. git log -p -- .template-base shows it, and the files you already took apply as no-ops. A file you unstage inside layers/kit/ makes the next update refuse to start until you pass --force.
  • A folder renamed only by letter case confuses the script. Give the folder on disk the name the last commit has, then run it again.
  • Keep the kit's LICENSE, under any name, in every repository that holds the kit. Your own license can sit beside it.

A link with a lock opens the kit’s private repository, which every licensee can read.