Phase 2 · Task Set A — backend (28 min)
Build the backend first. The frontend needs real endpoints, not mock data. If the backend isn't running before Task Set B, the finale (entries in the browser) is impossible.
Work through these in order (one bmad-dev-story run each; spec §ref in context every time):
TASK-002 · backend/src/server.ts — Express bootstrap (spec §4 + §2)
Express app, JSON middleware, CORS (allow http://localhost:3000 only), mount the entries router at /api, start on port 3001, import db from ./db so migration runs on startup.
→ commit: feat(server): Express bootstrap, CORS, port 3001 -- satisfies spec §2, §4
TASK-003 · backend/src/routes/entries.ts — GET /entries (spec §2)
Router + GET / → all entries ORDER BY timestamp DESC; optional ?tag= filter (WHERE tags LIKE '%'+tag+'%'). Returns 200 + Entry[] | 500. Export router as default.
→ Test: run server, open http://localhost:3001/api/entries. → commit: feat(api): GET /entries with tag filter -- satisfies spec §2