Client-side SQLite editor: React 19 + TypeScript + Vite 8 + Tailwind 4 +
Zustand + sql.js in a web worker.
- Start with
README.md,package.json,biome.json,vite.config.ts, andtsconfig*.json. - Then read the nearest scoped instructions when working under:
src/AGENTS.mdsrc/components/AGENTS.mdsrc/components/browseTab/AGENTS.mdsrc/components/executeTab/AGENTS.mdsrc/components/structureTab/AGENTS.mdsrc/components/ui/AGENTS.mdsrc/hooks/AGENTS.mdsrc/lib/AGENTS.mdsrc/providers/worker/AGENTS.mdsrc/sqlite/AGENTS.mdsrc/store/AGENTS.md
- Install:
npm install - Dev server:
npm run dev - Tests:
npm test(single run) /npm run test:watch(watch mode) - Full check:
npm run check - Build app:
npm run build(typecheckruns first) - Build GitHub Pages variant:
npm run build:pages - Unused-file/deps check:
npm run knip - React diagnostics:
npm run doctor
- Preferred for small edits:
npx biome check <changed-files> - Run related tests:
npx vitest run <path>ornpm testfor the full suite - Format-only check for one file:
npx biome check --formatter-enabled=true --linter-enabled=false --assist-enabled=false <file> - Lint one file/folder:
npx biome lint <path> - Typecheck only:
npm run typecheck - Recommended sequence after edits:
npx biome check <changed-files>npx vitest run <changed-files>(if a.test.file exists alongside)npm run build
- If you changed entrypoints, imports, or dead code boundaries, also run
npm run knip.
- Vitest is the test runner (jsdom environment, setup in
src/test/setup.ts). Test files follow*.test.ts(x)naming alongside their source files. Run the full suite withnpm test, or target files withnpx vitest run <path>. - Biome is the formatter and linter. Let Biome own import organization.
- TypeScript is strict;
buildandbuild:pagesboth runtsc -bfirst. vite.config.tssetsbaseto/sqlite-online/only inpagesmode.
- App entrypoint is
src/main.tsx: it initializes API key storage, then mountsStrictMode > ErrorBoundary > ThemeProvider > PanelProvider > DatabaseWorkerProvider > App.AppToasteris a sibling ofPanelProviderinsideThemeProvider. src/App.tsxis the top-level tab shell.ExecuteTabis lazy-loaded; keep it lazy unless the task requires otherwise.- Browser UI never talks to SQLite directly. UI actions go through
src/providers/worker/WorkerProvider.tsxintosrc/sqlite/sqliteWorker.ts. src/types.tsis the source of truth for worker protocol and shared domain types.src/store/useDatabaseStore.tsis the main app state store. Use selectors and existing store actions before adding new state.
- Prefer
@/imports across directories; use relative imports within the same folder. - Keep CSS side-effect imports first, matching
src/main.tsx. sqliteWorker.tsis protocol glue; avoid changing it unless the worker message contract changes.- Add SQL helpers in
src/sqlite/sqlUtils.ts, not inline insrc/sqlite/core.ts. - Keep worker/store/provider changes aligned: protocol updates usually require
coordinated edits across
@/types, worker runtime, message handler, and provider actions.