pgx
PGX — Lightweight Postgres for AI agents. Written in Rust. Thousands of isolated databases in one runtime. 🐘
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證WeatherOps — Weather-aware e-commerce delivery intelligence platform for monitoring, predicting, and analyzing rainfall-driven delivery risks.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Live: https://weather-ops-delivery-intelligence.vercel.app · desktop and laptop only (1366 px and wider)
WeatherOps is an internal tool for ShopFlow India, a fictional e-commerce company, used by
delivery operations managers and logistics analysts. It answers, within seconds:
Loop: Monitor → Analyze → Predict → Simulate. All customers, orders, routes and costs are
synthetic demo data. Rainfall is real: Open-Meteo archive (ERA5) daily rain 2015–2025 and hourly
rain 2022–2025 for 40 Indian cities (CC BY 4.0).檢視完整 README ↗Live: https://weather-ops-delivery-intelligence.vercel.app · desktop and laptop only (1366 px and wider)
WeatherOps is an internal tool for ShopFlow India, a fictional e-commerce company, used by delivery operations managers and logistics analysts. It answers, within seconds:
| Question | Where |
|---|---|
| What is happening right now? | 01 Overview — live KPIs, alerts, rain-hit regions, critical orders |
| Where is rainfall affecting deliveries? | 02 Map — India heat map (Delivery impact / Historical rainfall), drill-down India → state → city → warehouse/hub → route → orders |
| Which upcoming orders are at risk, and why? | 03 Future — 6/12/24/48 h risk table, 48 h timeline, per-order explanation |
| What could reduce the impact? | 03 Future — scenario simulation (dispatch shift, reroute, micro-hub, rain severity) |
| What happened historically? | 04 History — monthly, yearly, seasonal, geographic, product and rain-severity analysis |
Loop: Monitor → Analyze → Predict → Simulate. All customers, orders, routes and costs are synthetic demo data. Rainfall is real: Open-Meteo archive (ERA5) daily rain 2015–2025 and hourly rain 2022–2025 for 40 Indian cities (CC BY 4.0).
seed job (once) ShopFlow master data · 2015-2025 rainfall + climatology · synthetic history
2021 → Jul 2025 (0.8 M route-day rows, 26 M orders) · SLA-breach model ─▶ PostgreSQL
simulator ──▶ Kafka shopflow-events orders, assignments, dispatches, vehicle movement,
(~50-100 events/s) hub arrivals, delays, deliveries, hourly weather;
replays real Jul-Aug 2025 rain at 60x; injects
duplicates and invalid events
Spark Structured Streaming ─┬─ invalid ─▶ shopflow-quarantine
├─ valid, deduplicated ─▶ shopflow-clean + Postgres delivery_events
├─ 30 s windows per city ─▶ shopflow-metrics + Postgres stream_metrics
└─ raw ─▶ S3 (data lake) progress listener ─▶ Redis (health)
engine live operations state · weather → delay impact · future-order risk · alerts
─▶ Redis (views + pub/sub) and Postgres (orders, predictions, weather risk, live history)
FastAPI REST + WebSocket ─▶ Next.js dashboard (Vercel); committed demo snapshot when offline
One on-demand k3s node on AWS (Terraform), Traefik + Let's Encrypt (35-170-210-110.sslip.io).
weatherops/)delay.py): weather ETA = normal ETA × (1 + (m − 1) × route sensitivity),
m = 1.00 / 1.12 / 1.30 / 1.56 for dry / rain / heavy / extreme (IMD-based classes). BLR → MYS:
5.8 h normal, 6.5 h rain, 7.6 h heavy, 9.1 h extreme. Weather-induced delay = weather ETA − normal ETA.risk.py): 0–100 = rainfall severity (≤30) + historical route impact (≤20)
scenario.py): the same models re-applied to upcoming order cohorts with levers;
results are labelled simulated impact / estimated outcome and saved to simulation_runs.db/schema.sql)cities, warehouses, hubs, routes, categories, products, customers, vehicles · weather_history,
weather_climatology, weather_risk · orders, order_items, delivery_events, stream_metrics,
delivery_predictions · history_daily (+ history_monthly materialized view), route_weather_impact,
weather_impact view · model_coefficients · simulation_runs, scenario_results.
WEATHEROPS_HOST=35-170-210-110.sslip.io TF_AUTO_APPROVE=1 ./deploy.sh # node, Kafka, Redis, Postgres, seed, apps
./deploy.sh --status
./deploy.sh --restart-replay # start the simulated operations over
./deploy.sh --down # stop paying for the node (Elastic IP, S3, IAM stay)
Dashboard: cd dashboard && NEXT_PUBLIC_API_HOST=35-170-210-110.sslip.io npm run dev.
Refresh the offline snapshot: API=https://35-170-210-110.sslip.io npm run capture-demo.
Rainfall baseline: python -m seed.fetch_rain (≈25 min, Open-Meteo rate limits).
pytest # models, seed, simulator, engine, API (83 tests; 5 SQL tests need TEST_PG_DSN)
TEST_PG_DSN="host=... dbname=weatherops ..." pytest serving/tests/test_queries_pg.py # SQL on live data
cd dashboard && npm test
# Spark plans (Python 3.8, in the Spark image):
MSYS_NO_PATHCONV=1 docker run --rm --user 0 -v "$PWD:/repo" -w /repo \
-e PYTHONPATH=/opt/spark/python:/opt/spark/python/lib/py4j-0.10.9.7-src.zip:/repo \
apache/spark:3.5.3-python3 bash -c "pip install -q pytest && python3 -m pytest -q spark_processor/tests"
Design: docs/specs/2026-10-02-shopflow-delivery-intelligence-design.md.