How rink42/taiwan-weather works
This is a browser-based Taiwan weather app with international weather lookup, location-based selection, forecast views, and offline support. The primary flow selects a Taiwan county/district or international city, retrieves forecast data, transforms it for display, and caches Taiwan results locally; the service worker separately handles static assets and network-only weather/geocoding requests. The excerpts support the main app, icon renderer, and service-worker behavior, but not all app.js internals, so uncertain call links are omitted.
Main entry points: app.js Weather app · service-worker.js Request handler · icons.js Weather icon renderer
Components 14
Weather experience
- Weather app
app.js - Taiwan forecasts
app.js - International weather
app.js - Location lookup
app.js - Forecast processing
app.js
Offline support
- Local forecast cache
app.js - Request handler
service-worker.js - Asset cache
service-worker.js
Weather visuals
- Weather icon renderer
icons.js
Other components
- Weather viewer
- CWA weather API
- Open-Meteo services
- Nominatim geocoder
- NLSC location API
Connections 18
- Weather viewer → Weather app: uses
app.js - Weather app → Taiwan forecasts: selects region
app.js - Weather app → International weather: selects city
app.js - Weather app → Location lookup: requests location
app.js - Taiwan forecasts → CWA weather API: fetches forecasts
- International weather → Open-Meteo services: fetches forecasts
- International weather → Nominatim geocoder: reverse geocodes
app.js - Location lookup → NLSC location API: resolves Taiwan place
app.js - Location lookup → Nominatim geocoder: resolves international place
app.js - Taiwan forecasts → Forecast processing: processes data
app.js - Forecast processing → Local forecast cache: stores forecasts
app.js - Taiwan forecasts → Local forecast cache: loads offline data
app.js - Weather app → Weather icon renderer: renders conditions
- Request handler → Asset cache: reads and writes
service-worker.js - Weather viewer → Request handler: requests app
- Request handler → CWA weather API: network only
service-worker.js - Request handler → Open-Meteo services: network only
service-worker.js - Request handler → Nominatim geocoder: network only
service-worker.js