---
title: "Templates & examples"
description: "Create an app from the starter, Panels (the tutorial's app and the public demo) or the advanced example with create nuxt, run the starter in StackBlitz, and try unreleased builds from pkg.pr.new."
canonical_url: "https://nuxt-backend.dev/docs/start/templates"
---
# Templates & examples

> Create an app from the starter, Panels (the tutorial's app and the public demo) or the advanced example with create nuxt, run the starter in StackBlitz, and try unreleased builds from pkg.pr.new.

Version: nuxt-backend 0.6.x · Tab: Start · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

Create a ready-made app with Nuxt's own `create nuxt` command. Each one is a standalone app of the published package, with plain version ranges and no lockfile, so what you get is exactly what installs from npm. All of them run against a Convex deployment of your own.

## Starter

The app to build on: a Nuxt app with the module installed and nothing else. Every file in `backend/` is byte-identical to what `npx nuxt-backend init` generates, and with zero custom backend code it has:

- passwordless sign-in (`<AuthForm>`, passkeys and sign-in codes);
- workspaces with emailed invitations (the module registers the `/accept-invitation` page);
- transactional, delivery-tracked email (sign-in codes, invitations, gift notifications);
- subscriptions, feature gating, prepaid credits and gifts, once `billing sync` creates the catalog.

```bash
npm create nuxt@latest my-app -- -t gh:qruto/nuxt-backend/templates/starter
```

`create nuxt` downloads the template, installs it with the package manager you pick, and offers to add more Nuxt modules. Then start it:

```bash
npm run dev
```

The first run sets up a Convex dev deployment (log in when asked, or start without an account), provisions its env, then runs Convex and Nuxt together. The `dev` script is [`nuxt-backend dev`](https://nuxt-backend.dev/docs/reference/cli#dev). Follow the [Quickstart](https://nuxt-backend.dev/docs/start/quickstart#sign-in-with-the-code-in-the-terminal) from the sign-in step: the code prints in the same terminal until you connect an email provider. The scaffolded `billing.catalog.ts` declares two plans and two credit packs, and `npx nuxt-backend billing sync` creates them in Polar's sandbox, as the Quickstart's [second checkpoint](https://nuxt-backend.dev/docs/start/quickstart#checkpoint-2-credits-bought-and-spent) shows.

`backend/_generated` is not part of the template: `npm run dev` writes it against the installed package on the first run, and until then `#backend/*` imports are typed `any`. With pnpm, the template's `.pnpmfile.mjs` answers the build-script question (none of its dependencies needs its script, so none runs) and hoists the component definitions Convex bundles, the same settings [Installation](https://nuxt-backend.dev/docs/start/installation#using-strict-pnpm) gives strict-pnpm users. [View the source](https://github.com/qruto/nuxt-backend/tree/main/templates/starter).

## Panels

Panels is the app the [tutorial](https://nuxt-backend.dev/docs/start/tutorial) builds: a comic-strip maker where people sign in with a code or a passkey, buy credits, add a photo, and turn an idea into a three-panel strip a model draws. They hear when it is ready, by email and in the app, and share it by a link. It is built only on the package's public APIs, and it is the code the [public demo](https://nuxt-backend.dev/docs/start/playground) runs in sandbox mode. Create it to read a finished app, or to run the demo on your own accounts:

```bash
npm create nuxt@latest my-panels -- -t gh:qruto/nuxt-backend/templates/panels
```

The `gh:` form downloads the template from the repository. Then start it on a local deployment, with no Convex account:

```bash
cd my-panels
npx nuxt-backend dev --anonymous
```

Open `/login` and sign in: the code prints in the terminal until you connect an email provider. Each feature then waits for its service: credits for a Polar sandbox token and `npx nuxt-backend billing sync`, the strip-ready email for a Resend key and `npx nuxt-backend email sync`, drawing for the [AI gateway](https://nuxt-backend.dev/docs/services/ai-gateway). The [Service map](https://nuxt-backend.dev/docs/services) connects them in order, and `npx nuxt-backend doctor` says what is still missing. Billing runs on Polar until `BILLING_PROVIDER` names [Stripe, Dodo or Creem](https://nuxt-backend.dev/docs/services/merchants): put that provider's product ids in `backend/billing.products.ts`, and the same plans, packs and credits sell there. The template's README maps each file to the tutorial part that writes it. [View the source](https://github.com/qruto/nuxt-backend/tree/main/templates/panels).

## Example: advanced

Every customization point at once, created the same way:

```bash
npm create nuxt@latest my-app -- -t gh:qruto/nuxt-backend/examples/advanced
```

Start from the starter; each file in `advanced` changes exactly one thing from it:

<table>
<thead>
  <tr>
    <th>
      Customization
    </th>
    
    <th>
      Where
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      A customized app definition: the <code>
        backendEnv
      </code>
      
       contract extended by an extra env var
    </td>
    
    <td>
      <code>
        backend/convex.config.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/build/email/templates">
        Custom email templates
      </a>
      
       (the sign-in code, the invitation and the <a href="https://nuxt-backend.dev/docs/build/growth/offers/gifts">
        gift
      </a>
      
      ) without replacing the transport
    </td>
    
    <td>
      <code>
        backend/email.ts
      </code>
      
       → <code>
        templates
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      A custom invitation path: emails link to <code>
        /join
      </code>
      
      , where the app's own page replaces the built-in one
    </td>
    
    <td>
      <code>
        nuxt.config.ts
      </code>
      
       (<code>
        pages: { acceptInvitation: '/join' }
      </code>
      
      , carried to <code>
        backend/paths.generated.ts
      </code>
      
      ), <code>
        app/pages/join.vue
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Explicit billing config instead of env-var defaults
    </td>
    
    <td>
      <code>
        backend/billing.ts
      </code>
      
       (<code>
        accessToken
      </code>
      
      , <code>
        webhookSecret
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      A billing webhook hook: <code>
        order.paid
      </code>
      
       writes to an app table, after the built-in refresh and gift fulfilment
    </td>
    
    <td>
      <code>
        backend/billing.ts
      </code>
      
       (<code>
        events
      </code>
      
      ) + <code>
        backend/schema.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Custom <a href="https://nuxt-backend.dev/docs/ship/security/webhooks#custom-paths">
        webhook paths
      </a>
      
       (<code>
        /hooks/billing
      </code>
      
      , <code>
        /hooks/email
      </code>
      
      )
    </td>
    
    <td>
      <code>
        backend/http.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      A hand-rolled signup workflow: <code>
        workflow.define
      </code>
      
       calls the component's email module directly, instead of <code>
        defineEmailSequence
      </code>
    </td>
    
    <td>
      <code>
        backend/workflows.ts
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Gift claiming: <code>
        useGifts()
      </code>
      
      , with the claim notice in <code>
        <BackendNotices>
      </code>
    </td>
    
    <td>
      <code>
        app/pages/app/index.vue
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      The packaged pages, components and emails in French: <a href="https://nuxt-backend.dev/docs/build/ui/customize/translation">
        <code>
          @nuxtjs/i18n
        </code>
      </a>
      
       with an <code>
        fr
      </code>
      
       locale whose <code>
        backend.*
      </code>
      
       messages translate the package's labels, and <code>
        setupEmail({ messages: { fr }, localePaths })
      </code>
      
       so an account whose language is French gets the packaged emails in French, linking to the <code>
        /fr/
      </code>
      
       pages (the three custom templates above are written in English only)
    </td>
    
    <td>
      <code>
        nuxt.config.ts
      </code>
      
       (<code>
        i18n
      </code>
      
      ), <code>
        i18n/locales/fr.json
      </code>
      
      , <code>
        backend/email.ts
      </code>
      
      , <code>
        app/app.vue
      </code>
      
      , <code>
        app/pages/login.vue
      </code>
    </td>
  </tr>
</tbody>
</table>

```ts [examples/advanced/nuxt.config.ts]
export default defineNuxtConfig({
  // CUSTOMIZATION: @nuxtjs/i18n translates the packaged pages and components.
  // i18n/locales/fr.json holds their `backend.*` messages; nuxt-backend
  // registers its English ones for `en` itself.
  modules: ['@nuxtjs/i18n', 'nuxt-backend'],
  devtools: { enabled: true },
  css: ['~/assets/main.css'],
  compatibilityDate: '2026-10-14',
  telemetry: false,
  backend: {
    // CUSTOMIZATION: the invitation page lives at /join, the one place the
    // path is written: the module carries it to backend/paths.generated.ts,
    // which invitation emails link from. The app's own page there
    // (app/pages/join.vue) replaces the built-in one.
    pages: { acceptInvitation: '/join' },
  },
  i18n: {
    defaultLocale: 'en',
    strategy: 'prefix_except_default',
    locales: [
      { code: 'en', language: 'en-US', file: 'en.json', name: 'English' },
      { code: 'fr', language: 'fr-FR', file: 'fr.json', name: 'Français' },
    ],
  },
})
```

[View the source](https://github.com/qruto/nuxt-backend/tree/main/examples/advanced).

## Example: Convex auth

[Convex Auth mode](https://nuxt-backend.dev/docs/build/auth/convex-auth) in a whole app: sign-in with a username and a password through `@convex-dev/auth`, sessions in httpOnly cookies, and an `/account` page the `convex-auth` middleware guards.

```bash
npm create nuxt@latest my-app -- -t gh:qruto/nuxt-backend/examples/convex-auth
```

The mode is sign-in only, so the package's pages, workspaces, billing and AI credits are off in it; the other templates have them. [View the source](https://github.com/qruto/nuxt-backend/tree/main/examples/convex-auth).

## Run it in the browser

Open the starter in StackBlitz. The sandbox runs `npm run dev`, which asks you to log in to Convex in its terminal (a device flow) and sets up a dev deployment of your own:

[stackblitz.com/github/qruto/nuxt-backend/tree/main/templates/starter](https://stackblitz.com/github/qruto/nuxt-backend/tree/main/templates/starter)

## Preview builds (pkg.pr.new)

Every pull request and every commit on `main` publishes a preview of the package through [pkg.pr.new](https://pkg.pr.new), so a fix can be tried before it is released:

```bash
# a specific PR
npm install https://pkg.pr.new/qruto/nuxt-backend@<pr-number>
# a specific commit
npm install https://pkg.pr.new/qruto/nuxt-backend@<commit-sha>
```

The install URL is posted by the pkg.pr.new bot on each PR, next to an **Open in StackBlitz** link that runs the starter with that build wired in. Preview builds carry the exact `exports` map of the release they precede, so the [import tree](https://nuxt-backend.dev/docs/reference/entrypoints) is the same.

## Related

- [Quickstart](https://nuxt-backend.dev/docs/start/quickstart): the starter, from create to credits spent.
- [Build a creative app](https://nuxt-backend.dev/docs/start/tutorial): Panels, built part by part.
- [Try the demo](https://nuxt-backend.dev/docs/start/playground): Panels running live on this site, in sandbox mode.
- [Try everything](https://nuxt-backend.dev/docs/start/playground/try-everything): the whole playground on your machine, with seeded personas.
- [Feature map](https://nuxt-backend.dev/docs/start/feature-map): every feature the module brings to a template, capability by capability.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
