Files
PolyWeather/frontend
2569718930@qq.com 25ab512371 release: v1.4.0
2026-03-20 19:13:14 +08:00
..
2026-03-17 23:15:13 +08:00
2026-03-20 19:13:14 +08:00

PolyWeather 前端

PolyWeather Pro 的生产前端工程。

线上地址:

技术栈

  • Next.js App Router
  • React + Tailwind
  • Leaflet + Chart.js
  • Supabase Auth
  • WalletConnect + 浏览器 EVM 钱包

运行模型

  1. 浏览器 -> Next 应用(frontend
  2. Next Route Handlers/api/*-> FastAPI 后端
  3. FastAPI -> 分析服务 / 支付服务

本地开发

cd frontend
cp .env.example .env.local
npm install
npm run dev

必需环境变量

POLYWEATHER_API_BASE_URL=https://<your-fastapi-host>
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
POLYWEATHER_AUTH_ENABLED=true
POLYWEATHER_AUTH_REQUIRED=false
POLYWEATHER_BACKEND_ENTITLEMENT_TOKEN=

WalletConnect

NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
NEXT_PUBLIC_WALLETCONNECT_POLYGON_RPC_URL=https://polygon-bor-rpc.publicnode.com

浮层链接:

NEXT_PUBLIC_TELEGRAM_GROUP_URL=https://t.me/<your_group>

路由处理器

天气:

  • GET /api/cities
  • GET /api/city/[name]
  • GET /api/city/[name]/summary
  • GET /api/city/[name]/detail
  • GET /api/history/[name]

鉴权:

  • GET /api/auth/me

支付:

  • GET /api/payments/config
  • GET /api/payments/wallets
  • POST /api/payments/wallets/challenge
  • POST /api/payments/wallets/verify
  • POST /api/payments/intents
  • GET /api/payments/intents/[intentId]
  • POST /api/payments/intents/[intentId]/submit
  • POST /api/payments/intents/[intentId]/confirm

缓存行为

  • cities / summary / historyETag + Cache-Control
  • summary?force_refresh=trueno-store
  • 支付相关路由:no-store

开源边界说明

此前端仓库包含通用产品界面和标准支付体验。 商业策略调优、私有运营流程和敏感生产参数不在公开文档范围内。

详见根目录策略文档:docs/OPEN_CORE_POLICY.md

最后更新:2026-03-14