feat: Todo MVP — Express REST API, in-memory store, and frontend#1
feat: Todo MVP — Express REST API, in-memory store, and frontend#1algorithm-conduction wants to merge 1 commit into
Conversation
…frontend Adds all four CRUD endpoints (GET/POST/PATCH/DELETE /api/todos), an in-memory store, a vanilla HTML/JS single-page frontend, and Vitest integration tests covering every acceptance scenario from the spec. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
[WARNING] Missing HTTP Security Headers |
|
[WARNING] No Authentication or Authorization on Any API Endpoint |
|
[SUGGESTION] Missing Type Validation on |
|
[SUGGESTION] No Rate Limiting on Write Endpoints |
|
[SUGGESTION] No Content Security Policy |
|
Tool scan summary
No secrets, hardcoded credentials, or SAST-flagged vulnerabilities detected by automated tools. Manual review identified 2 WARNINGs and 3 SUGGESTIONs above. XSS note: { "pass": true, "blocking": [] } |
Hydra Code Review — Juan Claude van DammePR: feat: Todo MVP — Express REST API, in-memory store, and frontend [WARNING] No lint script defined in package.json [WARNING] Unused import [WARNING] PATCH endpoint applies unvalidated if (typeof completed !== 'boolean') {
return res.status(400).json({ error: 'completed must be a boolean' });
}[WARNING] [SUGGESTION] No error handling in frontend fetch calls |
{ "pass": false, "blocking": [] }
|
|
Verdict (corrected — supersedes previous verdict comment): { "pass": true, "blocking": [] }No CRITICAL findings. All 8 tests pass. 4 WARNINGs should be addressed before merge but are not hard blockers per the severity definitions. |
Summary
Implements the Todo MVP as specified in the OpenSpec change proposal. A Node.js + Express REST API exposes four CRUD endpoints backed by an in-memory store, a vanilla HTML/JS single-page frontend is served as static files, and a Vitest integration test suite covers all acceptance scenarios. No database or authentication is required for this MVP.
Spec Reference
https://github.com/algorithm-conduction/todo-app/blob/hydra/spec/openspec/changes/todo-mvp/design.md
Changes
package.json— project manifest; declares express, supertest, vitest; sets"type": "module"for ES module supportsrc/store.js— in-memory todo store withlist,create,update,remove,resetmethods; EUPL-1.2 headersrc/server.js— Express app withGET /api/todos,POST /api/todos,PATCH /api/todos/:id,DELETE /api/todos/:id; serves static frontend; EUPL-1.2 headerpublic/index.html— single-page frontend with add/complete/delete interactions via the REST API; EUPL-1.2 headertest/api.test.js— Vitest + supertest integration tests covering all four endpoints and error paths; EUPL-1.2 headerTest Coverage
test/api.test.js— POST creates todo (201 + body shape), POST rejects missing title (400), GET lists todos (200 + array), GET returns empty array, PATCH marks completed (200), PATCH 404 on unknown id, DELETE removes todo (204 + absent from list), DELETE 404 on unknown id