2026-03-09 10:53:23 +08:00
# 🌡️ PolyWeather Pro
2026-02-05 19:52:02 +08:00
2026-03-09 10:53:23 +08:00
> **Professional Weather Intelligence System** — Specialized in edge data collection, DEB smart blending, and real-time decision alerts.
2026-03-03 00:06:19 +08:00
2026-03-06 19:16:48 +08:00
---
2026-03-06 19:10:05 +08:00
2026-03-06 19:16:48 +08:00
## 💎 Project Vision
2026-03-06 19:10:05 +08:00
2026-03-09 10:53:23 +08:00
PolyWeather is a specialized intelligence system built for **Polymarket** high-stakes participants. We aggregate top-tier meteorological sources, apply proprietary **DEB (Dynamic Error Balancing)** logic, and surface **actionable shift signals** at critical decision windows.
2026-02-07 01:21:55 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
## 🏗️ Production Architecture
2026-03-03 22:06:41 +08:00
2026-03-09 10:53:23 +08:00
This project uses a decoupled production setup for reliability and iteration speed:
2026-03-03 22:06:41 +08:00
2026-03-09 10:53:23 +08:00
- **Frontend**: A **Next.js** dashboard on **Vercel** with React component rendering.
- **Backend API**: A **FastAPI** service on VPS for low-latency weather aggregation and analysis.
- **Bot & Alert Heartbeat**: A **Telegram Bot** on VPS for minute-level scanning and push alerts.
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
🔗 **Official Visit** : [polyweather-pro.vercel.app ](https://polyweather-pro.vercel.app/ )
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
## 🖼️ Preview & Interaction
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
<p align="center">
<img src="docs/images/demo_ankara.png" alt="PolyWeather Demo - Ankara Live Analysis" width="450">
<br>
2026-03-09 10:53:23 +08:00
<em>📊 <b>Deep Query View</b>: DEB blended forecast + settlement probability + AI analysis context</em>
2026-03-06 19:16:48 +08:00
</p>
2026-03-01 19:17:27 +08:00
2026-03-06 19:16:48 +08:00
<p align="center">
<img src="./docs/images/demo_map.png" alt="PolyWeather Web Map" width="850">
<br>
2026-03-09 10:53:23 +08:00
<em>🗺️ <b>Omni-Dashboard</b>: global station markers + nearby station context + right-side city intelligence panel</em>
2026-03-06 19:16:48 +08:00
</p>
2026-03-01 19:17:27 +08:00
2026-03-06 19:16:48 +08:00
---
2026-03-01 19:17:27 +08:00
2026-03-06 19:16:48 +08:00
## 🚀 Core Features
2026-03-01 19:17:27 +08:00
2026-03-06 19:16:48 +08:00
- **📡 Full-Spectrum Collection**
2026-03-09 10:53:23 +08:00
- **Major Models**: ECMWF, GFS, ICON, GEM, JMA, Open-Meteo, and city-level daily/hourly guidance.
- **Observed Data**: Aviation Weather / METAR as the primary observation source, plus Turkish MGM coverage for Ankara.
- **City Specialization**: `17130` (`Ankara (Bölge/Center)` ) remains the Ankara lead station without replacing LTAC settlement observation.
2026-03-06 19:16:48 +08:00
- **⚖️ DEB Smart Blending**
2026-03-09 10:53:23 +08:00
- Dynamic weighting based on city-level performance and current model spread.
2026-03-10 09:02:56 +08:00
- **📈 Market Data Integration**
- Live Polymarket quotes, probabilities, and dynamic settlement bucket tracking.
- Automatic Market Edge and Spread calculation comparing DEB vs Market.
2026-03-10 09:16:23 +08:00
- **🧩 React Quant Dashboard (v2.0)**
- **Pull-based Dynamic Cache**: Default 5-minute TTL safety lock, with a 1-minute high-frequency bypass exclusively for Ankara (ANKARA).
- **Optimistic UI & Cache Breakthrough**: Manual `force_refresh` trigger maintains legacy observations during load to prevent screen flickering, isolating loading states only to external polymarket edges.
- **Dark Quant Aesthetics**: Upgraded from emojis to native `lucide-react` SVGs. Re-engineered cold/warm structure progress bars, dynamic threshold palettes, and fluid 100% card widths.
- **Bilingual & Seamless**: Built-in comprehensive `i18n.ts` with transparent localization mapping.
- **🔔 Edge Analytics & Alerts**
2026-03-09 10:53:23 +08:00
- **Momentum Spike**: Captures rapid short-window temperature slope changes.
- **Forecast Breakthrough**: Fires when observations break model envelopes plus margin.
2026-03-10 09:16:23 +08:00
- **Advection Monitoring**: Combines lead-station and wind direction to judge cold/warm advections against live temperature drifts.
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
## 🔐 Alert Logic Details
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
| Trigger Name | Core Logic | Trading Value |
| :--------------- | :-------------------------------------------- | :-------------------------------------------- |
| **Center Hit** | Detects DEB trigger only at Ankara HQ `17130` | **Highest priority signal** , the "truth" |
| **Momentum** | 30min temperature slope exceed threshold | Captures sudden weather fronts |
| **Breakthrough** | Pierces all model highs + margin | Captures high-volatility outlier events |
| **Advection** | Lead station rise + Wind match | Gain 20-40 minutes of lead time for execution |
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-27 14:36:36 +08:00
2026-03-09 04:41:24 +08:00
## 🧭 Current Data Logic
- **Primary observation source**: Aviation Weather / METAR
- **Ankara enhancement**:
- Settlement observation: `LTAC / Esenboğa`
- Official lead station: `Ankara (Bölge/Center)` / `17130`
2026-03-09 10:53:23 +08:00
- Nearby station layer: Turkish MGM network (Ankara-specific preferred station ordering)
2026-03-09 04:41:24 +08:00
- **Other cities nearby layer**:
2026-03-09 10:53:23 +08:00
- Production currently uses Aviation Weather METAR clusters
- U.S. cities may later receive Mesonet augmentation while METAR stays baseline
- **Frontend request optimization**:
- Initial map temperatures preload via `/api/city/{name}/summary`
- City detail cache TTL = 5 minutes, revision probe avoids unnecessary refetch
- Map movements, panel toggles, and modal open/close do not trigger redundant requests
- Manual refresh always bypasses cache (`force_refresh=true` )
2026-03-09 04:41:24 +08:00
---
2026-03-06 19:16:48 +08:00
## 🏗️ System Architecture
2026-02-27 14:36:36 +08:00
2026-03-06 19:16:48 +08:00
```mermaid
graph TD
subgraph "Client / Terminals"
2026-03-09 10:53:23 +08:00
Web[Next.js React Web App]
2026-03-06 19:16:48 +08:00
TG[Telegram Client]
end
subgraph "Edge Deployment (Vercel)"
2026-03-09 10:53:23 +08:00
Web --> |BFF Routes| Fast[FastAPI API]
2026-03-06 19:16:48 +08:00
end
subgraph "Core Hub (VPS)"
Fast --- |Shared Logic| Worker[Alert Engine / Worker]
Bot[Telegram Bot] --- |Shared Logic| Worker
end
subgraph "External Sources"
Worker --> |Pull| MGM[MGM Weather]
Worker --> |Pull| METAR[Airport METAR]
Worker --> |Pull| OM[Open-Meteo]
Worker --> |Pull| MM[Multi-Model Integration]
end
Worker --> |Push Alert| TG
Bot --> |Query| Worker
2026-03-06 19:10:05 +08:00
```
2026-02-27 14:36:36 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-27 01:58:29 +08:00
2026-03-06 19:16:48 +08:00
## 🛠️ Deployment
2026-02-07 01:21:55 +08:00
2026-03-06 19:16:48 +08:00
### 1. Backend / Bot (VPS)
2026-02-18 09:49:40 +08:00
2026-03-06 19:16:48 +08:00
```bash
2026-03-09 10:53:23 +08:00
# Pull source
2026-03-06 19:16:48 +08:00
git pull
2026-03-03 00:01:57 +08:00
2026-03-06 19:16:48 +08:00
# Environment
# Edit .env with TELEGRAM_BOT_TOKEN and other keys
2026-02-18 09:49:40 +08:00
2026-03-06 19:16:48 +08:00
# Launch
docker-compose up -d --build
2026-02-07 01:21:55 +08:00
```
2026-03-06 19:16:48 +08:00
### 2. Frontend (Vercel)
2026-02-06 20:16:45 +08:00
2026-03-09 10:53:23 +08:00
Set `frontend` as the Vercel root directory for automatic CI/CD.
2026-02-22 10:01:32 +08:00
2026-03-06 19:16:48 +08:00
---
2026-02-22 10:01:32 +08:00
2026-03-06 19:16:48 +08:00
## 💬 Bot Commands
2026-02-23 21:23:52 +08:00
2026-03-10 09:02:56 +08:00
| Command | Description | Example |
| :------ | :------------------------------------ | :------------- |
| `/city` | Query real-time analysis for a city | `/city ankara` |
| `/deb` | View historical accuracy of DEB model | `/deb london` |
| `/top` | View activity leaderboard | `/top` |
| `/help` | Get detailed instructions | `/help` |
2026-02-05 19:52:02 +08:00
2026-03-06 19:16:48 +08:00
---
2026-03-04 03:06:40 +08:00
2026-03-06 19:16:48 +08:00
> [!NOTE]
2026-03-09 10:53:23 +08:00
> **Commercialization**: Current plans keep **Web Dashboard ($5/mo)** and **Telegram Signal Channel ($1/mo)** as the core entry offers.
> User entitlement and payment automation are tracked in `docs/COMMERCIALIZATION.md`.
2026-03-04 03:06:40 +08:00
2026-03-09 04:41:24 +08:00
> [!NOTE]
2026-03-09 10:53:23 +08:00
> **Frontend Model**: Production rendering is now fully handled by React components under `frontend/components/dashboard` and hooks under `frontend/hooks`.
> Legacy static files are retained for reference, but no longer act as the main runtime path.
2026-03-09 04:41:24 +08:00
2026-03-06 19:16:48 +08:00
---
2026-03-04 03:06:40 +08:00
2026-03-08 04:35:04 +08:00
---
2026-03-10 09:02:56 +08:00
** 📅 Last Updated**: 2026-03-10
** 🚀 Status**: v1.2 Stable - React Dashboard with i18n & Polymarket Integration in Production
2026-03-08 04:35:04 +08:00
> [!TIP]
2026-03-10 09:02:56 +08:00
> **Production Note**: The UI layout remains consistent while introducing full internationalization, market quote integration, and premium visual feedback (glassmorphism overlays, sonar markers).