Back to Engineering
REAL-TIME ANALYTICS • CASE MODEL 01

AndeanTelemetry: Real-Time Telemetry & GIS Dashboard

Lead Frontend Architect & Real-Time Systems Developer
ARCHITECTURE GOAL

High-frequency sensor telemetry UI monitoring microclimate stations, soil moisture, and reforestation polygons across high-altitude watersheds via WebSockets and TypeScript.

TECH STACK
React 19 TypeScript WebSockets TanStack Query Tailwind CSS
LIVE STREAMING & UI TELEMETRY

Sub-Second Telemetry State Pipeline

Buffered WebSocket ingestion with typed ring-buffer state preventing React render thrashing during bursts of field station packets.

telemetry-monitor.ts LIVE NODES
CONNECTED NODES 48 Stations 4,200 – 4,900m
FRAME BUDGET 16.6ms 60 FPS Smooth UI
STREAM LATENCY 38ms WebSocket Binary
Node #A-14 Vilcanota Glacier Basin — Temp -3.4°C STREAMING
Node #C-08 Huayhuash Watershed — Soil Moisture 64% NOMINAL
Node #B-22 Queñual Nursery — Batch Buffer Flush BUFFERING
src/hooks/useTelemetryStream.ts TYPESCRIPT
import { useEffect, useRef, useState } from 'react';

export interface SensorPacket {
  stationId: string;
  altitudeM: number;
  humidity: number;
  timestamp: number;
}

export function useTelemetryStream(wsUrl: string, limit = 120) {
  const [packets, setPackets] = useState<SensorPacket[]>([]);
  const bufferRef = useRef<SensorPacket[]>([]);

  useEffect(() => {
    const socket = new WebSocket(wsUrl);
    socket.onmessage = (event) => {
      const next = JSON.parse(event.data) as SensorPacket;
      bufferRef.current = [...bufferRef.current.slice(-(limit - 1)), next];
    };

    const flush = setInterval(() => {
      setPackets([...bufferRef.current]);
    }, 250);

    return () => {
      clearInterval(flush);
      socket.close();
    };
  }, [wsUrl, limit]);

  return packets;
}