Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c86def6
feat(nuxt): add the nuxt kit, with its vue components in packages/ui-vue
entity Nov 27, 2026
b31086a
test(e2e): run the browser tests against the nuxt kit too
entity Nov 27, 2026
3e37016
feat(export): export the nuxt kit as keyringphp/starter-nuxt
entity Nov 27, 2026
b03e421
ci: check the nuxt kit, run the browser tests against it and export it
entity Nov 27, 2026
ae99096
docs: add the nuxt kit's readme, and list it beside the other kits
entity Nov 27, 2026
8c8d3d6
fix(nuxt): write nuxt's types before linting, so a fresh install's ch…
entity Nov 27, 2026
3c27feb
fix(nuxt): write nuxt's types before the tests, so a fresh checkout's…
entity Nov 27, 2026
a3dcd6b
chore: drop the committed vitest cache and ignore node_modules at any…
entity Nov 27, 2026
1691511
fix(nuxt): show the error page when a page fails to load in the brows…
entity Nov 27, 2026
dcaf7b5
fix(ui-vue): leave the focus where it is when hydrating while another…
entity Nov 27, 2026
5442c5c
fix(nuxt): require the production settings and listen on localhost in…
entity Nov 27, 2026
3b83724
fix(nuxt): send the security headers and no-store with redirects and …
entity Nov 27, 2026
5199aa4
test(nuxt): check the built server's headers, and give the emailed li…
entity Nov 27, 2026
a19c363
fix(ui-vue): typecheck against the nuxt kit's keyring through a name …
entity Nov 27, 2026
0b847e7
fix(nuxt): load the page again when a link goes to the page that's open
entity Nov 27, 2026
ff0e71a
test(nuxt): cover the typed-before-hydration plugin and hydrating(), …
entity Nov 27, 2026
8835850
fix(nuxt): send each server-side read the cookies laravel set on the …
entity Nov 27, 2026
9a54c18
fix(tanstack): send each server-side read the cookies laravel set on …
entity Nov 27, 2026
d86d0dd
test(nuxt): leave the built server's test promises to node's runner, …
entity Nov 27, 2026
07a4929
docs(nuxt): point the sidebar's docs link at keyringphp.com
entity Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/kits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,24 @@ jobs:
npm test -w kits/tanstack-start
npm run types:check -w kits/tanstack-start
npm run build -w kits/tanstack-start
# Its tests run packages/ui-vue's too, and its typecheck the
# shared components it imports; vue-tsc checks the rest.
# test:build builds it, then checks what the built server sends.
- name: Nuxt kit
run: |
npm test -w kits/nuxt
npm run types:check -w kits/nuxt
npx vue-tsc --noEmit -p packages/ui-vue
npm run test:build -w kits/nuxt
- run: composer ci:check

# The Playwright suite (tests/e2e), screenshots included, against each
# kit: the Inertia app Laravel serves, and the TanStack kit with Laravel
# headless behind its proxy. Both compare against the same screenshots,
# made in this same image (the README's "Screenshots"), so the browser,
# its fonts and its libraries render them pixel for pixel. Its version is
# the @playwright/test in package-lock.json.
# kit: the Inertia app Laravel serves, and the TanStack and Nuxt kits
# with Laravel headless behind their proxies. All of them compare
# against the same screenshots, made in this same image (the README's
# "Screenshots"), so the browser, its fonts and its libraries render them
# pixel for pixel. Its version is the @playwright/test in
# package-lock.json.
browser:
name: Browser tests (${{ matrix.kit }})
runs-on: ubuntu-latest
Expand All @@ -107,7 +117,7 @@ jobs:
strategy:
fail-fast: false
matrix:
kit: [inertia-react, tanstack-start]
kit: [inertia-react, tanstack-start, nuxt]
env:
E2E_KIT: ${{ matrix.kit }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/.phpunit.cache
/bootstrap/ssr
/node_modules
node_modules/
/public/build
/public/fonts-manifest.dev.json
/public/hot
Expand Down
41 changes: 25 additions & 16 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/headless-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The same Laravel app serves two kinds of starter kit:

- `inertia-react`: the React app in `resources/js`, which Laravel serves. This is the default.
- Headless kits, such as a TanStack Start or Nuxt app: a frontend Laravel doesn't serve, calling Laravel with `fetch` and the browser's session cookie.
- Headless kits, the TanStack Start kit and the Nuxt kit: a frontend Laravel doesn't serve, calling Laravel with `fetch` and the browser's session cookie.

This page is what the headless kits are built from: how to switch the backend over, how to call it, and every endpoint with its JSON. Keyring's own guide to this setup is [Headless Frontends](https://github.com/keyringphp/keyring/blob/main/docs/headless.md). Read its [One Origin](https://github.com/keyringphp/keyring/blob/main/docs/headless.md#one-origin), [Pages as JSON](https://github.com/keyringphp/keyring/blob/main/docs/headless.md#pages-as-json) and [Where Each Answer Goes](https://github.com/keyringphp/keyring/blob/main/docs/headless.md#where-each-answer-goes) sections alongside this one.

Expand Down Expand Up @@ -48,7 +48,7 @@ The headless kits use Keyring's "one origin" layout. The frontend's server is th
| `https://example.com/backend/api/me` | Laravel, `/api/me` |
| `https://example.com/.well-known/passkey-endpoints` | Laravel, `/.well-known/passkey-endpoints` |

The proxy strips `/backend` and sets `X-Forwarded-For` (the address it saw, never one the browser sent), `X-Forwarded-Host` (the browser's `Host`, port included, such as `localhost:3000`), `X-Forwarded-Proto` and `X-Forwarded-Prefix: /backend`. Laravel believes those four from the proxy and nothing else: `X-Forwarded-Port` is ignored, so a frontend on a port other than 80 or 443 needs the port in `X-Forwarded-Host`, or the URLs in Keyring's answers leave it out. Keyring's guide has a Nitro example. Never pass the frontend's own paths, such as `/login` or `/reset-password/{token}`, on to Laravel: in headless mode Laravel answers a page visit with a `404`.
The proxy strips `/backend` and sets `X-Forwarded-For` (the address it saw, never one the browser sent), `X-Forwarded-Host` (the browser's `Host`, port included, such as `localhost:3000`), `X-Forwarded-Proto` and `X-Forwarded-Prefix: /backend`. Laravel believes those four from the proxy and nothing else: `X-Forwarded-Port` is ignored, so a frontend on a port other than 80 or 443 needs the port in `X-Forwarded-Host`, or the URLs in Keyring's answers leave it out. Keyring's guide has a Nitro example. h3's `proxyRequest()` passes on every header the browser sent, its own `X-Forwarded-For` included, so drop those before setting the four, as the kits' proxies do. Never pass the frontend's own paths, such as `/login` or `/reset-password/{token}`, on to Laravel: in headless mode Laravel answers a page visit with a `404`.

One path outside `/backend` goes to Laravel too: `/.well-known/passkey-endpoints`, where password managers look up the page for adding and managing passkeys. Pass it on as it is, without stripping or adding anything. Laravel answers it with the frontend's security page, `{FRONTEND_URL}/settings/security`. It's a well-known URL, so it stays at the origin's root even when the frontend is [under a path](#a-frontend-under-a-path).

Expand Down
2 changes: 2 additions & 0 deletions kits/inertia-react/kit.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
"package": {
"scripts": {
"dev:tanstack": null,
"dev:nuxt": null,
"test:browser:tanstack": null,
"test:browser:nuxt": null,
"test:browser:screenshots": null,
"test:browser": null,
"test:browser:octane": null,
Expand Down
7 changes: 7 additions & 0 deletions kits/nuxt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/node_modules
/.nuxt
/.output
/.data
/.nitro
/.cache
.env
Loading
Loading