Local development
Prerequisites
Section titled “Prerequisites”- Node.js 20+ and pnpm
- An Anthropic API key
git clone https://github.com/PMDevSolutions/Claudius.gitcd Claudius
# Worker (terminal 1)cd workerpnpm installcp .dev.vars.example .dev.vars # add your ANTHROPIC_API_KEYpnpm dev # http://localhost:8787
# Widget (terminal 2)cd widgetpnpm installpnpm dev # http://localhost:5173Open http://localhost:5173 — the dev app renders the widget pointed at the
local worker. The worker’s CORS allows any http://localhost:* origin during
development, and wrangler provides a local KV store automatically.
Running tests
Section titled “Running tests”cd widgetpnpm test # Unit + integration (Vitest)pnpm test:coverage # Coverage report (80% thresholds)pnpm e2e:install # One-time: download Chromiumpnpm e2e # Playwright end-to-end
cd ../workerpnpm test # API, validation, rate-limit, analytics testsThe E2E suite mocks **/api/chat, so the worker doesn’t need to run during
Playwright tests.
Repository layout
Section titled “Repository layout”| Path | What it is |
|---|---|
widget/ | React widget: components, hooks, locales, embed entry |
worker/ | Cloudflare Worker: Hono routes, chat, rate limiting, analytics |
clients/ | Per-client JSON configs + schema |
scripts/ | pnpm claudius CLI (init, validate, snippet) |
docs/ | This documentation site |
cdn/ | Built embed bundle served via jsDelivr |