How jake-herrera/weather-station-dashboard works
Weather Station Dashboard is a React interface for viewing live ESP32/BME280 readings stored in Firebase. Users select a time window; the dashboard fetches that device’s readings, calculates metric summaries, downsamples chart data for longer windows, and renders metric cards and trend charts alongside device metadata and a live clock. The graph follows the documented and excerpted runtime wiring. Some UI and service implementations were not excerpted, so their relationships are included only where the source index or README supports them.
Main entry points: App.tsx Dashboard orchestration · reading.ts Reading and range types · useReadings.ts Live readings query · firebase.ts Firebase client
Components 22
Dashboard UI
- Dashboard orchestration
src/App.tsx
Firebase Data
- Live readings query
src/hooks/useReadings.ts - Device metadata query
src/hooks/useDeviceMeta.ts - Firebase client
src/lib/firebase.ts - Realtime Database
Reading Processing
- Metric statistics
src/services/compute-stats.ts - Chart downsampling
src/services/downsample-readings.ts - Chart formatting
src/services/format-chart-data.ts - Reading filtering
src/services/filter-readings.ts
Display Components
- Range selector
src/components/features/RangeFilter.tsx - Metric cards
src/components/features/MetricCard.tsx - Trend charts
src/components/features/TrendChart.tsx - Loading skeleton
src/components/features/DashboardSkeleton.tsx - Device metadata panel
src/components/features/DeviceMeta.tsx - Real-time clock
src/components/features/RealTimer.tsx
Domain Configuration
- Time range definitions
src/constants/ranges.ts - Chart metric definitions
src/constants/metrics.ts - Metric definitions
src/types/metrics.ts - Chart metadata types
src/types/metricChart.ts - Reading and range types
src/types/reading.ts
Other components
- Dashboard user
- ESP32 weather station
Connections 27
- Dashboard user → Dashboard orchestration: views dashboard
README.md - ESP32 weather station → Realtime Database: writes readings
README.md - Dashboard orchestration → Live readings query: requests readings
src/App.tsx - Live readings query → Firebase client: queries client
src/hooks/useReadings.ts - Firebase client → Realtime Database: initializes connection
src/lib/firebase.ts - Live readings query → Time range definitions: uses range window
src/hooks/useReadings.ts - Range selector → Time range definitions: uses range options
src/components/features/RangeFilter.tsx - Dashboard orchestration → Range selector: renders selector
src/App.tsx - Dashboard orchestration → Metric statistics: computes summaries
src/App.tsx - Dashboard orchestration → Chart downsampling: reduces chart readings
src/App.tsx - Dashboard orchestration → Metric cards: renders summaries
src/App.tsx - Dashboard orchestration → Trend charts: renders chart series
src/App.tsx - Dashboard orchestration → Chart metric definitions: supplies chart metadata
src/App.tsx - Dashboard orchestration → Loading skeleton: shows while loading
src/App.tsx - Dashboard orchestration → Device metadata panel: renders device panel
src/App.tsx - Dashboard orchestration → Real-time clock: renders clock
src/App.tsx - Device metadata panel → Device metadata query: uses metadata query
src/components/features/DeviceMeta.tsx - Device metadata query → Firebase client: fetches through client
src/hooks/useDeviceMeta.ts - Trend charts → Chart formatting: formats readings
src/components/features/TrendChart.tsx - Metric cards → Metric statistics: uses statistics
src/components/features/MetricCard.tsx - Chart metric definitions → Chart metadata types: defines chart metadata
src/constants/metrics.ts - Chart metadata types → Metric definitions: uses metric keys
src/types/metricChart.ts - Metric definitions → Reading and range types: derives metric keys
src/types/metrics.ts - Time range definitions → Reading and range types: uses time range type
src/constants/ranges.ts - Metric statistics → Reading and range types: accepts readings
src/services/compute-stats.ts - Chart downsampling → Reading and range types: accepts readings
src/services/downsample-readings.ts - Chart formatting → Reading and range types: formats readings
src/services/format-chart-data.ts