Polar is the BareSystems dashboard-focused environmental telemetry service. It monitors a small set of configured target areas, stores current and historical climate data, and serves that data back to dashboards and agents without forcing every client to hit NOAA or AirNow directly.
- Indoor climate ingestion from the simulator or Airthings
- Target-aware outdoor weather polling with NOAA as primary source
- Open-Meteo forecast fallback when NOAA forecast pulls fail
- Target-aware external air quality polling from AirNow
- Historical persistence for readings, forecasts, AQ snapshots, alerts, and provider status
- REST API, MCP JSON-RPC API, and a WebSocket live feed
- SQLite for local/dev and Postgres-ready storage support for deployed environments
go mod tidy
make runAuth token default: dev-token
Scoped tokens are also supported through auth.tokens in config JSON:
{
"auth": {
"tokens": [
{"name": "telemetry-reader", "value": "telemetry-token", "scopes": ["read:telemetry"]},
{"name": "forecast-reader", "value": "forecast-token", "scopes": ["read:forecast"]},
{"name": "ops-admin", "value": "admin-token", "scopes": ["admin:config"]}
]
}
}REST health: GET http://localhost:8080/healthz
REST readiness: GET http://localhost:8080/readyz
MCP health: GET http://localhost:8080/healthz
Live feed: GET ws://localhost:8080/v1/live?target=<target-id>
storage.driver=sqlitewithstorage.sqlite_pathis the local default.- Production deployments can use
storage.driver=postgreswithstorage.database_url. - NOAA requests require
provider.noaa_user_agent. - AirNow data requires
provider.airnow_token. - Monitored dashboard areas are configured in
monitoring.targets. - If
monitoring.targetsis omitted, Polar seeds a single default target fromstation.
GET /v1/capabilitiesGET /v1/targetsGET /v1/station/healthGET /v1/readings/latestGET /v1/readings?metric=&from=&to=&resolution=GET /v1/forecast/latest?target=GET /v1/weather/current?target=GET /v1/weather/forecast?target=GET /v1/weather/alerts?target=GET /v1/air-quality/current?target=GET /v1/air-quality/forecast?target=GET /v1/climate/snapshot?target=GET /v1/live?target=(WebSocket)GET /v1/diagnostics/data-gapsGET /v1/audit/events?from=&to=&type=GET /v1/metrics
All /v1/* endpoints require:
Authorization: Bearer <token>
Scope mapping:
read:telemetryfor capabilities, targets, station health, live feed, readings, current weather, current air quality, alerts, climate snapshot, and data gapsread:forecastfor weather forecast and air-quality forecastread:auditfor audit eventsadmin:configfor metrics
list_capabilitieslist_targetsget_station_healthget_latest_readingsquery_readingsget_forecastget_weather_currentget_weather_forecastget_weather_alertsget_air_quality_currentget_air_quality_forecastget_climate_snapshotget_data_gapsget_audit_eventsget_metrics
POST JSON-RPC requests to /mcp on the same port as the REST server (single-port mode when POLAR_MCP_ADDR == POLAR_LISTEN_ADDR; default dev port: 8080).