WeatherTool is a Scala backend, SolidJS frontend, and PostgreSQL database used to inspect Latvian weather observations and prepare map-based newsroom graphics.
```text
External providers Local/staging workflow
LVGMC station FTP/CSV ----+ Synthetic SQL seed
LVGMC forecast CSV -------+ |
DMI HARMONIE APIs --------+ v
v PostgreSQL
Scala ingestion |
| |
+---------> Scala/http4s API
|
v
SolidJS web UI
|
v
Canvas preview and PNG export
```
Staging currently exercises the PostgreSQL → API → frontend path with synthetic observations. It does not emulate LVGMC forecast files or HARMONIE GRIB files.
## Components
### Scala backend
- Serves JSON API routes and the built frontend from `web/dist`.
- Queries and aggregates station observations in PostgreSQL.
- Contains ingestion/parsing code for LVGMC station and forecast data.
- Contains HARMONIE discovery, download, GRIB parsing, and rendering support.
- Provides Stations, City Analysis, Faktiskā, Latvia overview, Database, HARMONIE, and LVGMC forecast workspaces. A separate Ūdens temperatūra production workspace is planned.
Faktiskā has a fixed 13-position station configuration. On page entry the frontend calls `/api/query/latest-temperatures/<cities>`. The backend selects the newest row per requested city and returns `tempAvg`, the station name, and its observation timestamp. The UI highlights missing or older observations and permits an explicit manual override without changing the stored observation.
Weather-font glyphs and wind values remain manual editorial inputs. One glyph can be applied to all fixed stations and exceptions changed individually. The browser composes these values on the fixed wind-template canvas and exports exactly 3840×1440 pixels. The production master images define the required output geometry; final Monda pixel-level comparison remains pending.
The glyph renderer measures each finished temperature badge, attaches the selected Daira glyph automatically, then applies a fixed optical correction shared by the Faktiskā template. The configuration also permits per-station offsets when later production comparison requires them. Operator input selects the symbol but never controls its coordinates.
Ūdens temperatūra is an independent fixed-template renderer. Its six ranges are currently manual editorial inputs rather than station-query results. A Latvian-named field configuration maps each water area to locked canvas coordinates. The workflow produces explicit 1920×1080 and 3840×1440 canvases and filenames; each size still requires comparison against newsroom output.
Monda Regular and Bold are bundled locally and used by the interface and generated text. Daira remains a separate font used only for weather-symbol glyphs.