feat: MobyDB + latlng spatial engine integration — provenance, fleet tracking, geofencing#5
Conversation
…ng, geofencing MobyDB (geospatial-native database): - HTTP client for MobyDB's axum API (spacetime address model: H3 cell + epoch + Ed25519 key) - Provenance records with PostgreSQL fallback/mirror - Supply chain step tracking with Merkle proof verification - Epoch management (seal, verify, query) - 10 tRPC endpoints (record, query, seal, prove, verify, supply chain) - Drizzle schema: provenance_records, provenance_epochs, provenance_keys, supply_chain_steps latlng (real-time geospatial object engine): - HTTP client for latlng server (collections, objects, geofences, events) - Fleet/vehicle tracking, cold chain monitoring, distributor coverage - Geofence zone management with webhook delivery - Tracking history with position logging - 12 tRPC endpoints (update, nearby, list, history, geofence CRUD, events) - Drizzle schema: tracked_objects, tracking_history, geofence_zones, geofence_events PWA pages (4 new): - Provenance Explorer: spacetime address model, epoch browsing, Merkle proofs - Fleet Tracker: real-time object map, collection views, KPIs - Geofence Manager: zone CRUD, event monitoring, webhook config - Supply Chain Provenance: verifiable farm-to-table tracking timeline Navigation: CategoryHub + DashboardLayout sidebar entries under Spatial & Weather Build: tsc 0 errors, 586 tests pass Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Original prompt from Patrick
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
E2E Test Results: MobyDB + latlng Spatial Pages — 7/7 PASSEDRan frontend locally (Vite dev server, client-only), tested all 4 new PWA pages end-to-end in browser with auth bypass. Results
Build Verification
Known Non-Blocking Issues
|
Summary
Integrates two external geospatial engines into FarmConnect:
MobyDB (GNS-Foundation/mobydb) — geospatial-native database where the primary key is a 3D spacetime address
(H3 cell, GEP Epoch, Ed25519 pubkey). Used as the spatial provenance layer for field observations, supply chain traceability, and cryptographic verification via Merkle proofs.latlng (tobilg/latlng) — real-time geospatial object engine with spatial indexing, geofencing, and webhook events. Used as the real-time tracking layer for fleet vehicles, cold chain units, distributor coverage, and IoT sensors.
Both engines use PostgreSQL as a fallback/mirror — the platform works fully without either engine running, and auto-upgrades to the engines when available.
Architecture
New files (13 changed, 3,186 insertions)
server/lib/mobydb-client.ts,server/lib/latlng-client.tsdrizzle/schema-spatial-engines.tsprovenance_records,provenance_epochs,provenance_keys,tracked_objects,tracking_history,geofence_zones,geofence_events,supply_chain_steps— all with indexes and FK constraintsserver/routers/mobydb-router.ts(10 endpoints),server/routers/latlng-router.ts(12 endpoints)CategoryHub.tsx,DashboardLayout.tsx,App.tsxKey design decisions
LIKEon H3 prefix for proximity queriesnearby()Build:
tsc0 errors · 586 tests passLink to Devin session: https://app.devin.ai/sessions/87560355a8b7425392cbfab1aa9e89fa
Requested by: @munisp