Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith bf889681f6 Move the climate record from parquet to TimescaleDB hypertables (#227)
Replace the per-cell parquet cache with TimescaleDB hypertables as the
production backend for the raw daily climate record, and drop pg_duckdb.
Parquet stays the backend whenever THERMOGRAPH_DATABASE_URL is not a
Postgres URL (dev, tests, offline tooling), the same dialect switch the
accounts DB and derived store already use, so CI stays Postgres-free.

- data/climate_store.py: psycopg + polars bridge over climate_history
  (a hypertable), climate_recent, and climate_sync (per-cell freshness).
  Reads via pl.read_database, writes via COPY + ON CONFLICT upsert;
  fail-soft to a cache miss so a DB hiccup degrades to upstream refetch.
- data/climate.py: route every cache/mtime touchpoint through a backend
  dispatch. recent_stamp becomes int(recent_synced_at) on Postgres; the
  stale-serve path still avoids bumping it, so derived-payload tokens
  invalidate on exactly the same events as before.
- alembic 0002: CREATE EXTENSION timescaledb plus the hypertable schema
  (compression policy on year-old chunks), guarded to no-op off Postgres.
- migrate_cache_to_pg.py (make migrate-cache): idempotent backfill of the
  parquet cache into the hypertables, preserving file mtimes as sync
  timestamps so recent_stamp is unchanged across cutover.
- db image -> stock timescale/timescaledb:latest-pg18; drop the custom
  pg_duckdb Dockerfile, the read-only /parquet mount, and the duckdb
  tuning GUC. Docs updated for the new backend and cutover.

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-20 20:15:55 +00:00
accounts Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
alembic Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
core Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
data Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
deploy Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
notifications Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
templates Fix the footer leaking "wrapper. #}" from a broken Jinja comment (#211) 2026-07-20 04:14:56 +00:00
tests Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
web Score every metric equally in the overall total (#218) 2026-07-20 05:45:57 +00:00
alembic.ini Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
app.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
cities.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
cities_flavor.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
gen_cities.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
gen_flavor.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
indexnow.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
migrate.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
migrate_accounts_to_pg.py Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
migrate_cache_to_pg.py Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
paths.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
warm_cities.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00