Imported from Yaon-C2H8N2/powersync-demo (
AGENTS.md). Install upstream withnpx skills add Yaon-C2H8N2/powersync-demo. Copyright stays with the author.
Power Sync Demo
Project purpose
Demo app showcasing data subset synchronization — reference data + user data synced from a server database to a React/Vite client via PowerSync.
Planned stack
| Layer | Technology |
|---|---|
| Client | React + Vite + TypeScript |
| Sync | PowerSync (JourneyApps) |
| Backend | PowerSync + demo DB schema |
Conventions (infer from existing files before creating new ones)
- This is a TypeScript project — prefer
.ts/.tsx, strict mode, explicit types. - Ban
anyentirely. Useunknown+ type narrowing, proper generics, orneverwhere appropriate. ESLint must error on both explicitanyand implicitany(@typescript-eslint/no-explicit-any: error,@typescript-eslint/no-unsafe-*rules,noImplicitAny: truein tsconfig). - Use Vite's conventions for entry (
index.html->src/main.tsx), env vars (VITE_prefix), and config (vite.config.ts). - React components go in
src/components/, pages insrc/pages/orsrc/routes/(check existing layout first). - The server-side schema defines reference tables (static data synced to all clients) and user tables (per-user data subsets).
- PowerSync sync rules (usually
sync-rules.jsonorpower-sync.json) govern which data goes to which client. - Keep the demo schema simple — lean toward clarity over production patterns.
Workflow
- Plan first — decompose tasks, delegate subagents in parallel where possible.
- Validate each step — run typecheck, lint, and relevant tests after every change before marking it done. Fix all errors before moving on.
- Commit after every completed and validated task — use conventional commits. Do not batch unrelated changes into one commit.
Commands to discover
As the project grows, document these in package.json scripts:
| Action | Expected script |
|---|---|
| dev (client) | cd client && npm run dev (Vite) |
| typecheck | cd client && npx tsc --noEmit |
| lint | cd client && npm run lint (ESLint) |
| format check | cd client && npx prettier --check . |
| test | — (not configured) |
| build (client) | cd client && npm run build |
| stack up | docker compose up |
| stack down | docker compose down |
| generate dev token | docker compose --profile keygen run keygen |
✓ Scripts are defined.
Notes for agents
- This repo is intentionally minimal and demo-oriented — avoid over-engineering.
.idea/is gitignored — don't commit IDE files.- Sync-rule changes can affect what data clients receive; verify after editing.
- If a PowerSync migration or schema change is needed, check whether existing client data should be wiped during development.
- Use conventional commits:
feat:,fix:,chore:,docs:,refactor:,test:,style:,perf:,ci:,build:,revert:. Scope is optional. Always use lowercase, no period at end.
