Skip to content

svc-weather

NovaTrek Weather Service  |  Support  |  v1.0.0  |  NovaTrek Platform Team

Integrates with on-site weather stations and third-party providers to deliver

Swagger UI Download OpenAPI Spec Live Service (Dev) Azure Portal CI/CD Pipeline Source Code Technology Stack

Delivery Status

Delivery Wave: 6 -- External Integrations

Stage Status
Infrastructure (Bicep) ✅ complete
Database Schema (Flyway) ✅ complete
Deployed to Dev ✅ complete
Smoke Tested ✅ complete
Deployed to Prod not-started
Pipeline Status
CI Pipeline ✅ complete
CD Pipeline ✅ complete

Azure Resources (Dev):


Integration Context

svc-weather C4 context diagram

Generated from architecture/specs/svc-weather.yaml + cross-service-calls.yaml

Data Store

Entity Relationship Diagram

svc-weather entity relationship diagram

Generated from architecture/metadata/data-stores.yaml

Overview

Property Detail
Engine Valkey 8 + PostgreSQL 15
Schema weather
Tables weather_stations, forecast_cache, alert_history
Estimated Volume ~10K weather reads/day, ~100 external API fetches/day
Connection Pool min 3 / max 10 / idle timeout 10min
Backup Strategy Daily pg_dump, 7-day retention (cache data is ephemeral)

Key Features

  • Valkey TTL cache for current conditions (5-min TTL)
  • External weather API response caching and aggregation
  • Severe weather alert deduplication

Table Reference

weather_stations

Registered weather station locations for data sourcing

Column Type Constraints
station_id UUID PK
name VARCHAR(100) NOT NULL
latitude DECIMAL(9,6) NOT NULL
longitude DECIMAL(9,6) NOT NULL
provider VARCHAR(50) NOT NULL
active BOOLEAN NOT NULL, DEFAULT TRUE

Indexes:

  • idx_ws_provider on provider

alert_history

Archived severe weather alerts with deduplication

Column Type Constraints
alert_id UUID PK
station_id UUID NOT NULL, FK -> weather_stations
alert_type VARCHAR(50) NOT NULL
severity VARCHAR(20) NOT NULL
message TEXT NOT NULL
external_id VARCHAR(100) NOT NULL, UNIQUE (dedup key)
issued_at TIMESTAMPTZ NOT NULL
expires_at TIMESTAMPTZ NOT NULL

Indexes:

  • idx_alert_station on station_id, issued_at DESC
  • idx_alert_dedup on external_id (UNIQUE)

Endpoints (5 total)


GET /weather/current -- Get current weather conditions

Returns the latest weather data from the specified station, typically updated every 15 minutes.

View in Swagger UI

GET /weather/current sequence diagram

Generated from architecture/specs/svc-weather.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


GET /weather/forecast -- Get weather forecast

Returns a multi-day forecast for the area covered by the specified weather station. Maximum 10-day lookahead.

View in Swagger UI

GET /weather/forecast sequence diagram

Generated from architecture/specs/svc-weather.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


GET /weather/alerts -- Get active weather alerts for a region

Returns all active weather alerts for the specified region.

View in Swagger UI

GET /weather/alerts sequence diagram

Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-weather--get-weather-alerts.puml


POST /weather/alerts -- Create a weather alert (internal)

Internal endpoint used by automated monitoring systems or operations staff

View in Swagger UI

POST /weather/alerts sequence diagram

Generated from architecture/specs/svc-weather.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


GET /trail-conditions -- Get current trail conditions

Returns real-time condition data for the specified trail, combining weather station

View in Swagger UI

GET /trail-conditions sequence diagram

Generated from architecture/specs/svc-weather.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


Consuming Applications

Application Screens Using This Service
Guest Portal Trip Browser
Operations Dashboard Daily Schedule Board
Adventure App Live Trip Map, Weather and Trail Alerts