SvelteKit 5 + Svelte 5 Runes — offline-first, RPG-style productivity / habit tracker with Claude-generated quests, deployed to Cloudflare Pages.
Route transitions through onboarding → quests → stats → shadows → achievements → journal
Stat-based progression (STR, INT, DEX, VIT, WIS, CHA), levels and ranks, achievements, pillar mastery, and AI-generated daily quests. All mutations are written to IndexedDB first; a background sync queue ships them to a remote PocketBase instance when online.
| Layer | Choice |
|---|---|
| Framework | SvelteKit 2 + Svelte 5 (Runes) |
| Styling | Tailwind CSS 4 |
| Local DB | Dexie (IndexedDB), offline-first |
| Remote DB | PocketBase (self-hosted, binary in pb/) |
| AI | Anthropic Claude (server-only proxy, @anthropic-ai/sdk) |
| Validation | Zod + zod-to-json-schema for AI tool_use contracts |
| Motion | GSAP (level-up / rank-up cinematics) |
| PWA | Workbox service worker, background sync |
| Deploy | Cloudflare Pages (@sveltejs/adapter-cloudflare) |
git clone https://github.com/ReqiDions/woo-app.git
cd woo-app
npm install
cp .env.example .env # fill in ANTHROPIC_API_KEY + POCKETBASE_* values
npm run dev:all # SvelteKit on :5173 + PocketBase on :8090
Open http://localhost:5173. Demo seeds available at /demo (fresh) and /demo/l45 (level 45 preloaded).
Required in .env:
| Var | Purpose |
|---|---|
PUBLIC_POCKETBASE_URL |
PocketBase base URL (e.g. http://127.0.0.1:8090) |
ANTHROPIC_API_KEY |
Server-only. Without it, AI features degrade gracefully. |
POCKETBASE_ADMIN_EMAIL |
Server-side /api/sync admin auth |
POCKETBASE_ADMIN_PASSWORD |
Server-side /api/sync admin auth |
| Script | What it does |
|---|---|
npm run dev:all |
SvelteKit + PocketBase in parallel (recommended) |
npm run dev |
SvelteKit only (5173) |
npm run pocketbase |
PocketBase only (8090) |
npm run build |
Production build → .svelte-kit/cloudflare/ |
npm run preview |
Preview the built output |
npm run check |
svelte-kit sync + svelte-check (TS strict) |
npm run check:watch |
Type-check in watch mode |
No test runner is wired up yet; npm run check is the only automated verification.
Offline-first by contract: all writes go to Dexie first, then a SyncQueueItem table drains to PocketBase via the /api/sync endpoint when online. Client code never talks to PocketBase directly — that bypasses the queue and breaks offline behavior.
src/lib/
├── game/ Pure functions — XP curve, ranks, stats, achievements, scoring
├── stores/ Svelte 5 Runes ($state) modules — *.svelte.ts files
├── db/ dexie.ts (schema + migrations), pocketbase.ts, sync.ts, schema.ts
├── ai/ Server-only Claude client + Zod prompt/tool schemas
├── components/ By feature: quest/, player/, dashboard/, animations/, ui/
├── pwa/ Service worker, Workbox cache, background sync
├── data/ Static content — achievements, shadows, system quests, demo seeds
└── utils/ constants.ts (game balance knobs)
| Alias | Path |
|---|---|
$ai |
src/lib/ai |
$game |
src/lib/game |
$stores |
src/lib/stores |
$db |
src/lib/db |
$components |
src/lib/components |
Captured from the live /demo/l45 seed (Level 45, B-Rank, mid-game state). Dark theme is the default; see src/lib/components/layout/ThemeProvider.svelte for the light variant.
![]() Quests — daily / weekly / one-shot, scored against pillar mastery |
![]() Stats — XP curve, rank thresholds, pillar mastery breakdown |
![]() Shadows — summoned companions with passive effects |
![]() Achievements — 60+ tiered milestones across pillars |
![]() Journal — daily reflections with attachments + mood log |
|
Cloudflare Pages target. After authenticating wrangler once (npx wrangler login), deploys are one command:
DEPLOY.bat
This runs wrangler pages deploy .svelte-kit/cloudflare-deploy --project-name=woo-app --branch=main. Production secrets (ANTHROPIC_API_KEY, POCKETBASE_ADMIN_*) live in the Cloudflare Pages dashboard under Environment Variables — never in .env.production (which is gitignored anyway).
CLAUDE.md — guidance for Claude Code agents (conventions, layered architecture, specialist subagent routing protocol).docs/ — long-form documentation (Turkish): architecture, game-mechanics, ai-integration, database, api-reference, development, deployment.SESSION_NOTES.md — recent session handoff notes (Turkish)..claude/audit-state.md — single source of truth for baselines, open issues, project realities..claude/runbooks/ — deep procedures for Dexie migrations, tool_use Zod patterns, sync queue debug, cinematic timeline, anti-template UI checklist, test setup.Please report security issues privately — see SECURITY.md. Do not open public issues for vulnerabilities.
MIT © 2026 ReqiDions