1.0 KiB
1.0 KiB
eco-aip-backend
Minimal backend skeleton for AIP Ecology Analytics.
Quick start
- Copy
.env.exampleto.envand edit values if needed. - 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.sqlon first DB start. - Worker ingests WAQI bounds data using
WAQI_TOKENand 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.