NODEDC_1C/docs/ADDRESS/tz/1/eco-aip-backend/README.md

1.0 KiB

eco-aip-backend

Minimal backend skeleton for AIP Ecology Analytics.

Quick start

  1. Copy .env.example to .env and edit values if needed.
  2. Run:
docker compose up -d --build

Verify

  • API health:
curl http://localhost:9501/health
  • Summary (last 24h by default):
curl "http://localhost:9501/aip/waqi/summary"
  • Anomalies (last 24h by default):
curl "http://localhost:9501/aip/waqi/anomalies"
  • History (daily measurements, MSK date):
curl "http://localhost:9501/aip/waqi/history?date=2025-12-22"
  • DB tables:
docker compose exec db psql -U aip_user -d aip_ecology -c "\dt"
  • Worker ticks:
docker compose logs -f worker

Notes

  • Times are stored as UTC (timestamptz).
  • Schema is initialized from db/init/001_init.sql on first DB start.
  • Worker ingests WAQI bounds data using WAQI_TOKEN and bbox env values.
  • Database files are stored in db/data (bind mount).
  • Worker detects basic anomalies (delay/stuck/spike) using observed_ts and env thresholds.