Elijah Voigt
|
a5b7c8d856
|
feat(quotesdb): implement API DB layer and all HTTP handlers
DB layer (src/bin/api/db/):
- native.rs: NativeRepository (tokio-rusqlite) implementing all CRUD ops,
dynamic WHERE for filters, two-phase auth check for update, 13 unit tests
- d1.rs: D1Repository wasm32 stub (all methods return Internal error)
- connection.rs: open() helper — WAL + foreign_keys pragmas
- mod.rs: cfg-gate async_trait (Send on native, ?Send on wasm32)
Handlers (src/bin/api/handlers/mod.rs):
- All 7 routes: GET /api/, random, {id}, list, PUT create, POST update, DELETE
- Router order: random BEFORE {id} (prevents "random" matching as id)
- Auth: X-Auth-Code header validation → 403 on mismatch
- 13 handler unit tests with MockRepo
main.rs: opens DB, runs migrations, wraps in Arc<dyn Repo + Send + Sync>,
binds on $PORT (default 3000)
Cargo.toml: tower dev-dep for ServiceExt::oneshot in tests
All 32 tests pass (26 api + 6 lib)
Tickets closed: 00aff0 a5049d 6e829e 28e7d9 886bfd 2ce22e 5dbb7d 05f8ae
d792e2 5d9f5a b20b5a 175382 03bb91
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
3 months ago |
Elijah Voigt
|
fc89180b82
|
chore(quotesdb): resolve all triage tickets and create implementation tickets
- All 21 TRIAGE decision tickets resolved with chosen approaches documented
- This session: e2bd9b (SPA routing → _redirects), 2ec8b1 (OpenAPI → build.rs),
0d84fa (HTTP client → reqwest), 0bc655 (auth code → session storage)
- New implementation tickets created: 9ef703, 8892d5, 5379eb
- Downstream tickets updated with resolved approaches and correct dependencies
- ARCHITECTURE.md updated with pinned WASM dependency versions (yew 0.22,
yew-router 0.19, wasm-bindgen 0.2)
- XML tags added to all tickets for improved LLM guidance
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
3 months ago |