From 0733ea25ce818f19a766643ca1882ffa73778722 Mon Sep 17 00:00:00 2001 From: Jonathan Hinkel Date: Wed, 26 Aug 2026 13:28:58 +0200 Subject: [PATCH] Clean up leftover sv-create scaffold, add real README and homepage Removes the default vitest/Playwright demo files and the /demo hub page that only linked to the removed Playwright demo. Replaces the generic sv-create README and "Welcome to SvelteKit" placeholder homepage with content describing this project and linking to the real demos. Co-Authored-By: Claude Sonnet 5 --- README.md | 52 ++++++++----------- src/lib/vitest-examples/Welcome.svelte | 8 --- .../vitest-examples/Welcome.svelte.spec.ts | 15 ------ src/lib/vitest-examples/greet.spec.ts | 8 --- src/lib/vitest-examples/greet.ts | 3 -- src/routes/+page.svelte | 24 ++++++++- src/routes/demo/+page.svelte | 5 -- src/routes/demo/playwright/+page.svelte | 1 - src/routes/demo/playwright/page.svelte.e2e.ts | 6 --- 9 files changed, 44 insertions(+), 78 deletions(-) delete mode 100644 src/lib/vitest-examples/Welcome.svelte delete mode 100644 src/lib/vitest-examples/Welcome.svelte.spec.ts delete mode 100644 src/lib/vitest-examples/greet.spec.ts delete mode 100644 src/lib/vitest-examples/greet.ts delete mode 100644 src/routes/demo/+page.svelte delete mode 100644 src/routes/demo/playwright/+page.svelte delete mode 100644 src/routes/demo/playwright/page.svelte.e2e.ts diff --git a/README.md b/README.md index 0962376..4859a36 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,34 @@ -# sv +# webavatar-core -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). +A base SvelteKit project meant to be branched off for future webavatar client projects. It provides the reusable core infrastructure those projects would otherwise reimplement from scratch — session management, auth tokens, and the realtime model connection — as a foundation to branch from, not a finished product. -## Creating a project +See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full architecture map, and [AGENTS.md](AGENTS.md) for project conventions and structure. `docs/` holds a deep-dive per subsystem. -If you're seeing this, you've probably already done this step. Congrats! - -```sh -# create a new project -npx sv create my-app -``` - -To recreate this project with the same configuration: - -```sh -# recreate this project -npx sv@0.17.0 create --template minimal --types ts --add prettier eslint vitest="usages:component,unit" playwright --install npm webavatar-base -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: +## Getting started ```sh +npm install +cp .env.example .env +# fill in OPENAI_API_KEY and REALTIME_TOKEN_SECRET in .env npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open ``` -## Building +Open [`/demo/realtime`](http://localhost:5173/demo/realtime) for the realtime session reference wiring, or [`/demo/humanoid`](http://localhost:5173/demo/humanoid) for the humanoid avatar-state demo (works offline via `REALTIME_PROVIDER=mock`, no API key needed). -To create a production version of your app: +## Scripts -```sh -npm run build -``` +- `npm run dev` / `npm run build` / `npm run preview` — standard SvelteKit commands. +- `npm run check` — type-check. `npm run lint` / `npm run format` — prettier + eslint. +- `npm run test:unit` — vitest. `npm run test:e2e` — Playwright. +- `npm start` — run the production build via `server.js` (the persistent Node process the realtime WebSocket relay requires — see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)). -You can preview the production build with `npm run preview`. +## Documentation -> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. +| Subsystem | Doc | +| ------------------------------------------------------------- | --------------------------------------------------- | +| Architecture overview and module layering | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | +| Realtime session management | [docs/REALTIME_SESSION.md](docs/REALTIME_SESSION.md) | +| Tool calling (server- and client-executed) | [docs/TOOLS.md](docs/TOOLS.md) | +| Analytics recording | [docs/ANALYTICS.md](docs/ANALYTICS.md) | +| Configuration (env vars, persona) | [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | +| `humanoid` package (avatar-state, animation composition) | [docs/HUMANOID.md](docs/HUMANOID.md) | diff --git a/src/lib/vitest-examples/Welcome.svelte b/src/lib/vitest-examples/Welcome.svelte deleted file mode 100644 index c7b8460..0000000 --- a/src/lib/vitest-examples/Welcome.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - -

{greet(host)}

-

{greet(guest)}

diff --git a/src/lib/vitest-examples/Welcome.svelte.spec.ts b/src/lib/vitest-examples/Welcome.svelte.spec.ts deleted file mode 100644 index e6e648c..0000000 --- a/src/lib/vitest-examples/Welcome.svelte.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { page } from 'vitest/browser'; -import { describe, expect, it } from 'vitest'; -import { render } from 'vitest-browser-svelte'; -import Welcome from './Welcome.svelte'; - -describe('Welcome.svelte', () => { - it('renders greetings for host and guest', async () => { - render(Welcome, { host: 'SvelteKit', guest: 'Vitest' }); - - await expect - .element(page.getByRole('heading', { level: 1 })) - .toHaveTextContent('Hello, SvelteKit!'); - await expect.element(page.getByText('Hello, Vitest!')).toBeInTheDocument(); - }); -}); diff --git a/src/lib/vitest-examples/greet.spec.ts b/src/lib/vitest-examples/greet.spec.ts deleted file mode 100644 index f2d6b12..0000000 --- a/src/lib/vitest-examples/greet.spec.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { describe, it, expect } from 'vitest'; -import { greet } from './greet'; - -describe('greet', () => { - it('returns a greeting', () => { - expect(greet('Svelte')).toBe('Hello, Svelte!'); - }); -}); diff --git a/src/lib/vitest-examples/greet.ts b/src/lib/vitest-examples/greet.ts deleted file mode 100644 index 304b482..0000000 --- a/src/lib/vitest-examples/greet.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function greet(name: string): string { - return 'Hello, ' + name + '!'; -} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cc88df0..5f26324 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,2 +1,22 @@ -

Welcome to SvelteKit

-

Visit svelte.dev/docs/kit to read the documentation

+ + +

webavatar-core

+

+ A base SvelteKit project for webavatar client projects. It provides the reusable + infrastructure those projects would otherwise reimplement from scratch — session management, + auth tokens, and the realtime model connection — as a foundation to branch from, not a finished + product. +

+ +

Demos

+ + +

Docs

+

See docs/ARCHITECTURE.md in the repo for the full architecture map, or the README for getting started.

diff --git a/src/routes/demo/+page.svelte b/src/routes/demo/+page.svelte deleted file mode 100644 index 372e8bc..0000000 --- a/src/routes/demo/+page.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - -playwright diff --git a/src/routes/demo/playwright/+page.svelte b/src/routes/demo/playwright/+page.svelte deleted file mode 100644 index 5f0f2c9..0000000 --- a/src/routes/demo/playwright/+page.svelte +++ /dev/null @@ -1 +0,0 @@ -

Playwright e2e test demo

diff --git a/src/routes/demo/playwright/page.svelte.e2e.ts b/src/routes/demo/playwright/page.svelte.e2e.ts deleted file mode 100644 index 1000be6..0000000 --- a/src/routes/demo/playwright/page.svelte.e2e.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test('has expected h1', async ({ page }) => { - await page.goto('/demo/playwright'); - await expect(page.locator('h1')).toBeVisible(); -});