Skip to content

Scaffold SvelteKit app with SQLite, CI and Docker - #8

Merged
rooty-bot merged 2 commits into
mainfrom
claude/1-scaffold-sveltekit-sqlite-ci-docker
Nov 30, 2026
Merged

rooty-bot merged 2 commits into
mainfrom
claude/1-scaffold-sveltekit-sqlite-ci-docker

Conversation

@rooty-bot

Copy link
Copy Markdown
Collaborator

Summary

  • SvelteKit (TypeScript, adapter-node) with a simple layout and nav (Inbox, Review, Tasks, Time, Report, Settings) and placeholder pages, plus GET /healthz.
  • SQLite via better-sqlite3 at DATABASE_PATH (default ./data/dumpdown.db). A small migration runner applies numbered NNN_name.sql files from src/lib/server/db/migrations/ in their own transactions, tracked in schema_migrations, from the server init hook on startup.
  • Initial schema: dumps, tasks, time_entries (source calendar|timer|manual, start_at, end_at, title, project, external_id), categories, category_rules, settings.
  • Vitest with DB test helpers (in-memory DB and temp file path), ESLint + Prettier, npm run check (svelte-check), npm test, npm run build.
  • GitHub Actions CI on PRs and pushes to main: install, lint, check, test, build, plus a job that builds the Docker image and smoke-tests /healthz on an empty volume.
  • Multi-stage Dockerfile (Node 24 LTS, non-root node user, /data volume, healthcheck) and docker-compose.yml with the app and an optional ollama service (profile llm).
  • README development section covering local runs and Docker.

How it was tested

  • Locally: npm run lint, npm run check (0 errors, 0 warnings), npm test (13 tests pass), npm run build.
  • Tests cover migrations on an empty DB, idempotent reruns, applying only new migrations, rollback of a failing migration, schema constraints, DATABASE_PATH resolution, and the server init hook creating and migrating an empty DB at DATABASE_PATH.
  • Booted node build locally against an empty DATABASE_PATH. /healthz returned {"ok":true} and all tables were created.
  • Docker isn't available on the dev machine, so the CI docker job builds the image and runs the smoke test.

Closes #1

🤖 Generated with Claude Code

rooty-bot and others added 2 commits November 30, 2026 10:16
- SvelteKit 3 (TypeScript, adapter-node) with a nav layout and
  placeholder pages for Inbox, Review, Tasks, Time, Report, Settings
- better-sqlite3 database at DATABASE_PATH (default ./data/dumpdown.db)
  with a numbered-SQL migration runner applied on server start and an
  initial schema: dumps, tasks, time_entries, categories,
  category_rules, settings
- Vitest with DB test helpers, ESLint + Prettier, svelte-check
- GitHub Actions CI: lint, check, test, build, docker build + smoke test
- Multi-stage non-root Dockerfile with /data volume and healthcheck,
  docker-compose with optional ollama service (profile llm)
- README development and Docker instructions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rooty-bot

rooty-bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks for this, it's a clean and small scaffold. I checked it against #1 item by item.

Scope vs #1

  • SvelteKit + TS + adapter-node, layout with Inbox / Review / Tasks / Time / Report / Settings and placeholder pages, / redirects to /inbox ✅
  • better-sqlite3, DATABASE_PATH with ./data/dumpdown.db default (open.ts), numbered-SQL migration runner applied from the init hook, one transaction per migration, tracked in schema_migrations ✅
  • Schema has dumps, tasks, time_entries (source CHECK calendar|timer|manual, start_at/end_at, title, project, external_id with UNIQUE (source, external_id)), categories, category_rules, settings ✅. Using start_at/end_at instead of start/end is sensible and it's commented in the SQL.
  • Vitest with in-memory and temp-file DB helpers, ESLint + Prettier, check / test / build scripts ✅
  • CI on PRs and main runs install, lint, check, test, build, plus a Docker build and /healthz smoke test. Both jobs are green ✅
  • Multi-stage Dockerfile (node 24, USER node, /data volume, healthcheck) and compose with ollama under the llm profile ✅
  • README dev and Docker sections ✅

Done when

  • "Migrations run on an empty DB, covered by a test": hooks.server.spec.ts runs the real init hook against a fresh DATABASE_PATH in a nested directory that doesn't exist yet, and db.spec.ts covers the empty in-memory DB, idempotent reruns, applying only new migrations, and rollback of a failing migration. The CI docker job also checks boot on an empty volume. That fully covers it.

Security / hygiene

  • No secrets, no telemetry, no outbound calls. Workflow permissions are contents: read. Ollama's port isn't published to the host, which is a good default. All SQL in the runner uses parameters, and migration SQL only comes from bundled files.
  • No lint rules or checks are disabled apart from the standard no-undef off for TS (as typescript-eslint recommends). requireAssertions is turned on in Vitest, which is nice.

Nits (not blockers)

  • ollama/ollama has no tag pinned. It's worth pinning a version so docker compose --profile llm stays reproducible.
  • Once there are concurrent writers (timer + ICS sync), consider setting busy_timeout alongside WAL.

Looks good to merge from my side. 🚀

-- OpenSourcerer (Rootshift review)

@rooty-bot
rooty-bot merged commit c1a0801 into main Nov 30, 2026
2 checks passed
@rooty-bot
rooty-bot deleted the claude/1-scaffold-sveltekit-sqlite-ci-docker branch November 30, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scaffold: SvelteKit + SQLite + CI + Docker

1 participant