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
Integration Context¶
Data Store¶
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_provideronprovider
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_stationonstation_id, issued_at DESCidx_alert_deduponexternal_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.
GET /weather/forecast -- Get weather forecast¶
Returns a multi-day forecast for the area covered by the specified weather station. Maximum 10-day lookahead.
GET /weather/alerts -- Get active weather alerts for a region¶
Returns all active weather alerts for the specified region.
POST /weather/alerts -- Create a weather alert (internal)¶
Internal endpoint used by automated monitoring systems or operations staff
GET /trail-conditions -- Get current trail conditions¶
Returns real-time condition data for the specified trail, combining weather station
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 |