- TypeScript 65%
- Shell 25%
- PowerShell 9%
- CSS <1%
CD Catalogue #
An installable PWA for cataloguing a CD collection whose headline feature is photograph one or more CDs → OCR/extraction → human-confirmed entries. Manual create/update/delete, instant offline browse/search/sort, and export round it out.
Single-owner (Google sign-in), fully serverless and per-use on AWS.
See the feature spec and design under
specs/001-cd-catalogue-ocr/ — in particular
plan.md, data-model.md,
and quickstart.md.
Monorepo layout #
| Package | What it is |
|---|---|
packages/core |
Shared domain: Zod schemas + year validation, duplicate detection, extraction normalization, export (test-first). |
packages/extraction |
ExtractionProvider port + default Bedrock (Claude Haiku) adapter. |
apps/api |
Lambda handlers (Node 22, TypeScript) behind API Gateway HTTP API; DynamoDB single-table + S3. |
apps/web |
Next.js 15 static-export PWA (Serwist SW, Dexie offline mirror, Google sign-in). |
infra |
AWS CDK v2 — data / api / frontend stacks. |
Architecture (cheapest-possible, per-use, scale-to-zero) #
- Frontend: Next.js static export → S3 + CloudFront (OAC). Serwist service worker + Dexie mirror for instant offline browse.
- Auth: Google Identity Services in the browser → ID token validated by the
HTTP API's native JWT authorizer; a single
OWNER_EMAILallowlist. - API: API Gateway HTTP API + one dispatching Lambda (
routeKeyrouter). - Data: DynamoDB on-demand (single table); S3 for transient capture images (deleted after review, 1-day lifecycle backstop).
- OCR/extraction: Amazon Bedrock (Claude Haiku, multimodal) behind the
ExtractionProviderboundary (swappable for Textract/Rekognition).
Develop #
pnpm install
pnpm test # all Vitest suites (core, extraction, api, infra, web lib)
pnpm typecheck # tsc across packages
pnpm lint # eslint
pnpm --filter @cdcat/web dev # Next.js dev server
Configuration is via environment (see .env.example); no secrets are committed.
Build & deploy #
pnpm --filter @cdcat/api build # esbuild bundle → apps/api/dist (required before synth)
pnpm --filter @cdcat/web build # static export → apps/web/out
pnpm --filter infra deploy -- --context env=prod
Deploying needs AWS credentials, Bedrock model access in the target region, and a Google OAuth Web client id. See quickstart.md for the full runbook and the V1–V5 validation scenarios.
Status #
Built spec-first via Spec Kit. Backend (domain, handlers, router, CDK infra +
esbuild bundle) and the web app (browse, manual CRUD, capture→review, PWA, auth)
are implemented and verified by pnpm test + next build + cdk assertions.
Live end-to-end validation (V1–V5) requires a real deploy + browser.