$ show netbymatt/ws4kp
This repository implements a WeatherStar 4000+ simulator web application that recreates the nostalgic Weather Channel display from the 1990s. It fetches live weather data from NOAA's api.weather.gov, radar.weather.gov, and SPC outlook services, then renders it through a retro-styled single-page application with CRT scanlines, custom fonts, and animated icons. The architecture is a Node.js/Express server (or static nginx deployment) with a built-in caching proxy that reduces API load, plus a client-side module system for weather displays (current conditions, forecasts, radar, alerts, almanac, travel forecast, etc.). Key entry points are index.mjs (server) and server/scripts/index.mjs (client bootstrap). Data flows from NOAA APIs through the proxy to the client, augmented with precomputed city/station JSON files for location lookup. External dependencies include NOAA API endpoints, ArcGIS geocoding, and Mesonet radar tiles. The codebase demonstrates solid engineering with modular utilities, a generic settings system, and a well-structured build pipeline (Gulp, Webpack, SASS). However, it is tightly coupled to specific NOAA APIs and relies on static data files that require manual regeneration, introducing moderate technical drift risk.
The LLM identified 5 files worth highlighting for reuse:
Implements a generic HTTP caching proxy with stale-while-revalidate semantics, in-flight request deduplication, configurable timeouts, and cache clearing endpoints. It wraps fetch with conditional requests and heuristic freshness, and can be extracted as a standalone caching layer for any REST API.
Provides pure functions for converting temperature (Celsius/Fahrenheit), wind speed (kmh/mph/knots), pressure (hPa/inHg), and distance (meters/miles). Each function is side-effect-free, well-named, and can be reused in any JavaScript project requiring unit conversions without any dependency on the rest of the codebase.
Contains weather-related utility functions including icon URL parsing from the NWS API, condition text normalization, and data quality checks. The icon mapping logic converts NWS icon filenames to retro-style GIF paths, which is a non-trivial mapping that could be adapted for other weather display systems.
A generic settings class that persists values to localStorage, supports URL parameter overrides, change callbacks, and sticky settings that survive location changes. The pattern is decoupled from the weather domain and can be reused as a lightweight configuration manager for any single-page application.
Processes raw weather station data into a curated JSON list with priority ranking, airport type classification, and name simplification. It uses regex-based name cleanup with a large set of exception rules, deduplication by geographic proximity, and priority assignment. This demonstrates careful data engineering that could be adapted for similar station or point-of-interest data pipelines.