Commit Graph

8 Commits

Author SHA1 Message Date
Bas van Rossem
384797df7d docs: update CLAUDE.md and roadmap for single-backend (apps/api) repo 2026-06-17 14:41:07 +02:00
Bas van Rossem
efff2214d4 fix(api): make migrate.ts direct-run guard work on Windows
The guard compared import.meta.url against `file://${process.argv[1]}`, which
never matches on Windows (argv[1] is a drive-letter/backslash path), so
`yarn db:migrate` silently no-opped for local non-Docker dev. Use
pathToFileURL(process.argv[1]).href instead, which is correct on Windows and
Linux alike. Verified `yarn db:migrate` now creates all tables on Windows; the
Docker start path is unaffected.
2026-06-17 14:07:41 +02:00
Bas van Rossem
41b65f209c fix(api): reconcile better-auth schema with installed better-auth CLI output
The Task 3 schema drifted from what better-auth@1.6.18's CLI generates: it used
mode:'timestamp' (epoch seconds) instead of 'timestamp_ms', left verification
timestamps nullable, and omitted the default expressions and helper indexes.

Regenerated src/db/schema.ts from `@better-auth/cli generate` (authoritative per
the plan's version-drift rule) and rebuilt migration 0000 from scratch (no data
exists yet). Converted the index callbacks from the CLI's array form to the
object form required by drizzle-orm@0.36.4's types. Adds session_userId_idx,
account_userId_idx, verification_identifier_idx and the unixepoch defaults.

Tests (health, db, auth sign-up/sign-in, /api/me round-trip) all pass; typecheck
clean; db:generate reports no pending changes.
2026-06-17 14:06:16 +02:00
Bas van Rossem
bcb305b048 feat(api): dockerize backend with compose, migrations-on-start, and run docs 2026-06-17 13:54:48 +02:00
Bas van Rossem
04cfe0f726 feat(api): add protected GET /api/me and full auth round-trip test 2026-06-17 13:50:31 +02:00
Bas van Rossem
89f892ce0c feat(api): mount better-auth (email+password + bearer) on /api/auth 2026-06-17 13:47:20 +02:00
Bas van Rossem
e8aa2c67e8 feat(api): Drizzle + libsql DB layer with better-auth schema and migrations 2026-06-17 13:40:31 +02:00
Bas van Rossem
62c8597068 feat(api): Hono backend skeleton with /health endpoint and test 2026-06-17 13:35:28 +02:00