Kpa-clawbot
5c68605f2c
feat(go-server): full API parity with Node.js server
...
Performance:
- QueryGroupedPackets: 8s → <100ms (transmissions table, not packets_v VIEW)
Field parity:
- /api/stats: totalNodes uses 7-day window, added totalNodesAllTime
- /api/stats: role counts filtered by 7-day (matching Node.js)
- /api/nodes: role counts use all-time (matching Node.js)
- /api/packets/🆔 path field returns parsed path_json hops
- /api/packets: added multi-node filter (?nodes=pk1,pk2)
- /api/observers: packetsLastHour, lat, lon, nodeRole computed
- /api/observers/🆔 packetsLastHour computed
- /api/nodes/bulk-health: per-node stats from SQL
Tests updated with dynamic timestamps for 7-day filter compat.
All tests pass, go vet clean.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 02:11:33 -07:00
Kpa-clawbot
e18a73e1f2
feat: Go server API parity with Node.js — response shapes, perf, computed fields
...
- Packets query rewired from packets_v VIEW (9s) to direct table joins (~50ms)
- Packet response: added first_seen, observation_count; removed created_at, score
- Node response: added last_heard, hash_size, hash_size_inconsistent
- Schema-aware v2/v3 detection for observer_idx vs observer_id
- All Go tests passing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 01:50:46 -07:00
Kpa-clawbot
742ed86596
feat: add Go web server (cmd/server/) — full API + WebSocket + static files
...
35+ REST endpoints matching Node.js server, WebSocket broadcast,
static file serving with SPA fallback, config.json support.
Uses modernc.org/sqlite (pure Go, no CGO required).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 01:16:59 -07:00
Kpa-clawbot
e89c2bfe1f
test: add comprehensive Go test coverage for ingestor (80%) and server (90%)
...
- ingestor: add config_test.go (LoadConfig, env overrides, legacy MQTT)
- ingestor: add main_test.go (toFloat64, firstNonEmpty, handleMessage, advertRole)
- ingestor: extend decoder_test.go (short buffer errors, edge cases, all payload types)
- ingestor: extend db_test.go (empty hash, timestamp updates, BuildPacketData, schema)
- server: add config_test.go (LoadConfig, LoadTheme, health thresholds, ResolveDBPath)
- server: add helpers_test.go (writeJSON/Error, queryInt, mergeMap, round, percentile, spaHandler)
- server: extend db_test.go (all query functions, filters, channel messages, node health)
- server: extend routes_test.go (all endpoints, error paths, analytics, observer analytics)
- server: extend websocket_test.go (multi-client, buffer full, poller cycle)
Coverage: ingestor 48% -> 80%, server 52% -> 90%
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 00:07:44 -07:00