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.